wood burning stoves 2.0*
The moose likes Servlets and the fly likes Unable to load class to check against the @HandlesTypes annotation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Unable to load class to check against the @HandlesTypes annotation" Watch "Unable to load class to check against the @HandlesTypes annotation" New topic
Author

Unable to load class to check against the @HandlesTypes annotation

Brian Lewis
Greenhorn

Joined: Oct 19, 2011
Posts: 2
I'm hoping that I've posted this in the correct forum - it was a little hard to figure out which specific area it belonged to. I've developed a JAX-RS web service (using Jersey implementation) that I'm deploying to Tomcat 7.0.22. Immediately after deployment, I see around 75+ warning messages that look like the following:

Oct 19, 2011 10:09:21 AM org.apache.catalina.startup.ContextConfig checkHandlesTypes
WARNING: Unable to load class [com.sun.codemodel.JArrayClass$1] to check against the @HandlesTypes annotation of one or more ServletContentInitializers.
java.lang.ClassNotFoundException: com.sun.codemodel.JArrayClass$1
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
at org.apache.catalina.startup.ContextConfig.checkHandlesTypes(ContextConfig.java:1969)
at org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:1932)
at org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1826)
at org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1785)
at org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1771)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1254)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:932)
at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:723)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1363)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:294)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1233)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1391)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1401)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1380)
at java.lang.Thread.run(Thread.java:662)


I've checked and all the classes (mostly JAXB ones) that Tomcat is complaining about can be found in JAR files within the classpath (WEB-INF/lib) which was set up in Eclipse. Just to test things out I created a test dynamic web project using JAX-RS in Eclipse and found that the warnings started when I added jaxb-xjc.jar to the classpath. I've found one workaround - if I change the web-app version to "2.5" in the web.xml file the warnings disappear. However, I'd really like to find a way to use Servlet version 3.0, if possible. See my web.xml file below:

Brian Lewis
Greenhorn

Joined: Oct 19, 2011
Posts: 2
Turns out that the jaxb-xjc.jar file wasn't needed for deployment, so I just removed it from the classpath, which took care of the warning messages.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

Welcome to CodeRanch, Brian Lewis!


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
J Oliver
Greenhorn

Joined: Oct 28, 2011
Posts: 2
Brian,

Thanks for solving this. I had the same problem. I hate it when the stack trace has absolutely no reference to any code I wrote!
This was bothering me almost to the point of figuring it out myself!

Thanks again.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

And welcome to CodeRanch, J Oliver!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to load class to check against the @HandlesTypes annotation
 
Similar Threads
Spring MVC Problem
error in console
HTTP Status 404 - /ch1/Serv1
Weld 1.1.0-Final : Cannot inherit from final class
error in console