javax.ws.rs.core.UriBuilder

时间:2018-09-21 10:25:39

标签: java maven dependencies weblogic12c transitive-dependency

我有一个Maven项目,它公开了一个REST服务,该服务由多个模块组成,我将其从Jersey 1.x(com.sun.jersey)升级到Jersey 2.x(org.glasshfish)。

我删除了所有Jersey 1依赖项(也包括传递性依赖项),包括jsr依赖项,并添加了Jersey 2.x依赖项(包括javax.ws.rs v2.1)。

问题是,当我尝试呼叫Endpoing时,在server.log6上收到包含这些详细信息的500内部服务器错误

java.lang.AbstractMethodError:javax.ws.rs.core.UriBuilder.uri(Ljava / lang / String;)Ljavax / ws / rs / core / UriBuilder;

这是“ mvn编译依赖关系:树” CLI命令的结果:

--< pr:pr-utilities >-- JAR
pr:pr-utilities:jar:1.1.85
+- com.github.fge:json-schema-validator:jar:2.2.6:compile
|  +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
|  +- joda-time:joda-time:jar:2.3:compile
|  +- com.googlecode.libphonenumber:libphonenumber:jar:6.2:compile
|  +- com.github.fge:json-schema-core:jar:1.2.5:compile
|  |  +- com.github.fge:uri-template:jar:0.9:compile
|  |  |  \- com.github.fge:msg-simple:jar:1.1:compile
|  |  |     \- com.github.fge:btf:jar:1.2:compile
|  |  +- com.github.fge:jackson-coreutils:jar:1.8:compile
|  |  \- org.mozilla:rhino:jar:1.7R4:compile
|  +- javax.mail:mailapi:jar:1.4.3:compile
|  |  \- javax.activation:activation:jar:1.1:compile
|  \- net.sf.jopt-simple:jopt-simple:jar:4.6:compile
+- org.codehaus.jettison:jettison:jar:1.3:compile
|  \- stax:stax-api:jar:1.0.1:compile
+- com.fasterxml.jackson.core:jackson-databind:jar:2.9.5:compile
|  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
|  \- com.fasterxml.jackson.core:jackson-core:jar:2.9.5:compile
+- pr:pr-dto:jar:1.1.85:compile
|  +- commons-beanutils:commons-beanutils:jar:1.9.3:compile
|  +- commons-collections:commons-collections:jar:3.2.2:compile
|  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
+- org.glassfish.jersey.core:jersey-client:jar:2.27:compile
|  +- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
|  +- org.glassfish.jersey.core:jersey-common:jar:2.27:compile
|  |  +- javax.annotation:javax.annotation-api:jar:1.2:compile
|  |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
|  \- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42:compile
+- org.apache.commons:commons-lang3:jar:3.1:compile
+- commons-codec:commons-codec:jar:1.4:compile
+- org.slf4j:slf4j-api:jar:1.7.21:compile
+- ch.qos.logback:logback-classic:jar:1.2.3:compile
|  \- ch.qos.logback:logback-core:jar:1.2.3:compile
+- org.apache.httpcomponents:httpclient:jar:4.5.3:compile
|  +- org.apache.httpcomponents:httpcore:jar:4.4.6:compile
|  \- commons-logging:commons-logging:jar:1.2:compile
+- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
\- org.jsoup:jsoup:jar:1.11.2:compile

-----< pr:pr-dao >----- EJB
pr:pr-dao:ejb:1.1.85
+- pr:pr-utilities:jar:1.1.85:compile
+- pr:pr-dto:jar:1.1.85:compile
+- org.mybatis:mybatis:jar:3.4.4:compile
+- oracle.jdbc.driver:ojdbc14:jar:10.2.0.1.0:provided
+- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.2.Final:provided
+- javax.annotation:javax.annotation-api:jar:1.2:compile
\- javax.servlet:javax.servlet-api:jar:4.0.1:compile

--< pr:pr-business-servicedao >-- EJB
pr:pr-business-servicedao:ejb:1.1.85
+- pr:pr-dao:jar:1.1.85:compile
+- pr:pr-dto:jar:1.1.85:compile
+- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.2.Final:provided
+- org.apache.xmlbeans:xmlbeans:jar:2.4.0:compile
|  \- stax:stax-api:jar:1.0.1:compile
\- javax.annotation:javax.annotation-api:jar:1.2:compile

--< pr:pr-business-delegate-i >-- JAR
pr:pr-business-delegate-i:jar:1.1.85
+- pr:pr-dto:jar:1.1.85:compile
+- pr:pr-utilities:jar:1.1.85:compile
\- javax.ejb:ejb-api:jar:3.0:provided

--< pr:pr-client-bus >-- JAR
pr:pr-client-bus:jar:1.1.85
+- pr:pr-utilities:jar:1.1.85:compile
+- pr:pr-dto:jar:1.1.85:compile
\- javax.mail:javax.mail-api:jar:1.5.6:compile

--< pr:pr-clientmdes >-- JAR
pr:pr-clientmdes:jar:1.1.85
+- junit:junit:jar:3.8.1:test
\- pr:pr-utilities:jar:1.1.85:compile

--< pr:pr-client-soa >-- JAR
pr:pr-client-soa:jar:1.1.85
+- pr:pr-utilities:jar:1.1.85:compile
\- pr:pr-client-bus:jar:1.1.85:compile
   \- javax.mail:javax.mail-api:jar:1.5.6:compile

--< pr:pr-business-delegate >-- EJB
pr:pr-business-delegate:ejb:1.1.85
+- pr:pr-business-delegate-i:jar:1.1.85:compile
+- pr:pr-dto:jar:1.1.85:compile
+- pr:pr-business-servicedao:jar:1.1.85:compile
+- pr:pr-client-bus:jar:1.1.85:compile
|  \- javax.mail:javax.mail-api:jar:1.5.6:compile
+- pr:pr-clientmdes:jar:1.1.85:compile
+- pr:pr-client-soa:jar:1.1.85:compile
+- pr:pr-utilities:jar:1.1.85:compile
\- org.jboss.spec.javax.ejb:jboss-ejb-api_3.1_spec:jar:1.0.2.Final:provided

----< pr:pr-rest >----- WAR
pr:pr-rest:war:1.1.85
+- pr:pr-utilities:jar:1.1.85:compile


+- pr:pr-business-delegate-i:jar:1.1.85:compile
+- pr:pr-dto:jar:1.1.85:compile
+- org.glassfish.jersey.core:jersey-server:jar:2.27:compile
|  +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.27:compile
|  +- javax.annotation:javax.annotation-api:jar:1.2:compile
|  +- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42:compile
|  \- javax.validation:validation-api:jar:1.1.0.Final:compile
+- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.27:compile
|  \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.27:compile
+- org.glassfish.jersey.core:jersey-common:jar:2.27:compile
|  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
+- javax.servlet:javax.servlet-api:jar:4.0.1:compile
+- org.glassfish.jersey.inject:jersey-hk2:jar:2.26:compile
|  \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b42:compile
|     +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b42:compile
|     +- org.glassfish.hk2:hk2-api:jar:2.5.0-b42:compile
|     |  \- javax.inject:javax.inject:jar:1:compile
|     +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b42:compile
|     \- org.javassist:javassist:jar:3.22.0-CR2:compile
+- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
\- org.glassfish.jersey.media:jersey-media-multipart:jar:2.27:compile
   \- org.jvnet.mimepull:mimepull:jar:1.9.6:compile

-----< pr:pr-app >----- EAR
pr:pr-app:ear:1.1.85
+- pr:pr-business-servicedao:ejb:1.1.85:compile
+- pr:pr-dao:ejb:1.1.85:compile
+- pr:pr-business-delegate:ejb:1.1.85:compile
+- pr:pr-rest:war:1.1.85:compile
\- pr:pr-rest:pom:1.1.85:compile
   +- org.glassfish.jersey.core:jersey-server:jar:2.27:compile
   |  +- org.glassfish.jersey.media:jersey-media-jaxb:jar:2.27:compile
   |  +- org.glassfish.hk2.external:javax.inject:jar:2.5.0-b42:compile
   |  \- javax.validation:validation-api:jar:1.1.0.Final:compile
   +- org.glassfish.jersey.containers:jersey-container-servlet:jar:2.27:compile
   |  \- org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.27:compile
   +- org.glassfish.jersey.core:jersey-common:jar:2.27:compile
   |  \- org.glassfish.hk2:osgi-resource-locator:jar:1.0.1:compile
   +- org.glassfish.jersey.inject:jersey-hk2:jar:2.26:compile
   |  \- org.glassfish.hk2:hk2-locator:jar:2.5.0-b42:compile
   |     +- org.glassfish.hk2.external:aopalliance-repackaged:jar:2.5.0-b42:compile
   |     +- org.glassfish.hk2:hk2-api:jar:2.5.0-b42:compile
   |     |  \- javax.inject:javax.inject:jar:1:compile
   |     +- org.glassfish.hk2:hk2-utils:jar:2.5.0-b42:compile
   |     \- org.javassist:javassist:jar:3.22.0-CR2:compile
   +- javax.ws.rs:javax.ws.rs-api:jar:2.1:compile
   \- org.glassfish.jersey.media:jersey-media-multipart:jar:2.27:compile
      \- org.jvnet.mimepull:mimepull:jar:1.9.6:compile

这是weblogic-application.xml

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application
    xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-application"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/javaee_5.xsd http://xmlns.oracle.com/weblogic/weblogic-application http://xmlns.oracle.com/weblogic/weblogic-application/1.4/weblogic-application.xsd">


    <prefer-application-packages>
        <package-name>org.slf4j.*</package-name>
        <package-name>org.apache.commons.logging.*</package-name>
        <package-name>org.glassfish.jersey.*</package-name>
    </prefer-application-packages>

    <prefer-application-resources>
        <resource-name>org/slf4j/impl/StaticLoggerBinder.class</resource-name>
        <resource-name>META-INF/services/javax.servlet.ServletContainerInitializer</resource-name>
        <resource-name>META-INF/services/javax.ws.rs.ext.RuntimeDelegate</resource-name>

        <resource-name>META-INF/services/org.glassfish.jersey.*</resource-name>
        <resource-name>com.fasterxml.jackson.*</resource-name>
        <resource-name>org.glassfish.jersey.*</resource-name>
        <resource-name>jersey.repackaged.*</resource-name>

    </prefer-application-resources>

</weblogic-application>

和web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
    </welcome-file-list>


    <servlet>
        <servlet-name>jersey-servlet</servlet-name>
        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
        <!-- Register resources and providers under my.package. -->
        <init-param>
            <param-name>javax.ws.rs.Application</param-name>
            <param-value>it.sella.tokenizationproxy.rest.support.RestApplication</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>jersey-servlet</servlet-name>
        <url-pattern>/rest/mdes/*</url-pattern>
    </servlet-mapping>
</web-app>

和RestApplication类

import java.util.HashSet;
import java.util.Set;

import java.util.HashMap;
import java.util.Map;
import javax.ws.rs.core.Application;
import javax.ws.rs.ApplicationPath;

@ApplicationPath("/*")
public class RestApplication extends Application {

    @Override
    public Set<Class<?>> getClasses() {
        final Set<Class<?>> classes = new HashSet<Class<?>>();
        classes.add(RestDummy.class);
        classes.add(CheckEligibilityRest.class);
        classes.add(DigitizeRest.class);
        classes.add(PkCertificateRest.class);
        classes.add(RegisterRest.class);
        classes.add(NotifyTokenRest.class);
        classes.add(TestSystem.class);
        classes.add(SuspendRest.class);
        classes.add(UnsuspendRest.class);
        classes.add(ReloadTrustoreKeystoreRest.class);
        return classes;
    }
}

通过浏览器点击显示的URL进行调用 拜托,您能帮我了解问题出在哪里吗?

提前谢谢

0 个答案:

没有答案