Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

org.jbpm.jpdl.JpdlException: [[FATAL] line 1: Content is not allowed in prolog., [ERROR]  RSS feed

 
ding wei
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
I try to upload processdefinition.xml ,but fail ,i don't know what happen? why ? anaybody tell me thanks!

org.jbpm.jpdl.JpdlException: [[FATAL] line 1: Content is not allowed in prolog., [ERROR] couldn't parse process definition]
java code:
public class WorkFlowAction extends ActionSupport {
private int id;
private String name;
private String processDef;
private String processImage;
// upload processdefinition
public void upload()
throws Exception {
WorkFlowAction workFlowAction = new WorkFlowAction();

if (processDef != null && processDef != null) {
workFlowManager.addOrUpdateWorkflow(processDef.getBytes(),
processImage.getBytes());
}
//workFlowAction.openList();
}


.......

public class WorkFlowDaoImpl extends HibernateDaoSupport implements
IWorkFlowDao {

private JbpmFacade jbpmFacade;

public void addOrUpdateWorkflow(byte[] processDef, byte[] processImage) {

String workflowName = jbpmFacade.deployProcessDefinition(processDef);

//
WorkFlow wf = (WorkFlow) getSession().createQuery(
"select w from WorkFlow w where w.name = ?").setParameter(0,
workflowName).uniqueResult();
if (wf == null) {
wf = new WorkFlow();
wf.setName(workflowName);
wf.setProcessDef(processDef);
wf.setProcessImage(processImage);
getHibernateTemplate().save(wf);
} else {
wf.setProcessDef(processDef);
wf.setProcessImage(processImage);
getHibernateTemplate().update(wf);
}
}

public class JbpmFacadeImpl extends HibernateDaoSupport implements JbpmFacade {

private JbpmConfiguration jbpmConfiguration;

.....

public String deployProcessDefinition(byte[] processDef) {

JbpmContext context = getJbpmContext();

ProcessDefinition def = ProcessDefinition.parseXmlInputStream(
new ByteArrayInputStream(processDef)
);

context.deployProcessDefinition(def);

return def.getName();
}

jsp code:
.....
<s:form action="workflowupload.action" mothod="post" enctype="multipart/form-data">
<s:file name="processDef"></s:file>
<s:file name="processImage"></s:file>
<s:submit value="upload"></s:submit>
</s:form>

......
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!