pzaprianov
asked on
JAXB error "doesnt contain ObjectFactory.class or jaxb.index"
Hi all,
I've got javax.xml.bind.JAXBExcepti on: "jaxb.Foo" doesnt contain ObjectFactory.class or jaxb.index
I am trying to do an unmarshall with JaxB, I have the following:
Any idea?
I've got javax.xml.bind.JAXBExcepti
I am trying to do an unmarshall with JaxB, I have the following:
Any idea?
class Foo {
@XmlElement
String a;
@XmlElement(required=true)
String b;
@XmlElement
String c;
}
-------------------------------------------------------
myJaxb.java
-------------------------------------------------------
JAXBContext jc = JAXBContext.newInstance( "jaxb.Foo" );
Unmarshaller u = jc.createUnmarshaller();
Foo fooObj = (Foo)u.unmarshal(
new FileInputStream( "foo.xml" ) );
---------------------------------------
foo.xml
----------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<Foo>
<a>1</a>
<b>2</b>
<c>3</c>
</Foo>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER