2 u014399727 u014399727 于 2014.09.15 11:29 提问

配置ssh 五个重要的包我都引入了,为什么运行tomcat的时候还是报错

严重: Exception starting filter struts2
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(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4001)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4651)
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:546)

web.xml

<?xml version="1.0" encoding="UTF-8"?>
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

struts2
org.apache.struts2.dispatcher.FilterDispatcher


struts2
/*

包文件
commons-logging-1.0.4.jar
freemarker-2.3.8.jar
ognl-2.6.11.jar
struts2-core-2.0.11.1.jar
xwork-2.0.7.jar

3个回答

johamwon
johamwon   2014.09.15 15:23

你确定已经把jar包放入了lib文件夹中?

u011657668
u011657668   2014.09.18 10:59

你看看编译后的lib文件夹存在这几个包没,错误原因没有找到commons-logging-1.0.4.jar

u013886110
u013886110   2014.09.29 18:11

你的核心控制器FilterDispatcher依赖的包没导入吧,或则是FilterDispatcher这个类的路径写错了。

Csdn user default icon
上传中...
上传图片
插入图片