我有一个Grails(2.5.3版)应用程序,当我通过选项:要部署的WAR文件在Tomcat中部署时,选择WAR文件,会出现以下错误。如果我尝试一个更简单的应用程序(大小、复杂度等),它运行得很好。
但是,如果在从manager运行应用程序时手动将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
Lib文件夹:
使用BuildConfig中的以下配置解决。groovy:
compile ("org.grails.plugins:jasypt-encryption:1.3.1") {
excludes "bcprov-jdk16"
}
谢谢
很可能你有两个版本的组织。bouncycastle库
您可以运行grails依赖关系报告来检查您的依赖关系,并确保只从1个jar服务器上提供lib
看来你有个坏人。bouncycastle:bcprov-jdk16:1.46,因此您需要删除并检查哪些插件拉入此依赖项,并确保在构建配置中将其从依赖项中排除。groovy
来自文档
默认情况下,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
我在部署Grails应用程序时遇到了问题。一切都可以在本地测试环境中工作。 错误 [localhost-startStop-1]错误context.grailscontextloader-初始化应用程序时出错:创建名为“Transaction ManagerPostProcessor”的bean时出错:bean初始化失败;嵌套异常为org.springframework.beans.factory
我无法在Tomcat 6上部署Grails 2.2.4应用程序。我尝试了新安装的tomcat,甚至我的应用程序的旧版本(以前运行过)。 此异常在一分钟后引发。在tomcat启动后: 我真的不知道从哪里开始修理它-/
完成干净的构建后,我将war文件复制到Tomcat的文件夹中。但是部署会发生两次,并且在上下文已经存在的情况下以异常结束。我错过了什么? 非常感谢您的帮助。
我在将spring boot应用程序部署到tomcat时遇到了问题,尽管在IDE中工作得很好。我按照https://docs.spring.io/spring-boot/docs/current/reference/html/howto-tegratic-deployment.html中的说明进行了操作 更详细的结构: mvn clear包给出错误:
我正试图在tomcat服务器上部署spring boot应用程序,但遇到严重错误[http-nio-8080-exec-5]org.apache.catalina.startup.hostconfig.deploywar部署web应用程序存档时出错