0

I am generating java classes from xsd using JAXB 1.0 (JDK 1.5 and Java Web Service Developer Pack 1.5). It is working fine in local. When, I tried in server, I am getting the following exception.

ErrMsg=[Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/bind/unmarshaller/InterningXMLReader at 
com.impl.runtime.UnmarshallerImpl.unmarshal(Unknown Source) 
at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
 at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:162) 
 at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:171) 
 at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:189) 
 Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.unmarshaller.InterningXMLReader 
 at java.net.URLClassLoader1ドル.run(URLClassLoader.java:366) at java.net.URLClassLoader1ドル.run(URLClassLoader.java:355) 
 at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 
 at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) 
 at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 9 more].

Any help?

asked Jul 8, 2014 at 5:44
1
  • If possible I would recommend using a JAXB 2 implementation. It is included in Java SE 6, but is compatible with Java SE 5. Commented Jul 8, 2014 at 10:45

2 Answers 2

2

You need to add jaxb-impl.jar to your Java Build Path. If you are using Eclipse then right-click your project, go to Properties->Java Build Path, click the Add External JARs... button, and finally select jaxb-ri-20110512/lib/jaxb-impl.jar. This should automatically add jaxb-api.jar, activation.jar, jsr173_1.0_api.jar, and jaxb1-impl.jar in addition to jaxb-impl.jar. Now there shouldn't be any more problems.

answered Jul 8, 2014 at 7:34
1
  • I am asking in server not in local Commented Jul 8, 2014 at 11:05
0

You miss the jaxb-impl.jar in your classpath. Download and add it.

answered Jul 8, 2014 at 5:54

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.