[英]JAXB gives me: java.lang.IllegalArgumentException: is parameter must not be null
I am doing this using JAXB to unmarshall some XML into Java objects: 我这样做是使用JAXB将一些XML解组为Java对象:
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? 这是怎么回事?
这是因为传递给unmarshaller('is'参数,geddit)的InputStream
为null,请检查资源名称是否正确。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.