我在 tomcat7 上运行 grails 生成的 war 文件时遇到问题。如果/当我使用 grails run-app 运行同一个应用程序时,一切都很好并且工作顺序正确。我在运行 tomcat7 和部署战争时遇到的异常:
2014-08-20 09:17:28,933 [http-bio-127.0.0.1-8080-exec-7] ERROR errors.GrailsExceptionResolver - ClassNotFoundException occurred when processing request: [GET] /
jline.console.history.History. Stacktrace follows:
java.lang.ClassNotFoundException: jline.console.history.History
at org.codehaus.plugin.swagger.builder.SwaggerDocsBuilder.buildApiDeclarations(SwaggerDocsBuilder.groovy:71)
at org.codehaus.plugin.swagger.builder.SwaggerDocsBuilder.rebuild(SwaggerDocsBuilder.groovy:48)
at org.codehaus.plugin.swagger.builder.SwaggerDocsBuilder.build(SwaggerDocsBuilder.groovy:36)
at org.codehaus.grails.plugins.swaggerapidocs.SwaggerApiDocsController.resources(SwaggerApiDocsController.groovy:21)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:198)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at com.brandseye.cors.CorsFilter.doFilter(CorsFilter.java:82)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
第 71 行SwaggerDocsBuilder.groovy
rules = new BuildPathMap().build(grailsApp)
并BuildPathMap
扩展
import org.codehaus.groovy.grails.web.mapping.reporting.AnsiConsoleUrlMappingsRenderer
class BuildPathMap extends AnsiConsoleUrlMappingsRenderer {
我的猜测在AnsiConsoleUrlMappingsRenderer
某种程度上取决于jline.console.history.History
但为什么它会从战争文件中丢失?在战争生成期间是否可以做一些事情来确保正确打包 ll 依赖项?