Import definition type fails with CxfWSDLImporter when using complex data types

Description

Hello,

Tried to create a process that call a WebService using activiti-cxf.
My WSDL contains complex structured types, so CXF will generate custom classes for request / response fields causing type import to fails with ActivitiClassLoadingException :
30 nov. 2012 08:06:01 org.activiti.engine.impl.bpmn.parser.BpmnParse execute
GRAVE: Unknown exception
org.activiti.engine.ActivitiClassLoadingException: Class not found: fr.urssaf.adelaide.CompositionResult
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:81)
at org.activiti.engine.impl.webservice.CxfWSDLImporter.importStructure(CxfWSDLImporter.java:159)
at org.activiti.engine.impl.webservice.CxfWSDLImporter.importTypes(CxfWSDLImporter.java:146)
at org.activiti.engine.impl.webservice.CxfWSDLImporter.importFrom(CxfWSDLImporter.java:106)
at org.activiti.engine.impl.webservice.CxfWSDLImporter.importFrom(CxfWSDLImporter.java:69)
at org.activiti.engine.impl.bpmn.parser.BpmnParse.parseImports(BpmnParse.java:326)
at org.activiti.engine.impl.bpmn.parser.BpmnParse.parseRootElement(BpmnParse.java:250)
at org.activiti.engine.impl.bpmn.parser.BpmnParse.execute(BpmnParse.java:228)
at org.activiti.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:90)
at org.activiti.engine.impl.persistence.deploy.DeploymentCache.deploy(DeploymentCache.java:38)
at org.activiti.engine.impl.persistence.entity.DeploymentManager.insertDeployment(DeploymentManager.java:42)
at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:59)
at org.activiti.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:31)
at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:54)
at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:106)
at fr.cirso.pac.poc.activiti.ProDocs.main(ProDocs.java:55)
Caused by: java.lang.ClassNotFoundException: fr.urssaf.adelaide.CompositionResult
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.activiti.engine.impl.util.ReflectUtil.loadClass(ReflectUtil.java:62)
... 18 more

A found a very simple workaround consisting in an early built of a DynamicClient for the imported WSDL (see joined patch). This behavior will dynamically generate and load missing classes causing the rest of the import code to run normally without any error.

Do you think that this simple fix could be integrated in activiti-cxf module ?

Regards.

Environment

Standalone JVM

Assignee

Frederik Heremans

Reporter

Fabien KOCIK

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure