[JAXB] Génération des classes Java à partir d'un schéma
Bonjour,
Je dispose d'un schéma xsd et je dois réaliser un mapping avec du java. Je souhaiterai générer les classes avec l'outil xjc.
Lorsque j'exécute le programme, j'ai le message d'erreur suivant :
Citation:
analyse dun schÚma...
classLoader = java.net.URLClassLoader@c17164
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@8e32e7
Exception in thread "main" java.lang.AssertionError: javax.xml.bind.JAXBExceptio
n
- with linked exception:
[com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of I
llegalAnnotationExceptions
com.sun.xml.bind.api.impl.NameConverter is an interface, and JAXB can't handle i
nterfaces.
this problem is related to the following location:
at com.sun.xml.bind.api.impl.NameConverter
at public com.sun.xml.bind.api.impl.NameConverter com.sun.tools.
xjc.reader.xmlschema.bindinfo.BIGlobalBinding.nameConverter
at com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding
com.sun.xml.bind.api.impl.NameConverter does not have a no-arg default construct
or.
this problem is related to the following location:
at com.sun.xml.bind.api.impl.NameConverter
at public com.sun.xml.bind.api.impl.NameConverter com.sun.tools.
xjc.reader.xmlschema.bindinfo.BIGlobalBinding.nameConverter
at com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding
]
at com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getCustomization
Context(BindInfo.java:356)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.BindInfo.getCustomization
Unmarshaller(BindInfo.java:362)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserFactoryIm
pl$1.<init>(AnnotationParserFactoryImpl.java:85)
at com.sun.tools.xjc.reader.xmlschema.bindinfo.AnnotationParserFactoryIm
pl.create(AnnotationParserFactoryImpl.java:84)
at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.createAnnotationParser(NGC
CRuntimeEx.java:365)
at com.sun.xml.xsom.impl.parser.state.annotation.action0(annotation.java
:88)
Version du jdk : 1.6.0_14
Version de xjc : 2.2.7
plateforme Window 7.
commande exécutée :
Citation:
java -jar jaxb-xjc.jar -d generated C:\Donnees\test.xsd
Suite à des recherches je n'ai pas trouvé comment résoudre cette exception ? L'avez vous déjà vu et savez-vous la corriger ?
Je vous remercie par avance de votre aide.