java.lang.ClassNotFoundException: org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter in web.xml

前端 未结 8 1060
花落未央
花落未央 2020-12-06 07:16

This is my web.xml Code,While running I am getting error like this..How to resolve this?

\"SEVERE: Exception starting filter Struts java.lang.ClassNotFoundEx

相关标签:
8条回答
  • 2020-12-06 07:57

    I was facing the same problem. Everybody was suggesting that my jar version was wrong but the problem was different.

    I was adding the required jar in project, but that was not working.

    So removed the jar from project and added those jar in my TOMCAT server lib folder and that worked.

    0 讨论(0)
  • 2020-12-06 07:57

    the solution is in pom.xml;

    <dependencies>
        <dependency>
            <groupId>org.apache.struts</groupId>
            <artifactId>struts2-core</artifactId>
            <version>2.3.1.2</version>
        </dependency>
    </dependencies>
    
    
    <packaging>war</packaging>
    <build>
        <finalName>struts-2.3-hello-world-example</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <configuration>
                    <webXml>web\WEB-INF\web.xml</webXml>
                </configuration>
            </plugin>
        </plugins>
    </build>
    

    i can see this, in this video; https://www.youtube.com/watch?v=q4IhM4GBhF8

    0 讨论(0)
提交回复
热议问题