users@jersey.java.net

Re: [Jersey] problem running Jersey webapp to Tomcat 6.0.20

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 18 Jan 2010 11:20:08 +0000

On Jan 14, 2010, at 7:15 PM, Gregg Carrier wrote:

> Paul -
>
> Thanks for the reply.
>
> I'm using Maven and added the following jersey-related dependencies:
> <dependency>
> <groupId>com.sun.jersey</groupId>
> <artifactId>jersey-json</artifactId>
> <version>1.1.4.1</version>
> </dependency>
> <dependency>
> <groupId>com.sun.jersey</groupId>
> <artifactId>jersey-server</artifactId>
> <version>1.1.4.1</version>
> </dependency>
>
> A lot of other jar dependencies came along with those and are
> bundled in my war, installed in a fresh copy of Tomcat.
>

The above looks OK. What does the following output?

   mvn dependency:tree

(feel free to send me privately if public disclosure is an issue).


> Is there a requirement on the servlet-api version?
>

No.

The error indicates that the Jersey server is using the wrong version
of Jersey core, the versions need to be the same

Such an error could occur if say jersey server 1.1.4.1 was somehow
pickup up jersey core 1.0.3.1, although from the dependencies you have
presented this cannot occur. (I cannot recall exactly at which version
the ServiceFinder class was modified.)

Paul.


> Thanks again.
>
> Gregg
>
> On Thu, Jan 14, 2010 at 4:05 AM, Paul Sandoz <Paul.Sandoz_at_sun.com>
> wrote:
> Hi Gregg,
>
> I think you may have a Jersey version mismatch between certain
> jersey jars. What jersey jars are you using with Tomcat?
>
> See the dependencies here:
>
> https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html
> #chapter_deps
>
> Paul.
>
>
> On Jan 14, 2010, at 12:29 AM, Gregg Carrier wrote:
>
> This war runs fine in Glassfish v3, but when I make a request in
> Tomcat, I get the following trace. Any ideas? Thanks!
>
> java.lang.NoSuchMethodError:
> com.sun.jersey.spi.service.ServiceFinder.find(Ljava/lang/
> String;)Lcom/sun/jersey/spi/service/ServiceFinder;
>
>
>
> com
> .sun
> .jersey
> .server
> .impl
> .application.WebApplicationImpl.initiate(WebApplicationImpl.java:466)
>
> com
> .sun
> .jersey
> .server
> .impl
> .application.WebApplicationImpl.initiate(WebApplicationImpl.java:449)
>
> com
> .sun
> .jersey
> .spi
> .container.servlet.ServletContainer.initiate(ServletContainer.java:
> 404)
>
>
> com.sun.jersey.spi.container.servlet.ServletContainer
> $InternalWebComponent.initiate(ServletContainer.java:253)
>
> com
> .sun
> .jersey.spi.container.servlet.WebComponent.load(WebComponent.java:521)
>
> com
> .sun
> .jersey.spi.container.servlet.WebComponent.init(WebComponent.java:199)
>
>
>
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 308)
>
> com
> .sun
> .jersey
> .spi.container.servlet.ServletContainer.init(ServletContainer.java:
> 471)
> javax.servlet.GenericServlet.init(GenericServlet.java:212)
>
>
>
> org
> .apache
> .catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>
> org
> .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> 293)
>
> org
> .apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> 849)
>
>
> org.apache.coyote.http11.Http11Protocol
> $Http11ConnectionHandler.process(Http11Protocol.java:583)
> org.apache.tomcat.util.net.JIoEndpoint
> $Worker.run(JIoEndpoint.java:454)
> java.lang.Thread.run(Unknown Source)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>