转载自: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,详细的错误信息被列出来了!


GitHub 加速计划 / li / linux-dash
13
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:3 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐