1
我想設置我的第一個使用註釋和maven的struts 2應用程序。我follwing這個例子struts2 annotations example異常開始過濾器Struts 2
當我嘗試運行Tomcat服務器7上的應用程序我得到這個例外
Grave: Exception startin filter struts2
java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter. StrutsPrepareAndExecuteFilter
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.<init>(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.run(FutureTask.java:262)
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:744)
avr. 14, 2014 10:40:05 AM org.apache.catalina.core.StandardContext startInternal
Grave: Error filterStart
avr. 14, 2014 10:40:05 AM org.apache.catalina.core.StandardContext startInternal
Grave: Erreur de démarrage du contexte [/StrutsAnnotationsExample] suite aux erreurs précédentes
avr. 14, 2014 10:40:05 AM org.apache.coyote.AbstractProtocol start
Infos: Starting ProtocolHandler ["http-bio-8080"]
avr. 14, 2014 10:40:05 AM org.apache.coyote.AbstractProtocol start
Infos: Starting ProtocolHandler ["ajp-bio-8009"]
avr. 14, 2014 10:40:05 AM org.apache.catalina.startup.Catalina start
Infos: Server startup in 991 ms
任意一個幫助或者能告訴我失去了什麼?
Excepption cleary說它無法找到StrutsPrepareAndExecuteFilter。因此請確保相應的JAR文件位於類路徑 –
@ AvinashK.P中,因爲我使用maven導入了所需的jar。爲什麼我應該手動將它們添加到lib文件夾 –
@juniordevelopper因爲您沒有將它們部署到您的應用程序中。 –