JAXB给我:java.lang.IllegalArgumentException:is参数不得为空
我正在使用JAXB将一些XML解构到Java对象中来执行此操作:
我的代码看起来有点像这样:
InputStream testMsg = getClass().getResourceAsStream("TestDocumentEvent.xml");
Unmarshaller unmarshaller = JAXBContext.newInstance(DocumentEvent.class).createUnmarshaller();
DocumentEvent unmarshalled = (DocumentEvent) unmarshaller.unmarshal(testMsg);
但是,当我运行此代码时,我得到一个异常:
java.lang.IllegalArgumentException: is parameter must not be null
这是怎么回事?