SEVERE: Exception starting filter struts2 java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.FilterDispatcher

后端 未结 13 581
一生所求
一生所求 2020-12-16 00:56

I am trying to make a small login application in struts 2. My web.xml:



        
相关标签:
13条回答
  • 2020-12-16 01:15

    I had the same problem. I solved it this way: 1st I deleted all my added libs. Then I added them via Project->Properties->Deployment Assembly. Before, I just copied them into the WEB-INF/lib folder. That doesn't seem to work all the time. hope this helps.

    0 讨论(0)
  • 2020-12-16 01:20

    You need to add one more jar commons-lang3-x.x

    scroll down to the end of apache logs you can find ClassNotFoundException: org.apache.commons.lang3.StringUtils :

    Caused by: java.lang.ClassNotFoundException: **org.apache.commons.lang3.StringUtils**
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
    ... 55 more
    
    0 讨论(0)
  • 2020-12-16 01:22

    just add commons-lang3XXXX.jar to your library

    0 讨论(0)
  • 2020-12-16 01:24

    add commons-lang3- jar file to WEB-INF\lib folder.

    0 讨论(0)
  • 2020-12-16 01:24

    Regarding the error:

    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.

    0 讨论(0)
  • 2020-12-16 01:29

    I got this error too and I checked my dtd in web.xml and I changed the version from 2.4 to 2.5 .

        <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns="http://java.sun.com/xml/ns/javaee" 
         xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" 
    version="2.5">
    
    0 讨论(0)
提交回复
热议问题