grails tomcat 7 invocation target exception - java

We have a Grails app running in tomcat 7, was working fine till last week.
We don't know what changed.
we are getting a error as
SEVERE: Error listenerStart
SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: grails.plugin.databasemigration.GrailsChangeLogParser
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:118)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
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.deployWAR(HostConfig.java:977)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
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: org.codehaus.groovy.runtime.InvokerInvoca
We tried,
Cleaning the war building environment
Run dbm-update
Re-install tomcat
Increasing xms and xmx of tomcat
any thing did not help, still error is thrown
gails version is 2.1.0

OK, the problem was we had a server with 8GB RAM machine, till last week the war size was 58 to 59 mb. This week we released code with a new plugin google-visualization:0.6.2 (for charts) and war size became 60 mb. Our server was not capable of handling this size war.
We also verified it by placing the same war in another server with 32GB RAM and was working fine. Also if we remove google-visualization:0.6.2 (for charts) plugin and deployed in 8GB server it was working fine.

Related

Liferay java.lang.ClassNotFoundException: com.liferay.portlet.StrutsPortlet

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)

Is the method of compiling a java file in eclipse and add it to an unzipped jar and renaming the jar back correct?

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

OutOfMemory while deploying war on tomcat

i get the following error when i try to deploy a war (built with 'grails war') on a tomcat server. Unfortunately there is no other message in the logfile except this:
Nov 25, 2013 3:44:54 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke
SEVERE: Exception invoking method check
java.lang.OutOfMemoryError: Java heap space
at java.io.DataInputStream.readUTF(DataInputStream.java:661)
at java.io.DataInputStream.readUTF(DataInputStream.java:564)
at org.apache.tomcat.util.bcel.classfile.ConstantUtf8.<init>(ConstantUtf8.java:47)
at org.apache.tomcat.util.bcel.classfile.Constant.readConstant(Constant.java:125)
at org.apache.tomcat.util.bcel.classfile.ConstantPool.<init>(ConstantPool.java:60)
at org.apache.tomcat.util.bcel.classfile.ClassParser.readConstantPool(ClassParser.java:209)
at org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:119)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2118)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1994)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1960)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1945)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1319)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
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.deployWAR(HostConfig.java:976)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:541)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
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:1445)
How can i get more information about this error?
Notes:
the grails app is working locally without any issues
other grails apps are working on the same server without problems (all with version 2.2.0, the new one is on 2.3)
i already tried to extend the memory heap ... no improvement
Thank you
What Tomcat version you use? If you for example run Debian Wheezy box, the version available from packages is 7.0.28. It has some serious bugs about traversing classpaths for scanning for annotations (at least that's what I noticed after reading few other questions on SO and bug reports). I think it was fixed somewhere ~ 7.0.34. I had an exactly same problem and noticed that everything runs fine on newer versions.
1- Create setenv.sh in Tomcat(8||9)/bin/setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -Xms512m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx2048m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=256m"
2- chamod a+x setenv.sh
3- execute ./setenv.sh
4- ./startup.sh
Add to setenv.sh the following option in CATALINA_OPTS -XX:+HeapDumpOnOutOfMemoryError it will print heap dump when your deploy will fall down with OOM, which you can analyze by such utilities as JVisualVM or MemoryAnalyzer. After investigation of heap dump you can make decision:
Fix an issue which produce OutOfMemory
Increase heap size (by setting -Xmx in CATALINA_OPTS) in case you can't fix an issue.

What is wrong with my config? SEVERE: IOException while loading persisted sessions: java.io.EOFException

I have a web program using struts2, spring3 and hibernate 4 running in Tomcat. It can work, but Tomcat reports a java.io.EOFException.
The following is the tomcat log:
INFO: Deploying web application directory D:\apache-tomcat-7.0.29\webapps\manager
九月 10, 2012 4:27:02 下午 org.apache.catalina.session.StandardManager doLoad
SEVERE: IOException while loading persisted sessions: java.io.EOFException
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2298)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2767)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:798)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298)
at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:58)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:246)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
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:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
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)
九月 10, 2012 4:27:02 下午 org.apache.catalina.session.StandardManager startInternal
SEVERE: Exception loading sessions from persistent storage
java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2298)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2767)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:798)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:298)
at org.apache.catalina.util.CustomObjectInputStream.<init>(CustomObjectInputStream.java:58)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:246)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
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:618)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1100)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1618)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
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)
You can delete ${catalina.home}/work/Catalina/localhost/<app>/SESSION.ser where app is your application.
You can delete ${CATALINA_HOME}/work/Catalina/localhost/test
where test is your application folder (war name).
This solved my issue
Try deleting tomcat's Work folder, then restart tomcat. It worked for me!
I am having a project in eclipse and using tomcat plugin to run it, I tried this but it didn't help, so I observed in my project directory structure there is one more work directory, I removed that directory and everything started working. Just wanted to share this one more possible answer for others like me.
I tried the methods above : "delete work directory" in the ${CATALINA_HOME}/work/Catalina/localhost, "uncomment manager pathname" in the ${CATALINA_HOME}/conf/context.xml. Not worked.
And I found that in my eclipse projects, the server project had a file called "context.xml" too, it must be copied when the server project was created. And I "uncomment manager pathname" there, it worked finally!
Hope it will help someone!
As #GauravS said. I am using eclipse so when I right click on tomcat Server (in Servers window) and clean it it worked...
Sometimes I have to remove the war from tomcat, clean than run it again.
Sometimes I delete tomcat and right click on Servers window, New , Server and I use same ports I was using and delete the old server.
PS: to open Servers window:
Window - Show View - Other - write "Servers" and choose it from the list - OK

Infinite loop when deploying a war on tomcat 7

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 . . .

Categories