0

I have integrated a simple struts application with maven but when I start my webapp in tomcat it gives me classnotfound error. I tried searching other answers but all it says is check if the libraries are there. I checked and all are present.

This is my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.companyname.webapp</groupId>
  <artifactId>website</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>website Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/org.apache.struts/struts2-convention-plugin -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-convention-plugin</artifactId>
        <version>2.5</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/asm/asm -->
    <dependency>
        <groupId>asm</groupId>
        <artifactId>asm</artifactId>
        <version>3.3.1</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/antlr/antlr -->
    <dependency>
        <groupId>antlr</groupId>
        <artifactId>antlr</artifactId>
        <version>2.7.7</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3.2</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/commons-io/commons-io -->
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.5</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/commons-lang/commons-lang -->
    <dependency>
        <groupId>commons-lang</groupId>
        <artifactId>commons-lang</artifactId>
        <version>2.6</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/commons-logging/commons-logging -->
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.2</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/commons-logging/commons-logging-api -->
    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging-api</artifactId>
        <version>1.1</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/org.freemarker/freemarker -->
    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>2.3.23</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/org.javassist/javassist -->
    <dependency>
        <groupId>org.javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>3.20.0-GA</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/org.apache.struts/struts2-core -->
    <dependency>
        <groupId>org.apache.struts</groupId>
        <artifactId>struts2-core</artifactId>
        <version>2.5</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/com.opensymphony/xwork-core -->
    <dependency>
        <groupId>com.opensymphony</groupId>
        <artifactId>xwork-core</artifactId>
        <version>2.1.6</version>
        <scope>compile</scope>
    </dependency>

    <!-- http://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.1.0</version>
        <scope>compile</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>ROOT</finalName>
  </build>
</project>

libraries inside my war file libraries inside my war file.

THis is the error log.. enter image description here

Please help..@_@

erwin lim
  • 71
  • 1
  • 4
  • The class loader disagrees with you. It can't find org.apache.struts2.dispatcher.FilterDispatcher on start up. Look in the struts 2 JAR to make sure you can see that class. You might have a version issue. If it does appear, check the WAR file that Maven builds for you to ensure that the JAR makes it into the WEB-INF/lib. – duffymo Jun 07 '16 at 12:51
  • Remove `xwork-core` dependency. – Aleksandr M Jun 07 '16 at 17:17

0 Answers0