部署Struts2时出现错误java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepar

报如下错误

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:529) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:511) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:139) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258) at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4809) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5485) 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$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) 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:722) 七月 27, 2016 8:46:28 上午 org.apache.catalina.core.StandardContext startInternal SEVERE: Error filterStart 七月 27, 2016 8:46:28 上午 org.apache.catalina.core.StandardContext startInternal SEVERE: Context [/MyfirstStruts2] startup failed due to previous errors 七月 27, 2016 8:46:28 上午 org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] 七月 27, 2016 8:46:28 上午 org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] 七月 27, 2016 8:46:28 上午 org.apache.catalina.startup.Catalina start INFO: Server startup in 1334 ms

here is the web.xml I am using!

MyfirstStruts2 index.html index.htm index.jsp default.html default.htm default.jsp struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.class struts2 /*  

问题分析和解决:

我已经将Struts2的包放到了WebInfo下的lib下,他会自动添加,不用手动BuildPath。后来发现filter-class下的包名我是通过copy qualified name的方式,本以为不会错,事实上也没有错,只是他会把".class"给添加进来,删除".class",bug解决。

 

你可能感兴趣的:(学习学习)