问题
I have made Ruta scripts run from Java and have converted the resulting CAS object into an xmi file as below;
FileOutputStream fileOutputStream = new FileOutputStream(outputXmiFile);
XmiCasSerializer.serialize(cas, fileOutputStream);
When I try to convert it back into a CAS object (on another server), as below;
FileInputStream fileInputStream = new FileInputStream(xmiFile);
XmlCasDeserializer.deserialize(fileInputStream, cas);
I get the below exception;
XCASParsingException: Error parsing XCAS or XMI-CAS from source <unknown> at line <unknown>, column <unknown>: unknown type: NULL.
A snapshot of the exception.
回答1:
Ya Thanks ! It worked !
import org.apache.uima.util.CasIOUtils;
CAS to XMI
CasIOUtils.save(cas, fileOutputStream, SerialFormat.XMI);
XMI to CAS
CasIOUtils.load(fileInputStream, cas);
来源:https://stackoverflow.com/questions/47653768/xcasparsingexception-while-trying-to-deserialize-xmi-into-cas-object