原文地址:http://www.cnblogs.com/nayitian/p/3439336.html

问题

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文件,内容参考如下:

  1. handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
  2.  
  3. ############################################################
  4. # Handler specific properties.
  5. # Describes specific configuration info for Handlers.
  6. ############################################################
  7.  
  8. org.apache.juli.FileHandler.level = FINE
  9. org.apache.juli.FileHandler.directory = ${catalina.base}/logs
  10. org.apache.juli.FileHandler.prefix = error-debug.
  11.  
  12. java.util.logging.ConsoleHandler.level = FINE
  13. java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

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

  1. 严重: Exception starting filter struts2
  2. Unable to load configuration. - action - file:/D:/Work/helloworld/WebContent/WEB
  3. -INF/classes/struts.xml:8:67
  4. at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:483)
  5. at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOp
  6. erations.java:74)
  7. at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
  8. .init(StrutsPrepareAndExecuteFilter.java:51)
  9. at org.apache.catalina.core.ApplicationFilterConfig.initFilter(Applicati
  10. onFilterConfig.java:277)
  11. at org.apache.catalina.core.ApplicationFilterConfig.getFilter(Applicatio
  12. nFilterConfig.java:258)
  13. at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(Applica
  14. tionFilterConfig.java:382)
  15. at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFi
  16. lterConfig.java:103)
  17. at org.apache.catalina.core.StandardContext.filterStart(StandardContext.
  18. java:4650)
  19. at org.apache.catalina.core.StandardContext.startInternal(StandardContex
  20. t.java:5306)
  21. at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  22. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.
  23. java:1559)
  24. at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.
  25. java:1549)
  26. at java.util.concurrent.FutureTask.run(FutureTask.java:262)
  27. at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
  28. java:1145)
  29. at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
  30. .java:615)
  31. at java.lang.Thread.run(Thread.java:744)
  32. Caused by: Unable to load configuration. - action - file:/D:/Work/helloworld/Web
  33. Content/WEB-INF/classes/struts.xml:8:67
  34. at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
  35. ConfigurationManager.java:70)
  36. at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Di
  37. spatcher.java:429)
  38. at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
  39. ... 15 more
  40. Caused by: Action class [com.clzhang.ssh.action.LoginAction] not found - action
  41. - file:/D:/Work/helloworld/WebContent/WEB-INF/classes/struts.xml:8:67
  42. at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.ver
  43. ifyAction(XmlConfigurationProvider.java:480)
  44. at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.add
  45. Action(XmlConfigurationProvider.java:424)
  46. at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.add
  47. Package(XmlConfigurationProvider.java:541)
  48. at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loa
  49. dPackages(XmlConfigurationProvider.java:290)
  50. at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages
  51. (StrutsXmlConfigurationProvider.java:112)
  52. at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContai
  53. ner(DefaultConfiguration.java:239)
  54. at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(
  55. ConfigurationManager.java:67)
  56. ... 17 more
  57.  
  58. 十一月 23, 2013 7:27:44 下午 org.apache.catalina.core.StandardContext startInter
  59. nal
  60. 严重: Error filterStart
  61. 十一月 23, 2013 7:27:44 下午 org.apache.catalina.core.StandardContext startInter
  62. nal
  63. 严重: Context [/st] startup failed due to previous errors
  64. 十一月 23, 2013 7:27:44 下午 org.apache.catalina.startup.HostConfig deployDirect
  65. ory

解决

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

有关Tomcat的日志相关配置参考:http://tomcat.apache.org/tomcat-7.0-doc/logging.html

本文参考:

http://grails.1312388.n4.nabble.com/Deployment-problems-td4628710.html

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

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 http://tomcat.apache.org/tomcat-7.0-doc/logging.html 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.

Tomcat7启动报Error listenerStart错误--转载的更多相关文章

  1. Tomcat7启动报Error listenerStart错误

    问题 Tomcat7在启动时报错,详细信息如下: 十一月 23, 2013 7:21:58 下午 org.apache.catalina.core.StandardContext startInter ...

  2. Tomcat启动报Error listenerStart错误 Context [] startup failed due to previous errors

    本文转载自xpenxpen 今天启动Tomcat启动不了,报以下错: org.apache.catalina.core.StandardContext startInternal SEVERE: Er ...

  3. (转)Tomcat启动报Error listenerStart错误

    今天启动Tomcat启动不了,报以下错: org.apache.catalina.core.StandardContext startInternalSEVERE: Error listenerSta ...

  4. Tomcat启动报Error listenerStart错误

    http://xpenxpen.iteye.com/blog/1545648 今天启动Tomcat启动不了,报以下错: org.apache.catalina.core.StandardContext ...

  5. Tomcat启动报Error listenerStart错误 | "beans" 必须匹配 DOCTYPE 根 "null" | java.lang.reflect.MalformedParameterizedTypeException

    maven打包发布工程时,发布上去却报错FAIL - Deployed application at context path /ch but context failed to start 在服务器 ...

  6. 解决软件启动报error while loading shared libraries: libgd.so.2: cannot open shared object错误

    解决软件启动报error while loading shared libraries: libgd.so.2: cannot open shared object错误 今天安装启动nginx的时候报 ...

  7. Jetty启动报Error scanning entry META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class

    近日在项目中集成Elasticsearch后,Jetty启动报错. 错误日志如下: Suppressed: |java.lang.RuntimeException: Error scanning en ...

  8. springboot 配置jpa启动报Error processing condition on org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration.pageableCustomizer

    springboot +gradle 配置jpa启动报Error processing condition on org.springframework.boot.autoconfigure.data ...

  9. MySQL创建函数报“ERROR 1418 ”错误,不能创建函数

    MySQL创建函数报ERROR 1418错误,不能创建函数,根据官方提示是说,不能创建函数可能是一个安全设置方面的配置或功能未开启原因,下面我们一起来看.   错误 ERROR 1418 (HY000 ...

随机推荐

  1. httpcomponents 学习1--并发多线程GET

    package org.apache.http.examples.client; import org.apache.http.HttpEntity; import org.apache.http.H ...

  2. HDU 5862 Counting Intersections (树状数组)

    Counting Intersections 题目链接: http://acm.split.hdu.edu.cn/showproblem.php?pid=5862 Description Given ...

  3. netdata linux环境下的安装

    据说netdata监控很个性化,采用的显示方式也很漂亮,就来尝试安装.百度搜索到的安装教程的斑斑是1.0.顺藤摸瓜去wiki看了看,已经更新为1.4了,果断走起: 下载地址::https://gith ...

  4. Mysql SQL优化&执行计划

    SQL优化准则 禁用select * 使用select count(*) 统计行数 尽量少运算 尽量避免全表扫描,如果可以,在过滤列建立索引 尽量避免在where子句对字段进行null判断 尽量避免在 ...

  5. spring mvc中的valid

    当你希望在spring mvc中直接校验表单参数时,你可以采用如下操作: 声明Validator的方式: 1.为每一个Controller声明一个Validator @Controller publi ...

  6. ThinkPad X220i 刷白名单BIOS,改装第三方无线网卡

    ThinkPad X220i自带的网卡是REALTEK RTL8188CE,这张卡在Mac下目前是无解的.国外网站有该卡liunx.unix内核的驱动,但还是没有高人编译出来. 不等了,这卡没戏.正好 ...

  7. T4 模板入门

    T4,即4个T开头的英文字母组合:Text Template Transformation Toolkit.T4(Text Template Transformation Toolkit)是微软官方在 ...

  8. 利用 Heritrix 构建特定站点爬虫

    http://www.ibm.com/developerworks/cn/opensource/os-cn-heritrix/

  9. IE6 背景透明

    IE6 背景透明 第 1 种方法:定义一个样式,给某个div应用这个样式后,div的透明png背景图片自动透明了.(注意两处图片的路径写法不一样,本例中,icon_home.png图片与html文件在 ...

  10. CloudStack 4.2 与CloudStack 4.1二级存储API发生变化

    CloudStack 4.1查看二级存储 http://192.168.150.16:8080/client/api?command=listHosts&response=json&s ...