We are using Ivy for our dependency manager, but I'm not exactly following what 
you mean.  Are you suggesting  I'm supplying a jar file in my war that  doesn't 
need to be there because Tomcat has its own version of it?


-----Original Message-----
From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Sent: Friday, May 30, 2014 4:55 PM
To: Tomcat Users List
Subject: Re: Deploying JerseyWS 2.8 w/o web.xml

Hash: SHA256


On 5/30/14, 5:03 PM, Cuneo, Nicholas wrote:
> We are trying to deploy a webservice to tomcat 8.0.5 using Jersey WS
> 2.8.  In the Jersey documentation it mentions deploying without the
> need for a web.xml in your war file using annotations, so I thought
> I’d give that a  try.
> However, when I go to deploy my webservice Tomcat is throwing the
> exception below, I can’t figure out what might be the issue.
> Some notes about our environment in case  they come into play:
> The webservice  is compiled with java 8.
> Tomcat is running on a linux server.
> As per the Jersey documentation, I have a class annotated with
> @ApplicationPath which extends ResourceConfig.  Our webservices exist
> in a separate package which is being loaded using the
> packages() function.
> 30-May-2014 20:57:22.592 SEVERE [localhost-startStop-4]
> org.apache.catalina.startup.ContextConfig.processServletContainerIniti
> alizers
Failed to process JAR found at URL [/api] for
> ServletContainerInitializers for context with name [{1}]
> java.io.IOException: java.lang.ClassCastException: Cannot cast
> org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer
> to javax.servlet.ServletContainerInitializer

It looks like you might have a JAR file in WEB-INF/lib that contains 
ServletContextInitializer or something similar. Tomcat should veto the loading 
of such classes, but something may have slipped-by.

Remember that runtime class is classloader + class, so the above error may be 
confusing: JerseyServletContainerInitializer does in fact extend 
ServletContainerInitializer (at least given their current API
javadoc) so the problem is likely that the ClassLoaders do not match.

Perhaps you are using Maven and it's unaware that Tomcat provides some of the 
javax.* packages itself?

- -chris
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/


To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


This e-mail contains privileged and confidential information intended for the 
use of the addressees named above. If you are not the intended recipient of 
this e-mail, you are hereby notified that you must not disseminate, copy or 
take any action in respect of any information contained in it. If you have 
received this e-mail in error, please notify the sender immediately by e-mail 
and immediately destroy this e-mail and its attachments.

To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to