[activiti6]调用WebService几个坑

博客主要围绕Activiti6的几个报错展开解决。包括运行test webservice时的处理,将测试从test移到src;针对'Item reference is invalid: not found'报错,通过添加xmlns:tns解决;对于'Could not find importer for type http://schemas.xmlsoap.org/wsdl/'报错,发现是未引入jar及需指定activiti - cxf版本的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[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'。

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值