Tomcat部署Grails应用程序时出错

时间:2016-05-11 18:35:07

标签: tomcat grails grails-2.0 tomcat8 grails-controller

我有一个Grails(v.2.5.3)应用程序,当我通过选项部署Tomcat时:要部署的WAR文件,选择 war文件以下错误出现。如果我更容易尝试应用程序(大小,复杂性等),它运行良好。

但是,如果我将war文件的内容手动复制到Tomcat路径: pathTomcat / webapps / myApplication ,当我从管理器运行应用程序时,它运行良好。出现任何错误。

错误:

11-May-2016 19:54:33.973 INFO [http-nio-8080-exec-15] org.apache.catalina.startup.HostConfig.deployWAR Despliegue del archivo /usr/local/apache-tomcat-8.0.30/webapps/MYAPP.war de la aplicación web
11-May-2016 19:54:40.215 SEVERE [http-nio-8080-exec-15] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start: 
 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/MYAPP]]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:466)
    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1583)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
    at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1460)
    at org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:288)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:209)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:614)
    at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:312)
    at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:95)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [/MYAPP] due to a StackOverflowError. Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies. The class hierarchy being processed was [org.bouncycastle.asn1.ASN1Boolean->org.bouncycastle.asn1.DERBoolean->org.bouncycastle.asn1.ASN1Boolean]
    at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:2066)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2012)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1961)
    at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1936)
    at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1897)
    at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1149)
    at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:771)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:305)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:95)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    ... 47 more

Grails依赖性报告:

+--- org.grails:grails-docs:2.5.3
    ...
    \--- com.lowagie:itext:2.0.8
       \--- bouncycastle:bcmail-jdk14:138
       \--- bouncycastle:bcprov-jdk14:138
....

+--- org.grails.plugins:tika-parser:1.9.0
   \--- org.bouncycastle:bcmail-jdk15on:1.52
   \--- org.bouncycastle:bcpkix-jdk15on:1.52
   \--- org.bouncycastle:bcprov-jdk15on:1.52
....

+--- org.grails.plugins:jasypt-encryption:1.3.1
   \--- org.bouncycastle:bcprov-jdk16:1.46

自定义文件夹:

enter image description here

使用BuildConfig.groovy中的以下配置解决:

compile ("org.grails.plugins:jasypt-encryption:1.3.1") {
            excludes "bcprov-jdk16"
        }

感谢。

1 个答案:

答案 0 :(得分:1)

很可能你有org.bouncycastle库的两个版本

您可以运行grails dependency-report来检查您的依赖项,并确保仅从1个jar中为lib提供服务

好像你有一个坏人org.bouncycastle:bcprov-jdk16:1.46所以你需要删除并检查哪些插件拉动了这个依赖项,并确保将它从依赖项中排除,所以在BuildConfig.groovy中你将拥有

来自doc

  

默认情况下,Grails不仅会获得您的JAR和插件   声明,但它也将获得它们的传递依赖。这是   通常你想要什么,但有时候你想要一个   没有全部包袱的依赖。在这种情况下,您可以禁用   根据具体情况进行传递依赖性解决:

     

更常见的情况是你想要传递的地方   依赖项,但其中一些会导致您自己的依赖项出现问题   或者是不必要的。例如,许多Apache项目都有   'commons-logging'作为传递依赖,但它不应该   包含在Grails项目中(我们使用SLF4J)。这就是排除的地方   选项进来:

runtime('com.mysql:mysql-connector-java:5.1.16',
        'net.sf.ehcache:ehcache:1.6.1') {
    excludes "xml-apis", "commons-logging"
}
// Or
runtime(group:'com.mysql', name:'mysql-connector-java', version:'5.1.16') {
    excludes([ group: 'xml-apis', name: 'xml-apis'],
             [ group: 'org.apache.httpcomponents' ],
             [ name: 'commons-logging' ])

您需要从依赖项中排除bcprov-jdk16