users@jersey.java.net

[Jersey] Re: NoSuchMethodError: getContextResolver on deployment

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 31 May 2011 18:30:17 +0200

Hello,

I'd recommend one from these set-ups:

a) jax-rs and jersey related binaries in jersey-web-lib.war and deploy
it as a shared library - if you are planning to have more than one
application which will use jersey.

b) jax-rs and jersey related binaries packaged in a war together with
application


complete list of dependencies:

modular way:
[INFO] com.sun.jersey:jersey-server:jar:1.0.2
[INFO] +- com.sun.jersey:jersey-core:jar:1.0.2:compile
[INFO] | \- javax.ws.rs:jsr311-api:jar:1.0:compile
[INFO] +- asm:asm:jar:3.1:compile
[INFO] +- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] +- javax.persistence:persistence-api:jar:1.0.2:provided
[INFO] +- javax.mail:mail:jar:1.4:provided
[INFO] | \- javax.activation:activation:jar:1.1:provided
[INFO] +- javax.xml.bind:jaxb-api:jar:2.1:provided
[INFO] | \- javax.xml.stream:stax-api:jar:1.0-2:provided
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- javax.servlet:jsp-api:jar:2.0:provided
[INFO] +- ant:ant:jar:1.6.5:provided
[INFO] +- com.sun.grizzly:grizzly-servlet-webserver:jar:1.8.6.4:provided
[INFO] | +- com.sun.grizzly:grizzly-http:jar:1.8.6.4:provided
[INFO] | | +- com.sun.grizzly:grizzly-rcm:jar:1.8.6.4:provided
[INFO] | | \- com.sun.grizzly:grizzly-portunif:jar:1.8.6.4:provided
[INFO] | +- com.sun.grizzly:grizzly-framework:jar:1.8.6.4:provided
[INFO] | +- com.sun.grizzly:grizzly-http-utils:jar:1.8.6.4:provided
[INFO] | \- com.sun.grizzly:grizzly-http-servlet:jar:1.8.6.4:provided


bundle way:
[INFO] com.sun.jersey:jersey-bundle:jar:1.0.2
[INFO] +- javax.ws.rs:jsr311-api:jar:1.0:compile
[INFO] +- javax.annotation:jsr250-api:jar:1.0:provided
[INFO] +- javax.persistence:persistence-api:jar:1.0.2:provided
[INFO] +- javax.mail:mail:jar:1.4:provided
[INFO] | \- javax.activation:activation:jar:1.1:provided
[INFO] +- javax.xml.bind:jaxb-api:jar:2.1:provided
[INFO] | \- javax.xml.stream:stax-api:jar:1.0-2:provided
[INFO] +- com.sun.xml.bind:jaxb-impl:jar:2.1.10:provided
[INFO] +- org.codehaus.jackson:jackson-lgpl:jar:0.9.4:provided
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- javax.servlet:jsp-api:jar:2.0:provided
[INFO] +- ant:ant:jar:1.6.5:provided
[INFO] +- com.sun.grizzly:grizzly-servlet-webserver:jar:1.8.6.4:provided
[INFO] | +- com.sun.grizzly:grizzly-http:jar:1.8.6.4:provided
[INFO] | | +- com.sun.grizzly:grizzly-rcm:jar:1.8.6.4:provided
[INFO] | | \- com.sun.grizzly:grizzly-portunif:jar:1.8.6.4:provided
[INFO] | +- com.sun.grizzly:grizzly-framework:jar:1.8.6.4:provided
[INFO] | +- com.sun.grizzly:grizzly-http-utils:jar:1.8.6.4:provided
[INFO] | \- com.sun.grizzly:grizzly-http-servlet:jar:1.8.6.4:provided
[INFO] +- rome:rome:jar:0.9:provided
[INFO] +- jdom:jdom:jar:1.0:provided
[INFO] +- org.codehaus.jettison:jettison:jar:1.0.1:provided
[INFO] | \- stax:stax-api:jar:1.0.1:provided
[INFO] +- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.2:provided
[INFO] \- asm:asm:jar:3.1:provided


Not everything is really needed, for example you should not need to
include grizlly*, jaxb, jackson and stuff already present in WLS -
servlet, annotation, persistence, .. (not sure about that list).

If I were in your situation, I'd start with
helloworld-webapp-1.0.2-project.zip, as I already mentioned - it should
work out of the box on any servlet container and maven will take care of
including correct dependencies..


On 5/31/11 5:25 PM, Outdoorted wrote:
> Hi Pavel,
>
> Besides jersey-core-1.0.2.jar and jsr311-api-1.0.jar, the .war also
> contains the jersey-server-1.0.2.jar and asm-3.1.jar. I included the
> jersey-bundle jar in the .war, but then the server (weblogic) fails to
> start. In the prior start (i.e. w/o the jersey-bundle), the server could
> start, but deployment of the app fails (w/ the prior mentioned errors).
>
> Are there any bugs related to the how Provider.getContextResolver is defined
> and what is expected by the AbstractJAXBProvider class, in version 1.0.2?
>
> Or do you think this is more likely a configuration issue?
definitely the latter - configuration issue.

I remember there was some issue with package scanning feature related to
WLS which might not be fixed in 1.0.2, but stacktrace would be
different. Btw, why do you insist on 1.0.2? If you need to use JDK 1.5,
you still should be able to upgrade to Jersey 1.2.

Regards,
Pavel


> Ted
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/NoSuchMethodError-getContextResolver-on-deployment-tp6411585p6423222.html
> Sent from the Jersey mailing list archive at Nabble.com.
>