views:

21

answers:

3

Consider the following output from a Tomcat server under Eclipse:

INFO: Initializing Coyote HTTP/1.1 on http-8080
INFO: Initialization processed in 634 ms
INFO: Starting service Catalina
INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
SEVERE: Error listenerStart
SEVERE: Context [/MyServlet] startup failed due to previous errors

I would like to figure out what exception caused "Error listenerStart", but Spring seems to be preventing me from finding the error via Eclipse. I'd love to start Catalina manually, but that doesn't seem to do anything.

What's the best way to find the hidden exception? I'm not afraid to use torture methods.

A: 

Try to configure logger (Log4j for example) and log errors to console.

Michał Mech
+1  A: 

In my case, the answer was:

  1. Debug java.util.logging.SimpleLogger to find out what exceptions were being hidden.
  2. Figure out that my logging.properties file, cut-and-pasted from the Tomcat docs, was bunk. Several exceptions were going into black holes in log files (maybe they weren't flushed)? Switching everything to a single ConsoleLogger enabled me to see all exceptions.
  3. Make sure that -Djava.util.logging.config.file="/<path>/logging.properties" was present in my Run Configuration.
sehugg
A: 

Check tomcat's logs directory, see if it logged to an alternate log file.

MetroidFan2002