1

I have an embedded tomcat (7.0.64) on MAC and am deploying a war file, running on java 1.7.067. For some reason my tomcat server hangs on the call "Tomcat.start()".

I know for sure that it's getting stuck deploying the war file. The way i figured this i plugged in a different war file(a simple hello world) and that worked.

I tried hooking up tomcat log.properties and got the logs directed to file with hope of getting any clues. But i don't see any exception, the logging stops at these lines,

FINE:   Loading class from parent
Nov 16, 2015 9:30:01 PM org.apache.catalina.loader.WebappClassLoader loadClass
FINE:   Loading class from parent
Nov 16, 2015 9:30:01 PM org.apache.catalina.loader.WebappClassLoader loadClass
FINE: loadClass(com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl, false)
Nov 16, 2015 9:30:01 PM org.apache.catalina.loader.WebappClassLoader loadClass
FINE: loadClass(com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl, false)
Nov 16, 2015 9:30:01 PM org.apache.catalina.loader.WebappClassLoader loadClass
FINE: loadClass(com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl, false)
Nov 16, 2015 9:30:01 PM org.apache.catalina.loader.WebappClassLoader loadClass
FINE: loadClass(com.sun.org.apache.xerces.internal.impl.dv.dtd.DTDDVFactoryImpl, false)

Not sure if it can't find "DTDDVFactoryImpl", since this is part of the jdk libraries itself as well as i am including xercesimpl.jar as well.

Basically i am looking for ways that can help me figure out, what or which class is blocking from the web deployment from happening.

Any ideas/pointers?

TIA

Updated - My log.properties looks like,

handlers=java.util.logging.ConsoleHandler, org.apache.juli.FileHandler

org.apache.juli.FileHandler.level=ALL
org.apache.juli.FileHandler.directory=./logs
org.apache.juli.FileHandler.prefix=tomcat-

java.util.logging.ConsoleHandler.level=ALL
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

org.apache.catalina.level=FINEST
org.apache.catalina.handlers=org.apache.juli.FileHandler
Victor
  • 1,207
  • 2
  • 13
  • 21

1 Answers1

0

the line -

FINE: loadClass(com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl, false)

The above message means that a web application have already been stopped, but the TimerTask tries to load a class from it. What web application has started this timer? If the timer was started by this web application, then it is your fault. You should have configured a javax.servlet.ServletContextListener to stop (cancel) the timer when the web application stops. You cannot load classes when web application have already been stopped. OR If the timer was started by a different web application, it means that you have PermGen memory leak somewhere. Ensure that you have JreMemoryLeakPreventionListener configured in server.xml. It is known that there was a PermGen memory leak in Java XML APIs. A workaround to suppress it was added to JreMemoryLeakPreventionListener in r884341 [1] Mark has a presentation on Memory Leaks http://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks-60mins.pdf OR Bundling a separate copy of Apache Xerces with the web application may help. It will not help if the root cause is your failure to cancel the timer. [1] http://svn.apache.org/viewvc?view=revision&revision=r884341

hope this helps.

TheLuminor
  • 1,411
  • 3
  • 19
  • 34
  • Not sure what does "web application has already been stopped mean"? At this point i am just deploying this (only one) application. What i was hoping to find out is if for some reason tomcat is not able to deploy this application, then it should throw some kind of exception indicating missing details like class/etc. – Victor Nov 17 '15 at 18:03
  • There is only one application that is getting deployed and if its deployment itself does not go through, then i don't think any timer from this application will come into play. Also i have tried bundling a XercesImpl.jar in the classpath, that hasn't helped either. JreMemoryLeak, not very sure about this one, but i'll give it a shot. – Victor Nov 17 '15 at 18:04