tomcat报SEVERE Error listenerStart

问题

启动tomcat时报错,错误信息如下:

1
2
3
4
org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/projectname] startup failed due to previous errors

方法

WEB-INF/classes目录下新建一个文件叫logging.properties,内容如下

1
2
3
4
5
6
handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler  
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查看日志,就可以看到是由于数据库连接或者jdk版本不兼容等原因导致的

Donate