Unable to load an XML for jaxb-ing

Sipayi

Usenet Archive
Joined
Sep 23, 2004
Messages
6
Reaction score
0
'lo!

Trying to use JAXB for my project. I did the following steps:
a. Created xml/xsd/xjb, placed it under "com.foo.blah"
b. xjc'd the xmls into "com.foo.blah.jaxb"
c. Tried to unmarshal:
--
1. JAXBContext jc = JAXBContext.newInstance("com.foo.blah.jaxb");
2. Unmarshaller um = jc.createUnmarshaller;
3. Object xmlData = unmarshaller.unmarshal(com.foo.blah.SomeClass.class.getResourceAsStream("abc.xml"));
 

Sipayi

Usenet Archive
Joined
Sep 23, 2004
Messages
6
Reaction score
0
Well, specifying the complete path picks up the classes... Object xmlData = unmarshaller.unmarshal(com.foo.blah.SomeClass.class.getResourceAsStream("/com/foo/blah/jaxb/abc.xml"));

-Siplin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,798
Members
249,594
Latest member
henrywalsh

Latest Threads

Top