I have spent multiple days on this and just cannot get this basic example to
work with anything CXF 2.5 or greater.  If I remove the jaxb/json providers
and comment out cxf-rt-rs-extension-providers and change CXF to 2.4.10, it
runs perfectly on WLS 12.

The following are the only dependencies.

  <properties>
        <spring.version>3.2.3.RELEASE</spring.version>
        <cxf.version>2.7.5</cxf.version>
  </properties>

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

        
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
            <version>${cxf.version}</version>
        </dependency>

        <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-rs-extension-providers</artifactId>
        <version>${cxf.version}</version>
        </dependency>

        <dependency>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <groupId>org.apache.cxf</groupId>
            <version>${cxf.version}</version>
        </dependency>

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

  </dependencies>

So I attempted to get this running on Tomcat with the latest Spring and CXF. 
If I add the configuration for the json and jaxb providers and then include
the following Jettison Dependency, the war works perfectly on Tomcat.

<dependency>
        <groupId>org.codehaus.jettison</groupId>
        <artifactId>jettison</artifactId>
        <version>1.3.4</version>
</dependency>

If I now deploy this war onto WLS with jettison, then the XML interaction
works within my ReST service, but the JSON does not.

So if I hit a url that returns XML, it is now working.

But if I hit a url with a JSON response, I am still getting this error
(which at least centralizes the issue around the JSON Provider)...again,
this works without issue in Tomcat.

<Jul 9, 2013 11:01:21 AM PDT> <Error> <HTTP> <BEA-101017>
<[ServletContext@23433699[app:cxf-rest module:cxf-rest.war path:null
spec-version:3.0]] Root cause of ServletException.
java.lang.NoSuchMethodError:
javax.ws.rs.ServerErrorException.validate(Ljavax/ws/rs/core/Response;Ljavax/ws/rs/core/Response$Status$Family;)Ljavax/ws/rs/core/Response;
        at 
javax.ws.rs.ServerErrorException.<init>(ServerErrorException.java:101)
        at
javax.ws.rs.InternalServerErrorException.<init>(InternalServerErrorException.java:80)
        at
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleWriteException(JAXRSOutInterceptor.java:385)
        at
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:305)
        at
org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:154)
        Truncated. see log file for complete stacktrace

The even more interesting part of this is if I remove the jsonProvider
configuration and redeploy the war, the first time I hit the url for the
JSON Response, it works, but every subsequent time throws this same
exception.



--
View this message in context: 
http://cxf.547215.n5.nabble.com/JAX-RS-NoSuchMethodError-with-2-7-5-on-WebLogic-Server-tp5730032p5730514.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to