I have been stuck for the last couple of days deploying a standard WAR to Virgo-tomcat server (version 3.0.2). The standard WAR file exported from eclipse works perfectly fine on tomcat, but not when deploying to Virgo-tomcat.
I have read the users-guide and the programmers guide, and as far as I'm aware - it should be a case of deploying the WAR to the VIRGO_HOME/pickup directory (or alternatively using the application manager). I have tried both methods, yet nothing works.
Here are the results from the logs.
[2012-06-22 12:00:43.545] ERROR start-signalling-1 o.a.c.c.C.[Catalina].[localhost].[/spring-social-statusnet-tssg] Error configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.eclipse.gemini.web.tomcat.internal.loading.BundleWebappClassLoader.loadClass(BundleWebappClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:124)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4715)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:122)
at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)
at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:247)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:294)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:291)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:229)
at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:143)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
[2012-06-22 12:00:43.546] ERROR start-signalling-1 o.a.c.c.C.[Catalina].[localhost].[/spring-social-statusnet-tssg] Skipped installing application listeners due to previous error(s)
[2012-06-22 12:00:43.547] ERROR start-signalling-1 org.apache.catalina.core.StandardContext Error listenerStart
[2012-06-22 12:00:43.547] ERROR start-signalling-1 org.apache.catalina.core.StandardContext Context [/spring-social-statusnet-tssg] startup failed due to previous errors
[2012-06-22 12:00:43.702] ERROR start-signalling-1 org.eclipse.gemini.web.internal.StandardWebApplication Failed to start web application at bundleContext path '/spring-social-statusnet-tssg' org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/spring-social-statusnet-tssg' failed to start. Check the logs for more details.
at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125)
at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)
at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:247)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:294)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:291)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:229)
at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:143)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
[2012-06-22 12:00:43.708] ERROR start-signalling-1 org.eclipse.virgo.medic.eventlog.default WE0005E Failed to start web bundle 'spring-social-statusnet-tssg' version '0.0.0': consult serviceability/logs/log.log for further details.
[2012-06-22 12:00:43.709] INFO start-signalling-1 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'KernelBundleClassLoader: [bundle=spring-social-statusnet-tssg_0.0.0]' popped and set to 'BundleDelegatingClassLoader for [spring-osgi-extender (org.springframework.osgi.extender)]'
[2012-06-22 12:00:43.709] INFO start-signalling-1 o.e.v.k.i.artifact.internal.bundle.BundleThreadContextManager Thread context class loader 'BundleDelegatingClassLoader for [spring-osgi-extender (org.springframework.osgi.extender)]' pushed and set to 'KernelBundleClassLoader: [bundle=spring-social-statusnet-tssg_0.0.0]'
[2012-06-22 12:00:43.709] INFO start-signalling-1 o.e.v.k.i.a.internal.AtomicInstallArtifactLifecycleListener No atomic parent of bundle 'spring-social-statusnet-tssg' version '0.0.0' in scope 'null' to propagate start failed (stop) event to
[2012-06-22 12:00:43.715] ERROR start-signalling-1 org.eclipse.virgo.medic.eventlog.default DE0006E Start failed for bundle 'spring-social-statusnet-tssg' version '0.0.0'. org.eclipse.virgo.kernel.deployer.core.DeploymentException: Web application failed to start
at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:132)
at org.eclipse.virgo.kernel.install.artifact.internal.StandardArtifactStateMonitor.onStarted(StandardArtifactStateMonitor.java:247)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.asyncStartSucceeded(AbstractInstallArtifact.java:294)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact.access$0(AbstractInstallArtifact.java:291)
at org.eclipse.virgo.kernel.install.artifact.internal.AbstractInstallArtifact$StateMonitorSignal.signalSuccessfulCompletion(AbstractInstallArtifact.java:229)
at org.eclipse.virgo.kernel.core.internal.BundleStartTracker$1.run(BundleStartTracker.java:143)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.eclipse.gemini.web.core.WebApplicationStartFailedException: org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/spring-social-statusnet-tssg' failed to start. Check the logs for more details.
at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:108)
at org.eclipse.virgo.web.core.internal.WebBundleLifecycleListener.onStarted(WebBundleLifecycleListener.java:122)
... 8 common frames omitted
Caused by: org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/spring-social-statusnet-tssg' failed to start. Check the logs for more details.
at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:125)
at org.eclipse.gemini.web.internal.StandardWebApplication.start(StandardWebApplication.java:91)
... 9 common frames omitted
Ok, so after testing a couple of test applications, I managed to get some sample WARs to run on Virgo without any modification.
To fix the problem at hand, I added the following line to the MANIFEST.MF file of my web app.
Import-Package: org.springframework.web.context
Related
I am deploying a web application and getting following exception when try to deploy through tomcat 9.
I am getting below exception in tomcat while deployment FAIL - Application at context path [/webCenter-EN-Entitlement] could not be started FAIL - Encountered exception [org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot#299321e2]]
In Tomcat Log files found following exception. Please help with any solution. Your help is appreciated in advance.
Caused by: org.apache.catalina.LifecycleException: Failed to start component [org.apache.catalina.webresources.StandardRoot#2d1dee39]
at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4830)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4966)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
... 37 more
Caused by: java.lang.IllegalArgumentException: The main resource set specified [H:\XXXXXX] is not valid
at org.apache.catalina.webresources.StandardRoot.createMainResourceSet(StandardRoot.java:751)
at org.apache.catalina.webresources.StandardRoot.startInternal(StandardRoot.java:708)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
... 41 more
Issue is resolved. Folder which contains my web application was not have necessary permission to the account which was used to Run Tomcat Service.
I have an error which is already getting me crazy.
It's a Liferay 6.1 with Tomcat and we are talking about the preproduction environment. A portlet is deployed but it fails in the deployment phase. This is the error:
After this error, I see a message saying the portlet has been undeployed.
We have tried to deploy another .war which was working before but the error continues. This error only appears in the preproducction environtmet because in integration and production environtmets it is correctly working.
I have tried the next stepts:
- Stop server
- Delete temp folder
- Delete work
- Delete the portlet from webbapp
- Start server
- Check file permissions
- Check dependencies/libs with other struts portlet which is correctly working.
And nothing, as soon as the portlet is deployed (with a version that previously worked), the same error appears.
The portlet makes use of struts and I have also tried putting the library inside the portlet. But it is still the same.
Any idea?
This is the error:
17:37:58,240 INFO [localhost-startStop-2][HotDeployImpl:178] Deploying qui-es-qui-portlet from queue
17:37:58,241 INFO [localhost-startStop-2][PluginPackageUtil:1033] Reading plugin package for qui-es-qui-portlet
17:37:58,451 WARN [localhost-startStop-2][PortletLocalServiceImpl:1145] Duplicate struts path qui-es-qui
17:37:58,453 ERROR [localhost-startStop-2][PortletBagFactory:123] java.lang.ClassNotFoundException: com.liferay.portlet.StrutsPortlet
java.lang.ClassNotFoundException: com.liferay.portlet.StrutsPortlet
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:120)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:546)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:321)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:120)
at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151)
at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:52)
at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
I have a jar called framework.jar. I'm renaming it to framework.zip, decompiling one of its class files, modifing it, and putting it back in to the zip and renaming it back to framework.jar.
While I do this without making any modifications to any of the .class files, my tomcat runs fine. However, with my modifications, I get a Lifecycle exception.
Note that I took the corresponding latest compiled .class file from eclipse and replaced the same .class file file.
update:
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngin
e[Catalina].StandardHost[localhost].StandardContext[/enovia]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87
7)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:1120)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig
.java:1678)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.tomee.catalina.TomEERuntimeException: org.apache.openejb.O
penEJBException: Unable to create annotation scanner for web module enovia: null
at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatW
ebAppBuilder.java:2049)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWeb
AppBuilder.java:1091)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWe
bAppBuilder.java:1051)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(Global
ListenerSupport.java:127)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBa
se.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContex
t.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: org.apache.openejb.OpenEJBException: Unable to create annotation scan
ner for web module enovia: null
at org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoa
der.java:838)
at org.apache.openejb.config.DeploymentLoader.load(DeploymentLoader.java
:219)
at org.apache.tomee.catalina.TomcatWebAppBuilder.loadApplication(TomcatW
ebAppBuilder.java:2047)
... 17 more
Caused by: java.lang.IllegalArgumentException
at org.apache.xbean.asm4.ClassReader.<init>(Unknown Source)
at org.apache.xbean.asm4.ClassReader.<init>(Unknown Source)
at org.apache.xbean.asm4.ClassReader.<init>(Unknown Source)
at org.apache.xbean.finder.AnnotationFinder.readClassDef(AnnotationFinde
r.java:1120)
at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java
:139)
at org.apache.xbean.finder.AnnotationFinder.<init>(AnnotationFinder.java
:152)
at org.apache.xbean.finder.AsynchronousInheritanceAnnotationFinder.<init
>(AsynchronousInheritanceAnnotationFinder.java:43)
at org.apache.openejb.config.FinderFactory.newFinder(FinderFactory.java:
114)
at org.apache.openejb.config.FinderFactory.create(FinderFactory.java:68)
at org.apache.openejb.config.FinderFactory.createFinder(FinderFactory.ja
va:57)
at org.apache.openejb.config.DeploymentLoader.addWebModule(DeploymentLoa
der.java:830)
... 19 more
May 13, 2015 9:14:52 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory D:\16x_tomcat\apache-tomee-plu
s-1.6.0\webapps\enovia
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catal
ina.LifecycleException: Failed to start component [StandardEngine[Catalina].Stan
dardHost[localhost].StandardContext[/enovia]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:87
7)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.jav
a:1120)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig
.java:1678)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:51
1)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:617)
at java.lang.Thread.run(Thread.java:745)
update 2:
As greg-449's comment pointed out, the issue was because I was using a java 8 compiler. And that jar was built on a java 7 compiler.
Tomcat: LifecycleException when deploying
Based on the post referenced above you might be missing some start up, note that there should be a log file for a more detailed error report.
Also the legally behind editing pre-compiled jar files...
In almost all cases it is illegal to redistribute work. So therefore if you redistributed in most cases it would not be legal but you really need to check the copyright.
One way to get around it... shhh I didn't tell you this, is to make the user download the jar legally and have them modify it. Normally this is done by giving them a program to do so. And almost all the time the program involves Byte code, so you should use ASM or BCEL. This will shift the legal implications from you to the user. Therefore the user will be violating the terms of user agreement.
For example I used to be apart of the development team for a runescape bot, They used java so we had the user download the jar from the game as they needed anyway and before running it we would inject listeners in the jar. Using BCEL or Reflection
I try to deploy a war into Tomcat 7.0.29. I'm having the following log stack :
GRAVE: Error waiting for multi-thread deployment of context descriptors to complete
java.util.concurrent.ExecutionException: java.lang.StackOverflowError
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:574)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1413)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:346)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1140)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:785)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.StackOverflowError
at java.util.HashSet.<init>(HashSet.java:86)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2208)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2227)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2227)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2227)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2227)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2227)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2227)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2227)
(Many stack frames ommited...)
Does anybody face the same problem ?
This is reported upstream as issue #53871 in Tomcat. The problem appears to be with annotation scanning, and Tomcat 7.0.38 includes a clearer error message.
From the bug report:
Due to dependency management problems I deployed a WAR file containing two JAR files containing different versions of a library, where version 1 contained a class A which inherited from B and another version 2 which contained a class B inheriting from A.
The classes were loaded in such an order that A and B cyclically inherited from each other which leads to a stack overflow in populateSCIsForCacheEntry because it does not detect cycles in the inheritance tree.
This was exactly the problem in my case: an old version of dom4j bundled an incompatible version of jaxen. The new error diagnostic in 7.0.38 showed exactly which classes formed a loop and I fixed it by upgrading those dependencies.
I'm also encountering this issue in Tomcat 7.0.29 and Tomcat 7.0.30. However with Tomcat 7.0.28 everything works fine, so I suspect it's Tomcat issue, that was recently introduced.
The error encountered in 7.0.29 and 7.0.30, when starting Tomcat and deploying a war file:
14:01:06,380 ERROR [HostConfig:576] Error waiting for multi-thread deployment of context descriptors to complete java.util.concurrent.ExecutionException: java.lang.StackOverflowError
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252)
at java.util.concurrent.FutureTask.get(FutureTask.java:111)
at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:574)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1413)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:313)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:346)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1140)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:785)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.StackOverflowError
at java.util.HashSet.<init>(HashSet.java:103)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2243)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2260)
at org.apache.catalina.startup.ContextConfig.populateSCIsForCacheEntry(ContextConfig.java:2260)
For me this behavior reproduced in IntelliJ Idea when I set the Application Context to the same name as the the Maven atrifactId in the .pom file.
E.g. my artifactId is 'test', then I set the Application Context (Edit configuration -> Tomcat Server -> Deployment, select the exploded artifact) to '/test'. As soon as I changed the Application Context, everything worked.
I had the same problem. I think it was caused by Tomcat 7, so when I changed to Tomcat 6.0.35, the problem resolved itself like a charm.
Use a lower version of Tomcat. There are problems with the version of Tomcat you are using.
A workaround : I changed the name of the WAR (no finalName in pom.xml and changed the artifact version) and it worked .... why? I don't know till now!
A real and a genuine solution? Definitely a new Tomcat Release . . .
All,
I am having problems redeploying my java webapp packaged as war using maven 3.0 (mvn package) on tomcat 6.0
However if I restart my server completely i donot get this exception and the whole app runs perfectly fine.
Here is the details of catalina log:
WARNING: Error while removing context []
java.lang.NoClassDefFoundError: org/apache/struts2/util/ObjectFactoryDestroyable
at org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:263)
at org.apache.struts2.dispatcher.FilterDispatcher.destroy(FilterDispatcher.java:238)
at org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:332)
at org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:3731)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4493)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1035)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1203)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(Containe rBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.util.ObjectFactoryDestroyable
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 15 more
Pls help..!