boyce_zy23 2009-06-13 21:52
浏览 296
已采纳

Exception starting filter struts2问题

严重: Exception starting filter struts 2
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at org.apache.struts2.dispatcher.FilterDispatcher.(FilterDispatcher.java:149)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:255)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:108)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3709)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4363)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:926)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:889)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2009-6-13 21:22:35 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2009-6-13 21:22:35 org.apache.catalina.core.StandardContext start
严重: Context [/struts2_userlogin] startup failed due to previous errors
2009-6-13 21:22:35 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2009-6-13 21:22:35 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-6-13 21:22:35 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/16 config=null
2009-6-13 21:22:35 org.apache.catalina.startup.Catalina start
信息: Server startup in 1793 ms

web.xml配置
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<display-name>Struts Blank</display-name>

<filter>
    <filter-name>struts 2</filter-name>
    <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
    <filter-name>struts 2</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

struts.xml

<include file="struts-default.xml"/>    

<!-- Add packages here-->
<package name="default" extends="struts-default">
    <action name="hello" class="com.boyce.controller.HelloAction">
        <result name="success">success.html</result>
    </action>
</package>

6个jar包:freemarker 、ognl 、struts2-core 、 xwork 、commons-fileupload 、commons-logging我都加了,试了好长时间无法解决,希望大家帮忙看看问题出处,小弟先谢了~

[b]问题补充:[/b]
为什么会出现这个警告:
Could not parse struts.locale setting, substituting default VM locale

以下两种解答都试了,没有解决~我是按照书上的实例在练习,所以用的不是最新的jar包~另外我的6个包都加在Referenced-Libraries中,lib中并无显示~

[b]问题补充:[/b]
照做了还是不行,应该是差jar包吧,org.apache.catalina是哪个包下的啊?
[b]问题补充:[/b]
没有解决,不过分还是给lovewhzlq同志了~

  • 写回答

4条回答 默认 最新

  • wanghaolovezlq 2009-06-13 22:51
    关注

    org.apache.catalina这个包都是tomcat自身的jar包,

    你还是去网上下全jar包,

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀