使用Jersey rest webservice

时间:2017-02-16 13:58:03

标签: java web-services rest jersey

我有一个web服务,用于从UI接收多部分/表单数据。我的POM文件是

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpcore</artifactId>
        <version>4.3.2</version>
    </dependency>

    <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>4.3.2</version>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.2</version>
        <scope>test</scope>
    </dependency>

    <dependency> <!-- only on client side -->
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-client</artifactId>
        <version>1.19</version>
    </dependency>

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


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

    <dependency>
        <groupId>com.sun.jersey</groupId>
        <artifactId>jersey-servlet</artifactId>
        <version>1.19</version>
    </dependency>

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

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

    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.4</version>
    </dependency>

    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-s3</artifactId>
        <version>1.10.29</version>
    </dependency>

    <dependency>
        <groupId>com.aerospike</groupId>
        <artifactId>aerospike-client</artifactId>
        <version>3.2.1</version>
    </dependency>

    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml</artifactId>
        <version>3.9</version>
    </dependency>
    <dependency>
        <groupId>org.apache.xmlbeans</groupId>
        <artifactId>xmlbeans-xpath</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-ooxml-schemas</artifactId>
        <version>3.6</version>
    </dependency>
    <!-- http://mvnrepository.com/artifact/net.sf.saxon/saxon-dom -->
    <dependency>
        <groupId>net.sf.saxon</groupId>
        <artifactId>saxon-dom</artifactId>
        <version>8.7</version>
    </dependency>

    <dependency>
        <groupId>org.apache.directory.studio</groupId>
        <artifactId>org.dom4j.dom4j</artifactId>
        <version>1.6.1</version>
    </dependency>

    <dependency>
        <groupId>net.sf.opencsv</groupId>
        <artifactId>opencsv</artifactId>
        <version>2.3</version>
    </dependency>

当我尝试在tomcat 8中运行UI和webservice时,我收到错误。 java.lang.AbstractMethodError:javax.ws.rs.core.UriBuilder.uri(Ljava / lang / String;)Ljavax / ws / rs / core / UriBuilder;

我查看了与此异常相关的大多数SO问题并尝试了所有建议,但这些建议都不适用于我。我被困在这里。任何帮助将非常感激。提前致谢

1 个答案:

答案 0 :(得分:1)

只是添加以防有人面临问题。我按照link

解决了这个问题