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
InputStreamyou are passing to the unmarshaller (‘is’ parameter, geddit) is null, check that the resource name is correct.