博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Tomcat7启动报Error listenerStart错误
阅读量:5014 次
发布时间:2019-06-12

本文共 5911 字,大约阅读时间需要 19 分钟。

问题

Tomcat7在启动时报错,详细信息如下:

十一月 23, 2013 7:21:58 下午 org.apache.catalina.core.StandardContext startInter

nal
严重: Error filterStart
十一月 23, 2013 7:21:58 下午 org.apache.catalina.core.StandardContext startInter
nal
严重: Context [/st] startup failed due to previous errors

分析

Tomcat后台信息太少以至于不能得出问题空间出在哪儿(Tomcat的日志目录也无相关信息)。网上查询得知,通过配置Tomcat的Log,让它记录更多的日志信息,方能进一步分析原因。

在不能启动的Web应用目录(我这里是st)下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 = FINEorg.apache.juli.FileHandler.directory = ${catalina.base}/logsorg.apache.juli.FileHandler.prefix = error-debug.java.util.logging.ConsoleHandler.level = FINEjava.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

再启动Tomcat后,后台显示出了错误原因,并且Tomcat的日志目录中也出现了文件“error-debug.2013-11-23.log”,其中记录了错误详细信息。下面内容供参考(每个人出错的原因不一样,需要具体问题具体分析解决):

严重: Exception starting filter struts2Unable to load configuration. - action - file:/D:/Work/helloworld/WebContent/WEB-INF/classes/struts.xml:8:67        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:483)        at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)        at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)        at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)        at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)        at org.apache.catalina.core.ApplicationFilterConfig.
(ApplicationFilterConfig.java:103) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)Caused by: Unable to load configuration. - action - file:/D:/Work/helloworld/WebContent/WEB-INF/classes/struts.xml:8:67 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471) ... 15 moreCaused by: Action class [com.clzhang.ssh.action.LoginAction] not found - action- file:/D:/Work/helloworld/WebContent/WEB-INF/classes/struts.xml:8:67 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:480) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:424) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:541) at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:290) at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:239) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67) ... 17 more十一月 23, 2013 7:27:44 下午 org.apache.catalina.core.StandardContext startInternal严重: Error filterStart十一月 23, 2013 7:27:44 下午 org.apache.catalina.core.StandardContext startInternal严重: Context [/st] startup failed due to previous errors十一月 23, 2013 7:27:44 下午 org.apache.catalina.startup.HostConfig deployDirectory

解决

是程序的问题,配置的相关Action类的包名更改了,但没有及时更改struts.xml文件导致上述结果。

有关Tomcat的日志相关配置参考:

 

本文参考:

可能有同学打不开上述页面,因为它被屏蔽了。摘录部分内容如下,供参考:

Just for future reference; even though the app worked fine in development mode, there were some bugs in the BootStrap when deploying to a real server. I realized errors in the BootStrap were creating the cryptic listererStart error.

In order to get better debug logging, place a file called "logging.properties" in the webapps WEB-INF/classes folder.  Then, your server logs will show descriptive errors for debugging:

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 = servlet-examples.

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 

This will create a servlet-examples.log file in your appserver's log folder. This data was found at under the "Using java.util.logging (default)" header.

Hopefully this will help save someone some time and frustration when deploying their app, especially if, like me, they are unfamiliar with tomcat and the logging facilities. 

转载于:https://www.cnblogs.com/nayitian/p/3439336.html

你可能感兴趣的文章
解析$.grep()源码及透过$.grep()看(两次取反)!!的作用
查看>>
[模板] 字符串hash
查看>>
SGU438_The Glorious Karlutka River =)
查看>>
Linux集群及LVS简介
查看>>
简单几何(直线与圆的交点) ZOJ Collision 3728
查看>>
Codeforces Round #327 (Div. 2)
查看>>
如何解决Provisional headers are shown问题(转)
查看>>
开发网站遇到的bug
查看>>
实现简单的接口自动化测试平台
查看>>
EXCEL工作表合并
查看>>
Prime Path
查看>>
ODAC(V9.5.15) 学习笔记(三)TOraSession(2)
查看>>
单纯形法
查看>>
SQL中的replace函数
查看>>
java中的类型安全问题-Type safety: Unchecked cast from Object to ...
查看>>
如何解决最后一个尾注引用显示与致谢混为一谈的问题-下
查看>>
Java Socket编程 - 基于TCP方式的二进制文件传输【转】http://blog.csdn.net/jia20003/article/details/8248221...
查看>>
阅读之https及加密原理
查看>>
HDOJ4550 卡片游戏 随便销毁内存的代价就是wa//string类的一些用法
查看>>
css文本样式text、字体样式font
查看>>