Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JAXB gives me: java.lang.IllegalArgumentException: is parameter must not be null

Tags:

I am doing this using JAXB to unmarshall some XML into Java objects:

My code looks a little like this:

InputStream testMsg = getClass().getResourceAsStream("TestDocumentEvent.xml");
Unmarshaller unmarshaller = JAXBContext.newInstance(DocumentEvent.class).createUnmarshaller();
DocumentEvent unmarshalled = (DocumentEvent) unmarshaller.unmarshal(testMsg);

However, when I run this code I get an exception:

java.lang.IllegalArgumentException: is parameter must not be null

What's going on?

like image 573
SCdF Avatar asked Mar 18 '09 05:03

SCdF


1 Answers

This is because the InputStream you are passing to the unmarshaller ('is' parameter, geddit) is null, check that the resource name is correct.

like image 182
SCdF Avatar answered Sep 21 '22 04:09

SCdF