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