[activiti6]调用WebService几个坑

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

[activiti6]几个报错解决

运行test webservice

org.activiti.engine.ActivitiException: no default process engine available
	at org.activiti.engine.impl.test.PluggableActivitiTestCase.initializeProcessEngine

先不使用PluggableActivitiTestCase,还是直接用srpingboot的test(原来放在test里不行,放src)。

Item reference is invalid: not found

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': 
FactoryBean threw exception on object creation; nested exception is org.activiti.engine.ActivitiException: Errors while parsing:
[Validation set: 'activiti-executable-process' | Problem: 'activiti-message-invalid-item-ref'] : 
Item reference is invalid: not found - [Extra info : ] ( line: 72, column: 54)

看官网有tns:,直接增加看看:不行。

Caused by: org.xml.sax.SAXParseException; lineNumber: 50; columnNumber: 57; UndeclaredPrefix: 无法将 'tns:createMpcItem' 解析为限定名: 未声明前缀 'tns'。

  • 移动前面定义。也不行。因为xml不区分这个。
  • 看源代码!MessageValidator.java
  • 意思是bpmn文件里,找不到itemRef的定义。
  • itemRef="http://www.activiti.org/test:createMpcItem"也不行。
  • 试试xmlns:tns="http://www.activiti.org/test"
  • 可以了!

Could not find importer for type http://schemas.xmlsoap.org/wsdl/

org.activiti.engine.ActivitiException: Could not find importer for type http://schemas.xmlsoap.org/wsdl/
	at org.activiti.engine.impl.bpmn.behavior.WebServiceActivityBehavior.fillImporterInfo
  • 看源代码fillImporterInfo。
  • 必须写http://schemas.xmlsoap.org/wsdl/,把异常隐藏了,晕。
  • CxfWSDLImporter.java是cxf的,难道没引入jar的缘故???
  • wsdlImporterClass = Class.forName("org.activiti.engine.impl.webservice.CxfWSDLImporter", true, Thread.currentThread().getContextClassLoader());
  • 知道了,是的。
  • activiti-cxf,maven库里是unknown,要指定版本!
  • 解决了!!!我的天,搞了一下午。

转载于:https://my.oschina.net/u/2464371/blog/3024324

你可能感兴趣的:([activiti6]调用WebService几个坑)