java.lang.ClassNotFoundException : com/sun/xml/bind/v2/model/annotation/AnnotationReader
Problem
Deploying a JAX-WS web service on Tomcat, hits following error message :
java.lang.ClassNotFoundException:
com/sun/xml/bind/v2/model/annotation/AnnotationReader
Solution
The JAX-WS dependency library “jaxb-impl.jar” is missing.
- Go here http://jax-ws.java.net/.
- Download JAX-WS RI distribution.
- Unzip it and copy “jaxb-impl.jar” to Tomcat library folder “{$TOMCAT}/lib“.
- Restart Tomcat.
Since the 2.2.7 version of jaxb the annotation reader class is in the jaxb-core.jar:
http://grepcode.com/file/repository.jboss.org/maven2/sun-jaxb/jaxb-impl/2.1.4/com/sun/xml/bind/v2/model/annotation/RuntimeAnnotationReader.java
So put the jaxb-core.jar file in the Tomcat’s lib folder.
It works for me.
This Worked for me, Thanks mick.
Hello Mkyong,
This is out of date for version 2.2.11. Could you please add / update post to support your answer for latest dependencies? No one willing to use old if latest is available.
I have also same problem plz reply me please………….
In jaxb-impl.jar file , in com.sun.xml.bind.v2.model.annotation package , I could not found AnnotationReader class.
I am getting
“Exception in thread “main” java.lang.NoClassDefFoundError: com/sun/xml/bind/v2/model/annotation/AnnotationReader”
hi..”jaxb-impl.jar” is prsent in tomcat-lib..but still its giving the same error..Plz guide me..
Thanks in advance
Please see the version of that jar.