开发者

Extracting startup errors from Spring contexts

开发者 https://www.devze.com 2022-12-27 01:11 出处:网络
Consider the following output from a Tomcat server under Eclipse: INFO: Initializing Coyote HTTP/1.1 on http-8080

Consider the following output from a Tomcat server under Eclipse:

INFO: Initializing Coyote HTTP/1.1 on http-8080
INFO:开发者_StackOverflow社区 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.


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.


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号