Linux下Tomcat启动报错 Error listenerStart
转载自:http://blog.csdn.net/yinyuehepijiu/article/details/17376745
-----------------以下是正文--------------
在Linux上部署项目总是报错,看不出什么毛病来:
INFO: Deploying web application archive GMTool.war
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
Dec 17, 2013 2:06:52 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
Dec 17, 2013 2:06:52 PM org.apache.catalina.core.StandardContext start
SEVERE: Context [/GMTool] startup failed due to previous errors
因为不知道哪儿有问题,高了老半天不明白什么问题,最后在 http://xpenxpen.iteye.com/blog/1545648 找到了解决的方案:
Tomcat报的错太含糊了,什么错都没报出来,只提示了Error listenerStart。为了调试,我们要获得更详细的日志。可以在项目的WEB-INF/classes目录下新建一个文件叫logging.properties,内容如下
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
############################################################
# Handler specific properties.
# Describes specific configuration info for Handlers.
############################################################
org.apache.juli.FileHandler.level = FINE
org.apache.juli.FileHandler.directory = ${catalina.base}/logs
org.apache.juli.FileHandler.prefix = error-debug.
java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
这样,我们再启动tomcat时,就会在logs目录下生成一个更详细的日志error-debug.xxx.log,详细的错误信息被列出来了!
更多推荐
所有评论(0)