users@jersey.java.net

[Jersey] Re: Tomcat can't load com.sun.jersey.spi.container.servlet.ServletContainer, but Glasfish can

From: Sven Strittmatter <weltraumschaf_at_googlemail.com>
Date: Tue, 14 Feb 2012 23:18:46 +0100

Hi Glen,

tried already this
https://blogs.oracle.com/japod/entry/building_simple_jersey_web_app and
now your's example. It's not really a difference.

IMO it is not a problem of deploing. I trid several alternatives: deploy
by Netbeans, by maven and via the Tomcats Manager App. Always the same
result: If I pack the jersey-bundle-1.11.jar (Downloaded from sun/oracle
site) by hand into WEB-INF/lib, then it works. Unless I add it Tomcat
does not have any "com.sun.jersey.spi.container.servlet.ServletContainer".

I inspected the jersey-bundle-1.11.jar an guess what: There is a
com.sun.jersey.spi.container.servlet.ServletContainer class. But in my
Maven dependenies:
<dependency>
        <groupId>com.sun.jersey</groupId>
         <artifactId>jersey-server</artifactId>
         <version>1.11</version>
         <scope>compile</scope>
</dependency>
<dependency>
         <groupId>com.sun.jersey</groupId>
         <artifactId>jersey-client</artifactId>
         <version>1.11</version>
         <scope>compile</scope>
</dependency>
<dependency>
         <groupId>com.sun.jersey</groupId>
         <artifactId>jersey-json</artifactId>
         <version>1.11</version>
         <scope>compile</scope>
</dependency>

and the subdependency jersy-core-1.11.jar this class is missing.
What do I have to add as dependency? All examples I've found mention
only jersey-server and some test scope dependencies.

Chers
Sven
-- 
"Ich habe vom Glauben zum Wissen konvertiert." (Abdel-Samad)