AnsweredAssumed Answered

activiti-osgi classloader issue

Question asked by workflowuser2 on Jul 17, 2012
Latest reply on Oct 6, 2013 by rahulkrs

I have two bundles :
activiti-osgi-karaf: configures and starts process engine (depends on activiti-osgi)
activiti-osgi-process: contains process.bpmn20.xml, java delegates, process-request bean

reference: activiti-in-action book. java delegates are binded into osgi container as service

process-request bean is a java bean I pass into process variables map:
Map<String, Object> params = new HashMap<String, Object>();
params.put("request", new ProcessRequestBean());
            "process", params);

Now, when I try to access ProcessRequestBean into a java delegate:

ProcessRequestBean testPayload = (ProcessRequestBean) execution.getVariable("request");

The above works for service tasks.
However, if I put activiti:async="true" in the service task definition, I get the following exception:

Exception in thread "pool-13-thread-3" org.activiti.engine.ActivitiException: coudn't deserialize object in variable 'request'
   at org.activiti.engine.impl.variable.SerializableType.getValue(
   at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.getValue(
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.getVariable(
   at com.acme.workflow.delegates.MyDelegate.execute(
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(
   at java.lang.reflect.Method.invoke(
   at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(
   at org.apache.aries.proxy.impl.DefaultWrapper.invoke(
   at org.apache.aries.proxy.impl.ProxyHandler.invoke(
   at $Proxy67.execute(Unknown Source)

It appears to be classpath/loader issue. In the osgi env, I believe that both engine and process bundles class loaders should be available.

Any help is greatly appreciated.
Activiti newbie