落落空间

缘来是java
posts - 12, comments - 12, trackbacks - 0, articles - 1
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

配置Struts2.0 启动taomcat时异常

Posted on 2007-07-06 17:54 落落 阅读(2294) 评论(6)  编辑  收藏 所属分类: javawebwork

异常信息:

2007-5-16 10:47:42 org.apache.coyote.http11.Http11AprProtocol init

信息: Initializing Coyote HTTP/1.1 on http-9090

2007-5-16 10:47:42 org.apache.coyote.ajp.AjpAprProtocol init

信息: Initializing Coyote AJP/1.3 on ajp-8009

2007-5-16 10:47:42 org.apache.catalina.startup.Catalina load

信息: Initialization processed in 2164 ms

2007-5-16 10:47:43 org.apache.catalina.core.StandardService start

信息: Starting service Catalina

2007-5-16 10:47:43 org.apache.catalina.core.StandardEngine start

信息: Starting Servlet Engine: Apache Tomcat/5.5.23

2007-5-16 10:47:43 org.apache.catalina.core.StandardHost start

信息: XML validation disabled

log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).

log4j:WARN Please initialize the log4j system properly.

2007-5-16 10:47:50 org.apache.catalina.core.StandardContext start

严重: Error filterStart

2007-5-16 10:47:50 org.apache.catalina.core.StandardContext start

严重: Context [/BookManage] startup failed due to previous errors

2007-5-16 10:47:51 org.apache.catalina.core.ApplicationContext log

信息: ContextListener: contextInitialized()

2007-5-16 10:47:51 org.apache.catalina.core.ApplicationContext log

信息: SessionListener: contextInitialized()

2007-5-16 10:47:52 org.apache.catalina.core.ApplicationContext log

信息: ContextListener: contextInitialized()

2007-5-16 10:47:52 org.apache.catalina.core.ApplicationContext log

信息: SessionListener: contextInitialized()

2007-5-16 10:47:57 org.apache.catalina.loader.WebappClassLoader validateJarFile

信息: validateJarFile(C:\Tomcat 5.5\webapps\TopHyTree\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class

log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).

log4j:WARN Please initialize the log4j system properly.

2007-5-16 10:48:01 org.apache.coyote.http11.Http11AprProtocol start

信息: Starting Coyote HTTP/1.1 on http-9090

2007-5-16 10:48:02 org.apache.coyote.ajp.AjpAprProtocol start

信息: Starting Coyote AJP/1.3 on ajp-8009

2007-5-16 10:48:03 org.apache.catalina.storeconfig.StoreLoader load

信息: Find registry server-registry.xml at classpath resource

2007-5-16 10:48:03 org.apache.catalina.startup.Catalina start

信息: Server startup in 20835 ms

红色字体为出错信息,原来以为是用Filter(过滤器或者拦截器)出错,因为把web.xml里的filter配置去掉,就正常起来了,在网上查找发现两种情况:

    1、运用Filte包不齐全
 2、第二种情况:

google里搜索Error filterStart里有个文章说tomcat里的bug,没有实现javax.servlet.FilterFilter会报这样的错误:

看来tomcat在启动就初始化Filter实例了,可能是Filter里的啥东东执行出错导致可能,看看Filterinit里用到一句

mServ = (ModuleService)WebUtils.getApplicationContext(config.getServletContext()).getBean("moduleService");

是最可能发生错误了,因为这里用到了springorg.springframework.web.context.ContextLoaderServlet,如果启动这时还没有建立该servlet实例,务必导致获取失败,抛出错误。先屏蔽一下这句话,果真启动正常了,修改一下代码,将init里的这句话丢到了doFilter里面

        if(mServ==null)
            mServ = (ModuleService)WebUtils.getApplicationContext(filterConfig.getServletContext()).getBean("moduleService");

不过Tomcat也真是,解析web.xml的顺序上还是太僵硬了。

我的出错情况:

经仔细推敲查找发现是配置文件struts.xml配置时候action文件名错误

原因:tomcat启动时会通过web.xml文件寻找struts.xml文件。又因struts2.0默认有拦截器的,所以如果这里的有错误信息,就会报Filter错误,很容易引起误导。


评论

# re: 配置Struts2.0 启动taomcat时异常  回复  更多评论   

2007-07-12 22:39 by Draogn
偶也有来看你了,原来在这里呀!娟变得好历害呀!我的BLOG好久没有更新了,想写但写不出来。哈哈。。。。没灵感了。。。。我都觉得自己老了。还是年轻人有活力呀!努力呀!向娟娟同志学习!!!!!

# re: 配置Struts2.0 启动taomcat时异常  回复  更多评论   

2007-07-25 15:29 by 王娟
晕!

# re: 配置Struts2.0 启动taomcat时异常  回复  更多评论   

2007-07-25 15:31 by 王娟
才多大点儿,就说老了,哈哈!
我还得向你学习呢......

# re: 配置Struts2.0 启动taomcat时异常[未登录]  回复  更多评论   

2007-08-01 14:31 by King
不会是要修改Tomcat源代码吧?盼望回复。nmgzxj@tom.com

# re: 配置Struts2.0 启动taomcat时异常[未登录]  回复  更多评论   

2007-08-29 20:54 by Dragon
好久没有更新了,呵呵,人有时的那种感觉也是很真切的。

# re: 配置Struts2.0 启动taomcat时异常  回复  更多评论   

2008-08-18 12:01 by 我的也是这错误,未能解决,帮看看,QQ549888803
严重: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/D:/Tomcat%205.5/webapps/LoginWeb/WEB-INF/lib/struts2-core-2.1.2.jar!/struts-default.xml:46:178
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:213)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:223)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:304)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:77)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3634)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4217)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:904)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:867)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:474)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
at org.apache.catalina.core.StandardService.start(StandardService.java:450)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)
Caused by: Unable to load bean: type:org.apache.struts2.dispatcher.multipart.MultiPartRequest class:org.apache.struts2.dispatcher.multipart.JakartaMultiPartRequest - bean - jar:file:/D:/Tomcat%205.5/webapps/LoginWeb/WEB-INF/lib/struts2-core-2.1.2.jar!/struts-default.xml:46:178
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:239)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:100)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:156)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
... 30 more
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/RequestContext
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:229)
... 33 more
2008-8-18 11:59:35 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2008-8-18 11:59:35 org.apache.catalina.core.StandardContext start
严重: Context [/LoginWeb] startup failed due to previous errors
2008-8-18 11:59:36 org.apache.coyote.http11.Http11BaseProtocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2008-8-18 11:59:37 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2008-8-18 11:59:37 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/181 config=null
2008-8-18 11:59:37 org.apache.catalina.storeconfig.StoreLoader load
信息: Find registry server-registry.xml at classpath resource
2008-8-18 11:59:37 org.apache.catalina.startup.Catalina start
信息: Server startup in 10084 ms

只有注册用户登录后才能发表评论。


网站导航: