> Date: Thu, 27 Mar 2014 12:20:28 -0400 > From: ch...@christopherschultz.net > To: users@tomcat.apache.org > Subject: Re: Why Tomcat crashes > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Wangke, > > On 3/27/14, 2:18 AM, wangke wrote: > > Hi All: Recently I've encountered a very strange problem, I managed > > to crash tomcat entirely with my application for a few times. > > Personally, I am quite suspicious about the the settings of a > > shared library libswipl. What I did according to > > https://code.google.com/p/javanaproche/wiki/HowToJPL is I have > > Java.library.path point to libswipl for a jar file called JPL (a > > bidirectional interface between Java and Prolog since I need to run > > some simple Prolog rules) and then when I start calling JPL > > provided interface in my application code, the following exceptions > > are thrown: > > That sounds like a lot of fun! > > > Can anybody help me to figure out what happened exactly, BTW, > > Tomcat is not crashing all the time but fairly frequent though. > > Thanks very much. > > > > WARNING: Error while removing context [/XXXXXX] > > java.lang.NoClassDefFoundError: > > org/apache/struts2/util/ObjectFactoryDestroyable at > > org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:265) > > > > > at > org.apache.struts2.dispatcher.ng.PrepareOperations.cleanupDispatcher(PrepareOperations.java:188) > > at > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.destroy(StrutsPrepareAndExecuteFilter.java:100) > > > > > at > org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:358) > > at > > org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:4107) > > > > > at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4876) > > at > > org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:936) > > > > > at > org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1212) > > at > > org.apache.catalina.startup.HostConfig.check(HostConfig.java:1382) > > at > > org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:306) > > > > > at > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) > > at > > org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1389) > > > > > at > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1653) > > at > > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1662) > > > > > at > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1642) > > at java.lang.Thread.run(Thread.java:662) Caused by: > > java.lang.ClassNotFoundException: > > org.apache.struts2.util.ObjectFactoryDestroyable at > > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) > > > > > at > org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) > > ... 16 more Mar 26, 2014 6:18:51 PM > > org.apache.catalina.core.ContainerBase stop INFO: Container > > org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/XXXXXX].[jsp] > > has not been started Mar 26, 2014 6:18:51 PM > > org.apache.catalina.core.ContainerBase stop INFO: Container > > org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/XXXXXX].[default] > > has not been started Mar 26, 2014 6:18:51 PM > > org.apache.catalina.startup.HostConfig checkResources WARNING: > > Error during context [/XXXXXX] destroy > > java.lang.NoClassDefFoundError: > > org/apache/struts2/util/ObjectFactoryDestroyable at > > org.apache.struts2.dispatcher.Dispatcher.cleanup(Dispatcher.java:265) > > > > > at > org.apache.struts2.dispatcher.ng.PrepareOperations.cleanupDispatcher(PrepareOperations.java:188) > > at > > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.destroy(StrutsPrepareAndExecuteFilter.java:100) > > > > > at > org.apache.catalina.core.ApplicationFilterConfig.release(ApplicationFilterConfig.java:358) > > at > > org.apache.catalina.core.StandardContext.filterStop(StandardContext.java:4107) > > > > > at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4876) > > at > > org.apache.catalina.core.ContainerBase.destroy(ContainerBase.java:1176) > > > > > at > org.apache.catalina.core.StandardContext.destroy(StandardContext.java:4976) > > at > > org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1219) > > > > > at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1382) > > at > > org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:306) > > > > > at > org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) > > at > > org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1389) > > > > > at > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1653) > > at > > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1662) > > > > > at > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1642) > > at java.lang.Thread.run(Thread.java:662) Mar 26, 2014 6:19:05 PM > > org.apache.coyote.http11.Http11Protocol pause INFO: Pausing Coyote > > HTTP/1.1 on http-8080 Mar 26, 2014 6:19:06 PM > > org.apache.catalina.core.StandardService stop INFO: Stopping > > service Catalina Mar 26, 2014 6:19:06 PM > > org.apache.coyote.http11.Http11Protocol destroy INFO: Stopping > > Coyote HTTP/1.1 on http-8080 > > It looks like Tomcat is stopping -- really shutting-down your web > application, but something is trying to load classes after the > WebappClassLoadet for your webapp has been marked as stopped. > > This can happen under something like the following: > > 1. Application is running fine > 2. Application launches a thread > 3. Application is stopped > [time passes, maybe only a few ms] > 4. The thread from #2 attempts to perform an operation which requires > a class to be loaded (e.g. ObjectFactoryDestroyable from above) > 5. You get an error from the WebappClassLoader because the application > stopped in step #3 > > If you re-deploy your web application, this kind of thing can easily > happen to the "old" application while the new copy is running. > > Given the stack trace above, it seems like Tomcat is trying to > intentionally stop your web application (your Filter is being > shut-down) and so the WebappClassLoader should still be valid. Is it > possible that the Struts component you are using plays games with the > ClassLoader and so it's using the wrong one? For example, it may cache > the first ClassLoader that was used for some static operation, and > then retain it longer than appropriate. You would then have an error > the *second* time you tried to re-deploy. Thanks very much for the detailed analysis, I mean I am no Struts expert at all, I will not get into those kind of fancy techniques to play with the classLoader by any means. From your suggestions, I think the best way to do is to test my app on a stand-alone java application rather than a Struts and see what happened, if the application still crashed that means it has nothing to do with struts or tomcat at all, but if it did not crash, then I may have to come back to bother you again. :) Thanks anyway
> > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > Comment: GPGTools - http://gpgtools.org > Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ > > iQIcBAEBCAAGBQJTNE/MAAoJEBzwKT+lPKRYj2wP/RKtRO5m/IRNjRRSicKeSBDD > AFhYbh5I8ESipHgFSv60sUgEUMIWrYnAW9xUdVKlGei18U27+8gjEalROXIwMDx7 > KyICJWU6ykJQCVOmxxEiWOq61RGN811bgs4lL2sCYDpm5zkUtycauhenuWgG6NFC > +YbFc3wQdrHErLknmM4XppdZNzQUCH9Sgrb2AOC/SKaxqTyyCRTXUIDkhfzbY1Ne > f4FqkSXmxPjWOxJ0VeMrC18GOJx2sQfCJO87OUNWs4f+sx/Wgl4abtcsQ0DbrMoJ > o8zUFg+vvsLd9BPJJuCvoMSYaggJUW9IgbdtOgqu1UUQ7iTdaZsLsklVc0nvYL7R > wdVTauWLM+YFHEVcwL6d2XD9ecdDsUt7YMj+C6yU3n331FYK9GTtl+LRtYA69h70 > 2Z/w+yE/9ZEg0FVYVTaFRIRjsqDd1yOBQwnGDRWihOC5SUfGhrnz495BM+Y6v7cQ > OtK4DdpblrktCJeLX6EUlmZw2MNqDGN+KRDWj79A4BLqexDhRjzIDoRTj3aP2qF4 > cl3X8gKh4dbtLER6Gvq8lecvIXtxJ8QifOGsHoSxArU1Qi+y/n4+Mjzsh0yRn5Nw > GEyZf8rzeHUvoKjFsMeZlVokzWg5MBa6mgPk9e68xeRn8TkikcU8hJ0s9MeFZ0Mq > //Vwg5wjlpNJhSYNcLEl > =JoZT > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org >