I think you are correct, maybe I need to exclude some jars from my bundle?

find . -name "*.jar" | xargs grep ServletContainerInitializer.class
Binary file ./servlet-api.jar matches

find ../webapps/api/WEB-INF/lib -name "*.jar" | xargs grep 
ServletContainerInitializer.class
Binary file ../webapps/api/WEB-INF/lib/jersey-container-servlet-jar-2.8.jar 
matches
Binary file ../webapps/api/WEB-INF/lib/javax.servlet-api-jar-3.0.1.jar matches

Thanks,
Nick


-----Original Message-----
From: Cuneo, Nicholas [mailto:ncu...@tycoint.com]
Sent: Monday, June 02, 2014 9:25 AM
To: Tomcat Users List
Subject: RE: Deploying JerseyWS 2.8 w/o web.xml

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?

Thanks,
Nick


-----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

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Nick

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTiRpRAAoJEBzwKT+lPKRYeZUP/RQ4NlB9yxhGaXVdBNoPVKdq
L8DakkbBlHLOVnOgEcyK++s5iOUFXHSeRVJuTIDQs0fAiDnMjC4V+3wynCJbzgz1
174AsN50+LEG4wvJ+rVwS0yBaEzwn7bHKY5zR/J0Rrry4Ms6J4xTuuL8nofr/qkJ
muNFagg+Ypxfbo9qH0Y/XgFMU7IVy4+ti3dtVKXCZJjjOkaRC9DB6A/Win83onAC
FU8zO2bgrTyGtJFsF1IK5VE9V4lafSIy8HgszWUm3zbG1dmrXpii65vdF+gSBALs
kyTN4bekR15O9ubuHXspqZwpJyEBxRLy71048PEHg0gQ4BCluy6nmksxeRTTtVsH
30VRsp2p/JlUHIJWrB/mJ98Co0hN5h2dwzodARarTm8Qm9P/ZDCDzOLj2cHgv6cY
AodGJYuLcNDiwfyv74kVyf0sr/mj54ghZ61ttLYPpqwcZyDTf9dmPiS/SuB9uSWa
oHOcg36v6s0FSIXlvpM+MZ7R1n+m/Dsj2u5dRkt/L/WzNBR7BSQqfs6vPiYoz5H7
IVRhgxYGZLXTmhNx/0yk14zr3EF8Ww84oXlyXNui2kM6jpGgkbleSV/1dkd6F3Ud
/mZxY8a5rqrqrEN/qgFRx0gk2LEtnQhE8p4qHT/2ij0Q1UQXMpPQBL4bdLIe4Zep
FPjzCGsmV9amCd6jvJU2
=6tVn
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
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


________________________________

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.

Reply via email to