简体   繁体   中英

War deployment in Embedded Tomcat

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM