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?
This is because the InputStream
you are passing to the unmarshaller ('is' parameter, geddit) is null, check that the resource name is correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With