私はアンマーシャルメソッドを持っています:
public static Object unmarshalXmlTo0100(String xmlMsg, String destination, String resource) throws Exception {
//init unmarshaller
ByteArrayInputStream input = new ByteArrayInputStream(xmlMsg.getBytes());
JAXBContext context = JAXBContext.newInstance(destination);
Unmarshaller unmarshaller = context.createUnmarshaller();
//init schema
SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
Schema schema = schemaFactory.newSchema(XmlParser.class.getClassLoader().getResource(resource));
unmarshaller.setSchema(schema);
//unmarschal
Object data = unmarshaller.unmarshal(input);
//return message
return data;
}
何らかの理由で、以下を使用してメソッドを呼び出すと、次のようになります。
processDataObj = MainXMLParser.unmarshalXmlTo0100(processData, "cp.jaxb.planningBericht.classes", "source/xml/cp_md_format_planningBericht.xsd");
すべてうまくいきます。
しかし、私が以下を使用するとき:
processDataObj = MainXMLParser.unmarshalXmlTo0100(processData, "cp.jaxb.beschikbaarheidBericht.classes", "source/xml/cp_md_format_beschikbaarheidBericht.xsd");
unmarshallerは何も返しませんが、実行を継続するため、proccesDataObjは空です...
何が悪いのかわかりません...