我正在尝试使用maven执行uribuilder,但出现以下错误:
严重:路径为[]的上下文中servlet[jersey rest service]的servlet.service()引发了根本原因为java.lang.abstractmethoderror的异常[servlet execution引发了异常]:receiver类com.sun.jersey.api.uri.uribuilderimpl未定义或继承已解析方法“AbstractJavax.ws.rs.core.uribuilder”的实现抽象类javax.ws.rs.core.uribuilder的uri(java.lang.string)。
位于javax.ws.rs.core.uribuilder.fromuri(uribuilder.java:96)
我尝试了不同的依赖项,但每次都会发生此错误。我在网络上查看了这个错误,但是,没有一个解决方案对我有效。我不知道该怎么办。
my pom.xml:
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.3</version>
<configuration>
<warSourceDirectory>WebContent</warSourceDirectory>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.6.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.2.6.Final</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.40</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.tomcat/tomcat -->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat</artifactId>
<version>8.5.5</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>javax.xml.soap</groupId>
<artifactId>javax.xml.soap-api</artifactId>
<version>1.4.0</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.quartz-scheduler/quartz -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
<version>2.2.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
<!-- https://mvnrepository.com/artifact/org.quartz-scheduler/quartz-jobs -->
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz-jobs</artifactId>
<version>2.2.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.sun.jersey/jersey-bundle -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-bundle</artifactId>
<version>1.19.4</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<version>1.17.1</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>de.is2.java.api</groupId>
<artifactId>insign-java-api</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/WebContent/WEB-INF/lib/insign-java-api-3.9.29.jar</systemPath>
</dependency>
<dependency>
<groupId>de.is2.rest.api.nodep</groupId>
<artifactId>insign-rest-api-nodep</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${basedir}/WebContent/WEB-INF/lib/insign-rest-api-nodep-3.9.29.jar</systemPath>
</dependency>
</dependencies>
我在eclipse中使用Tomcat8.5,一个重要的补充说明是,我必须使用jersey 1.x,而不是更新的版本!有人知道uribuilder包含了哪些依赖项,以及我应该从pom.xml中删除哪些依赖项吗。我可以只包括球衣包吗?在pom.xml的最后几行中,我包含了两个jar,它们不在构建路径中。这对他们来说是正确的吗?
暂无答案!
目前还没有任何答案,快来回答吧!