Maven依赖项目休息项目

时间:2017-04-15 20:10:07

标签: rest jersey dependencies

在我的休息项目中,我使用的是1.8号球衣。我想升级到jersey 1.18,但是当我尝试在服务器中再次启动时,这打破了我的项目。 这是我的pom文件:

<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>
<groupId>BoardGame</groupId>
<artifactId>BoardGame</artifactId>
 <version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
  <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.3</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
  </plugin>
  <plugin>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.6</version>
    <configuration>
      <warSourceDirectory>WebContent</warSourceDirectory>
      <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
  </plugin>
</plugins>

<dependencies>
<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-server</artifactId>
    <version>1.18</version>
</dependency>

<dependency>
    <groupId>com.sun.jersey</groupId>
    <artifactId>jersey-core</artifactId>
    <version>1.18</version>
</dependency>

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>6.0.6</version>
</dependency>

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20090211</version>
    </dependency>

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.6.3</version>
    </dependency>

    <dependency>
     <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>2.1</version>
    </dependency>

    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-json</artifactId>
        <version>1.18</version>
    </dependency>

    <dependency>
        <groupId>com.sun.jersey.contribs</groupId>
        <artifactId>jersey-multipart</artifactId>
        <version>1.18</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.jvnet/mimepull 
    <dependency>
        <groupId>org.jvnet</groupId>
        <artifactId>mimepull</artifactId>
        <version>1.3</version>
    </dependency> -->

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpmime</artifactId>
        <version>4.5.3</version>
    </dependency>

我想使用multipart 1.18而不是1.8。

当我在服务器上运行项目时,我收到此错误:  Servlet / BoardGame抛出了load()异常 抛出java.lang.ClassNotFoundException。

有人可以帮我吗?

堆栈追踪:

  

2017年4月15日下午11:19:02 org.apache.catalina.core.StandardContext   loadOnStartup严重:Servlet / BoardGame引发了load()异常   抛出java.lang.ClassNotFoundException:   com.sun.jersey.spi.container.servlet.ServletContainer at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)     在   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)     在   org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)     在   org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)     在   org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:142)     在   org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)     在   org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)     在   org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)     在   org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)     在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1559)     在   org.apache.catalina.core.ContainerBase $ StartChild.call(ContainerBase.java:1549)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)at   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在   java.util.concurrent.ThreadPoolExecutor中的$ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745)

0 个答案:

没有答案