简体   繁体   中英

Support JAX-RS 2.0 with WebLogic 12C

I am reading the following links to get weblogic suported Jaxrs 2.0

https://docs.oracle.com/middleware/1213/wls/WLUPG/upgrade_ws.htm#WLUPG332 https://docs.oracle.com/middleware/1213/wls/RESTF/use-jersey20-ri.htm#RESTF297

I have found javax.ws.rs-api-2.0.jar file renamed it javax.ws.rs-api-2.0.war. Then deploy it as a library file into weblogic.

But I am still having the error since weblogic still use jaxrs 1.1 APIs.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'openStackService': Invocation of init method failed;
hodError: javax.ws.rs.core.MultivaluedMap.addAll(Ljava/lang/Object;[Ljava/lang/Object;)V

here is my all configuration:

pom.xml

<dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-client</artifactId>
        <version>2.10.1</version>
    </dependency> 

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${org.springframework.version}</version>
        </dependency>

        <dependency>
            <groupId>org.pacesys</groupId>
            <artifactId>openstack4j</artifactId>
            <version>2.0.9</version>
        </dependency>

weblogic.xml

<?xml version="1.0" encoding="UTF-8"?>
<wls:weblogic-web-app xmlns:wls="http://xmlns.oracle.com/weblogic/weblogic-web-app"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://xmlns.oracle.com/weblogic/weblogic-web-app 
           http://xmlns.oracle.com/weblogic/weblogic-web-app/1.7/weblogic-web-app.xsd">

    <context-root>jaxrsrest</context-root>
    <wls:library-ref> 
       <library-name>javax.ws.rs</library-name>
       <specification-version>2.0</specification-version>
       <exact-match>false</exact-match>
    </wls:library-ref>
</wls:weblogic-web-app>

在此处输入图片说明

I have realized that weblogic 12.1.3 comes with following foldes having jax-rs-2.0.war

Oracle\\wlserver\\common\\deployable-libraries.

I have installed the war file as library into Application Server

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM