Salut à tous, mon JAVA_HOME pointe sur un jdk 6 donc j'utilise le JAXB embarqué:
lorsque je lance le code suivant:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
import javax.xml.bind.*;
import javax.xml.bind.annotation.*;
@XmlAccessorType( XmlAccessType.FIELD )
@XmlRootElement
class Point {
int x;
int y;
Point(int _x,int _y) {x=_x;y=_y;}
}
JAXBContext context = JAXBContext.newInstance(Point.class);
Marshaller m = context.createMarshaller();
m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
StringWriter writer = new StringWriter();
m.marshal( new Point(3,5), writer);
println writer |
j'ai cette exception:
java.lang.NoClassDefFoundError: Could not initialize class com.sun.xml.internal.bind.DatatypeConverterImpl
J'ai cherché un peu et j'ai l'impression qu'il y a un problème de mélange de classes JAXB pourtant je n'ai rien dans le classPath.
merci
Partager