null Nested exception: null

(44480 ms) [http-80-12] ERROR: org.jbpm.jpdl.xml.JpdlXmlReader#readProcessDefinition : couldn't parse process definition org.dom4j.DocumentException: null Nested exception: null

原来使用的是ProcessDefinition pDef = ProcessDefinition.parseXmlResource(xmlPath),
系 统就抱这个错,后来将parseXmlResource改成parseXmlString,将xml的内容读出来存在字符串中xml,这个错误居然解决 了。
ProcessDefinition pDef = ProcessDefinition.parseXmlString(xml);

其实,这两个方法在windows下面都没有问题,但是在linux环境下 parseXmlResource就不好使,具体的也不知道什么原因。

如果你 的xml中有中文的话,可能会报错,当时流程部署应该是没有错误的。
此时,你读取xml文件 时,可能要指定字符编码,如UTF-8。
BufferedReader input = new BufferedReader(new InputStreamReader(new FileInputStream(path),"UTF-8"));

原来这样的代码也会导致上述错误,Element root = DocumentHelper.parseText(new String(gpdBytes)).getRootElement();

应为我的gpd.xml中有中文,所以代码应该改成
Element root = DocumentHelper.parseText(new String(gpdBytes,"GBK")).getRootElement(); 

原文地址:https://www.cnblogs.com/liuzhengdao/p/1658552.html