关于org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘process‘ 开头的无效内容...解决方法

org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 'process' 开头的无效内容。应以 '{"http://www.omg.org/spec/BPMN/20100524/MODEL":import, "http://www.omg.org/spec/BPMN/20100524/MODEL":extension, "http://www.omg.org/spec/BPMN/20100524/MODEL":rootElement, "http://www.omg.org/spec/BPMN/20100524/DI":BPMNDiagram, "http://www.omg.org/spec/BPMN/20100524/MODEL":relationship}' 之一开头。

	at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:280)
	at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:148)
	at org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder.createBpmnParseFromResource(ParsedDeploymentBuilder.java:96)
	at org.activiti.engine.impl.bpmn.deployer.ParsedDeploymentBuilder.build(ParsedDeploymentBuilder.java:55)
	at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:66)
	at org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:58)
	at org.activiti.engine.impl.cmd.DeployCmd.executeDeploy(DeployCmd.java:97)
	at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:47)
	at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:37)
	at org.activiti.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:37)
	at .
.....................................省略

方案一:在部署流程时调用disableSchemaValidation()方法,禁止校验文件就可以了

 Deployment deploy = repositoryService.createDeployment()
                .addClasspathResource("bpmn/leaveProcess2.bpmn")
                .name("报销流程")
                .disableSchemaValidation()//禁止校验文件
                .deploy();

方案二:找到要部署的bpmn文件,用notepad++打开,或者转为xml文件,把标签中的xmlns=" "删掉,这个可能是插件和Idea不兼容的问题导致


关于org.activiti.bpmn.exceptions.XMLException: cvc-complex-type.2.4.a: 发现了以元素 ‘process‘ 开头的无效内容...解决方法_第1张图片

你可能感兴趣的:(intellij-idea)