Hi All,

I'm trying to compile an xsd schema using xjc compiler following the command

java -jar jaxb-xjc.jar <schema file>.I've set the classpath of these following jar files

jaxb-api.jar

jaxb-impl.jar

jaxb1-impl.jar

jaxb-xjc.jar

sjsxp.jar

jsr173_api.jar

activation.jar

resolver.jar.
It is showing IllegalArgumentException

Read the whole message. It will tell you where the problem is.

Whole message is as following

parsing a schema...
compiling a schema...
Exception in thread "main" java.lang.IllegalArgumentException: Expected class ja
vax.xml.bind.annotation.XmlAccessType but found class javax.xml.bind.annotation.
AccessType
at com.sun.codemodel.TypedAnnotationWriter.checkType(TypedAnnotationWrit
er.java:187)
at com.sun.codemodel.TypedAnnotationWriter.invoke(TypedAnnotationWriter.
java:101)
at $Proxy1.value(Unknown Source)
at com.sun.tools.xjc.generator.bean.ImplStructureStrategy$1.createClasse
s(ImplStructureStrategy.java:46)
at com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassDef(BeanG
enerator.java:371)
at com.sun.tools.xjc.generator.bean.BeanGenerator.getClazz(BeanGenerator
.java:403)
at com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.j
ava:178)
at com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator
.java:151)
at com.sun.tools.xjc.model.Model.generateCode(Model.java:228)
at com.sun.tools.xjc.Driver.run(Driver.java:293)
at com.sun.tools.xjc.Driver.run(Driver.java:170)
at com.sun.tools.xjc.Driver._main(Driver.java:95)
at com.sun.tools.xjc.Driver.access$000(Driver.java:53)
at com.sun.tools.xjc.Driver$1.run(Driver.java:75)

One more thing I'm using jdk6 where already an xjc compiler is there.I don't want to use that.

well ... as JamesCherrill suggested: READ the message, don't just copy paste it.

Expected class
javax.xml.bind.annotation.XmlAccessType
but found class
javax.xml.bind.annotation.AccessType

there 's your problem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.