Spring整合activiti-modeler5.16遇到的小问题

简介: <p><strong>接上一篇整合activiti-modeler并成功创建model:<a target="_blank" href="http://blog.csdn.net/tuzongxun/article/details/50787822">Spring整合activiti-modeler5.16</a>   之后,我尝试运用自定义的model部署流程,但是在部署的过程中又遇到了

接上一篇整合activiti-modeler并成功创建model:Spring整合activiti-modeler5.16   之后,我尝试运用自定义的model部署流程,但是在部署的过程中又遇到了一些问题,控制台一直报如下错误:

log4j:WARN No appenders could be found for logger (org.springframework.test.context.junit4.SpringJUnit4ClassRunner).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.activiti.engine.ActivitiException: Error parsing XML
	at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:236)
	at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:112)
	at org.activiti.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:50)
	at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:103)
	at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:37)
	at org.activiti.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:24)
	at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:57)
	at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
	at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
	at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
	at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:37)
	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
	at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
	at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:78)
	at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:156)
	at activitiTest1.ActTest.deployeTest(ActTest.java:53)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
	at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
	at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
	at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.RuntimeException: Could not validate XML with BPMN 2.0 XSD
	at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:262)
	at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:185)
	... 43 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 19; columnNumber: 25; cvc-complex-type.2.4.b: 元素 'bpmndi:BPMNEdge' 的内容不完整。应为 '{"http://www.omg.org/spec/DD/20100524/DI":waypoint}' 之一。
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidComplexType(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.elementLocallyValidType(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processElementContent(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleEndElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.validation.StreamValidatorHelper.validate(Unknown Source)
	at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(Unknown Source)
	at javax.xml.validation.Validator.validate(Unknown Source)
	at org.activiti.bpmn.converter.BpmnXMLConverter.validateModel(BpmnXMLConverter.java:196)
	at org.activiti.bpmn.converter.BpmnXMLConverter.convertToBpmnModel(BpmnXMLConverter.java:251)
	... 44 more


一开始,我以为是代码的问题,但是检查了很久之后实在是看不出什么问题,流程部署代码如下:

@Autowired
	private RepositoryService repositoryService;

	/**
	 * 部署流程定义
	 * 
	 * @author:tuzongxun
	 * @Title: deployeTest
	 * @param
	 * @return void
	 * @date Mar 16, 2016 11:16:37 AM
	 * @throws
	 */
	@Test
	public void deployeTest() {
		String modelId = "40001";
		try {
			Model modelData = repositoryService.getModel(modelId);
			ObjectNode modelNode = (ObjectNode) new ObjectMapper()
					.readTree(repositoryService.getModelEditorSource(modelData
							.getId()));
			byte[] bpmnBytes = null;
			BpmnModel model = new BpmnJsonConverter()
					.convertToBpmnModel(modelNode);
			bpmnBytes = new BpmnXMLConverter().convertToXML(model);
			String processName = modelData.getName() + ".bpmn20.xml";
			Deployment deployment = repositoryService.createDeployment()
					.name(modelData.getName())
					.addString(processName, new String(bpmnBytes)).deploy();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}


当确定代码没有问题之后,又把原因锁定到了jar包上。但是换了很多包之后依旧没能解决问题,于是只好从头到尾重新再搭一遍环境,结果竟然成功。
无奈之中,我只好把两次的所有文件对比了一遍,终于找出了问题,原来竟然是我改动了stencilset.json这个文件,把其中的部分英文改成了中文。

至此,自定义流程的第二步,流程定义的部署也成功实现,自己坑了自己一把。

目录
相关文章
|
Java Spring 数据格式
activiti自定义流程之Spring整合activiti-modeler5.16实例(七):任务列表展示
<span style="font-family:Arial; font-size:14px; line-height:26px"></span><span style="font-family:Arial; font-size:14px; line-height:26px">注:(1)环境搭建:<a target="_blank" href="http://blog.csdn.net/t
1621 0
|
Java Spring 数据格式
activiti自定义流程之Spring整合activiti-modeler5.16实例(八):完成个人任务
<span style="font-family:Arial; font-size:14px; line-height:26px"></span><span style="font-family:Arial; font-size:14px; line-height:26px">注:(1)环境搭建:<a target="_blank" href="http://blog.csdn.net/t
2391 0
|
Java Spring 数据格式
activiti自定义流程之Spring整合activiti-modeler5.16实例(九):历史任务查询
<span style="font-family:Arial; font-size:14px; line-height:26px">注:(1)环境搭建:<a target="_blank" href="http://blog.csdn.net/tuzongxun/article/details/50787822">activiti自定义流程之Spring整合activiti-modeler
1572 0
|
Java 数据格式 Spring
activiti自定义流程之Spring整合activiti-modeler5.16实例(六):启动流程
<span style="font-family:Arial; font-size:14px; line-height:26px">注:(1)环境搭建:<a target="_blank" href="http://blog.csdn.net/tuzongxun/article/details/50787822" style="color:rgb(255,153,0); text-deco
2815 0
|
Java Spring
activiti自定义流程之Spring整合activiti-modeler5.16实例(四):部署流程定义
<span style="font-family:Arial; font-size:14px; line-height:26px">注:(1)环境搭建:<a target="_blank" href="http://blog.csdn.net/tuzongxun/article/details/50787822" style="color:rgb(255,153,0); text-deco
1842 0
|
Java Spring
activiti自定义流程之Spring整合activiti-modeler5.16实例(五):流程定义列表
<span style="font-family:Arial; font-size:14px; line-height:26px">注:(1)环境搭建:<a target="_blank" href="http://blog.csdn.net/tuzongxun/article/details/50787822" style="color:rgb(255,153,0); text-deco
1562 0
|
JavaScript Java Spring
activiti自定义流程之Spring整合activiti-modeler5.16实例(三):流程模型列表展示
<span style="font-family:Arial; font-size:14px; line-height:26px">注:(1)环境搭建:<a target="_blank" href="http://blog.csdn.net/tuzongxun/article/details/50787822" style="color:rgb(255,153,0); text-deco
3224 0
|
XML 前端开发 Java
activiti自定义流程之Spring整合activiti-modeler5.16实例(二):创建流程模型
<p><span style="font-family:Arial; font-size:14px; line-height:26px">注:(1)环境搭建:<a target="_blank" href="http://blog.csdn.net/tuzongxun/article/details/50787822" style="color:rgb(255,153,0); text-d
2543 0
|
3月前
|
SQL 监控 druid
springboot-druid数据源的配置方式及配置后台监控-自定义和导入stater(推荐-简单方便使用)两种方式配置druid数据源
这篇文章介绍了如何在Spring Boot项目中配置和监控Druid数据源,包括自定义配置和使用Spring Boot Starter两种方法。
|
2月前
|
人工智能 自然语言处理 前端开发
SpringBoot + 通义千问 + 自定义React组件:支持EventStream数据解析的技术实践
【10月更文挑战第7天】在现代Web开发中,集成多种技术栈以实现复杂的功能需求已成为常态。本文将详细介绍如何使用SpringBoot作为后端框架,结合阿里巴巴的通义千问(一个强大的自然语言处理服务),并通过自定义React组件来支持服务器发送事件(SSE, Server-Sent Events)的EventStream数据解析。这一组合不仅能够实现高效的实时通信,还能利用AI技术提升用户体验。
183 2