Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAXB Binding Exception

Tags:

java

jaxb

I got the folowing error while parsing the XSD to Java Object

Exception in thread "main" java.lang.IllegalArgumentException: Expected class ja vax.xml.bind.annotation.XmlAccessType but found class javax.xml.bind.annotation. AccessType

Can any one give the solution for this error

like image 447
SivaGanesh Avatar asked May 18 '26 09:05

SivaGanesh


2 Answers

I would guess that you're running XJC under Java6, and have the jaxb-api.jar on your classpath. The classes from the Java6 runtime are clashing with the classes in jaxb-api.jar.

Remove the JAR from the classpath, that should fix it (if that's that's what the problem is).

like image 90
skaffman Avatar answered May 19 '26 23:05

skaffman


if you are running XJC under java6, consider this page: http://download.oracle.com/javase/6/docs/technotes/tools/share/xjc.html

Actually, xjc has been embedeed in jdk6 so you have to use 'xjc command' present in your JAVA_HOME/bin dir.

like image 37
4lotus4 Avatar answered May 19 '26 21:05

4lotus4



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!