You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jaybytez <ja...@yahoo.com> on 2013/07/09 20:15:55 UTC
Re: JAX-RS NoSuchMethodError with 2.7.5 on WebLogic Server
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.
Re: JAX-RS NoSuchMethodError with 2.7.5 on WebLogic Server
Posted by sebastianz93 <se...@hotmail.com>.
Excellent, I also work for me
--
View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-NoSuchMethodError-with-2-7-5-on-WebLogic-Server-tp5730032p5735106.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: JAX-RS NoSuchMethodError with 2.7.5 on WebLogic Server
Posted by jaybytez <ja...@yahoo.com>.
I will try that as my next attempt.
I did quickly try switching the provider to the
<jaxrs:providers>
<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
</jaxrs:providers>
provided in the CXF documentation and this works in WLS 12 for JSON.
--
View this message in context: http://cxf.547215.n5.nabble.com/JAX-RS-NoSuchMethodError-with-2-7-5-on-WebLogic-Server-tp5730032p5730524.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: JAX-RS NoSuchMethodError with 2.7.5 on WebLogic Server
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On 09/07/13 19:15, jaybytez wrote:
> 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.
>
It looks like it is something to do with loading this JSONProvider in
WebLogic - if you say it actually works under certain conditions then it
does work.
How about this: register you custom provider which extends CXF
JSONProvider, what would happen in this case ?
Sergey
>
>
> --
> 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.
>
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com