使用Maven和Tomcat 7.0.42
当我的war文件部署在我的tomcat上时,我得到一个ClassNotFoundException。在我的tomcat上查看文件夹时,我只看到一个.java但没有.class文件。现在再次启动服务器(我最近做了很多)并且它有.class文件。没有改变任何事情!我刚刚听说我们使用wtp插件进行部署。这有帮助吗?
这里发生了什么?
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>SVIS3GWebDruck</artifactId>
<packaging>war</packaging>
<parent>
<groupId>de.svi.svis3g</groupId>
<artifactId>SVIS3G_Fragments</artifactId>
<version>3.6.0-SNAPSHOT</version>
</parent>
<profiles>
<profile>
<id>local_tomcat_admin_app_deploy</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.1-sr-1</version>
<configuration>
<!-- Container configuration -->
<container>
<containerId>tomcat6x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password>pwd</cargo.remote.password>
<cargo.tomcat.manager.url>http://localhost:8080/manager</cargo.tomcat.manager.url>
</properties>
</configuration>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>local_tomcat_deploy</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.0.1-sr-1</version>
<configuration>
<!-- Container configuration -->
<container>
<containerId>tomcat6x</containerId>
</container>
<configuration>
<type>existing</type>
<home>B:\applicationserver\apache-tomcat-7.0.42</home>
</configuration>
<deployer>
<deployables>
<deployable>
<artifactId>SVIS3GWebDruck</artifactId>
<groupId>de.svi.svis3g</groupId>
<type>war</type>
</deployable>
</deployables>
</deployer>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>vt_tomcat_deploy</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<executions>
<execution>
<id>start-container</id>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<container>
<containerId>tomcat6x</containerId>
<type>remote</type>
</container>
<configuration>
<type>runtime</type>
<properties>
<cargo.remote.username>admin</cargo.remote.username>
<cargo.remote.password>pwd</cargo.remote.password>
<cargo.tomcat.manager.url>${ServerURL}/manager</cargo.tomcat.manager.url>
</properties>
</configuration>
<deployer>
<deployables>
<deployable>
<artifactId>SVIS3GWebDruck</artifactId>
<groupId>de.svi.svis3g</groupId>
<type>war</type>
</deployable>
</deployables>
</deployer>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws-core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
</dependency>
<dependency>
<groupId>com.caucho.hessian</groupId>
<artifactId>hessian</artifactId>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.svi.svis3g</groupId>
<artifactId>SVIS3GBirt</artifactId>
</dependency>
<dependency>
<groupId>de.svi.svis3g</groupId>
<artifactId>SVIS3GCommons</artifactId>
</dependency>
<dependency>
<groupId>de.svi.svis3g</groupId>
<artifactId>SVIS3GBusiness</artifactId>
</dependency>
<dependency>
<groupId>de.svi.svis3g</groupId>
<artifactId>SVIS3GBirtAPI</artifactId>
</dependency>
<dependency>
<groupId>de.svi.svis3g</groupId>
<artifactId>SVIS3GEISIntegrationAPI</artifactId>
</dependency>
<dependency>
<groupId>de.svi.svis3g</groupId>
<artifactId>SVIS3GEISIntegrationEVBDruck</artifactId>
</dependency>
<dependency>
<groupId>de.svi.svis3g</groupId>
<artifactId>SVIS3GEVBDruckWSGen</artifactId>
</dependency>
</dependencies>
<build>
<finalName>SVIS3GWebDruck</finalName>
<defaultGoal>install</defaultGoal>
<resources>
<resource>
<directory>src/main/resources/de/svi/svis3g/birt/resources</directory>
<targetPath>de/svi/svis3g/birt/resources</targetPath>
<filtering>false</filtering>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>target</directory>
<excludes>
<exclude>**/*</exclude>
</excludes>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
不是100%确定这是否是相关部分。问题是它已经正常运行,我从未改变过pom.xml上的任何内容。唯一可能是存储库的依赖项更新。