java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuterFilter

前端 未结 4 1550
借酒劲吻你
借酒劲吻你 2021-01-03 06:05

I copied all struts2 jars to the WEB-INF/lib folder and the struts.xml file is as shown below:


         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-03 06:42

    Regarding to the error mentioned SEVERE: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter

    PROBLEM: There seems to be a problem with the following combination Eclipse - WTPPlugin - Struts2 - Maven3

    FINDINGS: We assume that when we run a project as "Run on server" we assume that eclipse runs maven, created WAR file and deploys on the server. But its not working perfectly for me. I do see the WAR file in the target folder where maven creates WAR, and the WAR is perfect. But eclipse seems to run something else.

    SOLUTION: Put all the required JAR files into eclipse project's WEB-INF/lib. If you are using version control, make sure to ignore the lib folder. How to find all the required JARs when you are using maven? Go to target folder and the WAR file. Burst it open and go to WEB-INF/lib. Copy all these JARS to eclipse project's WEB-INF/lib.

    Thanks, Harsh

提交回复
热议问题