cancel
Showing results for 
Search instead for 
Did you mean: 

can not deserialize my POJO object

jaiwo99
Champ in-the-making
Champ in-the-making
Hello *,

does anybody also had this problem before, i put my object in the process, when i tried to get this object again, i got this exception. please help me with this.. thanks.

Greetins, James


org.activiti.engine.ActivitiException: coudn't deserialize object in variable 'myPojo'
   at org.activiti.engine.impl.variable.SerializableType.getValue(SerializableType.java:60)
   at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.getValue(VariableInstanceEntity.java:158)
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:84)
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:81)
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:81)
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:81)
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.getVariables(VariableScopeImpl.java:65)
   at org.activiti.engine.impl.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:58)
   at org.activiti.engine.impl.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:28)
   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.RuntimeServiceImpl.getVariables(RuntimeServiceImpl.java:81)
   at
   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.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:212)
   at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:66)
   at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
   at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:181)
   at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:172)
   at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:146)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.example.data.myPojo
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at java.io.ObjectInputStream.resolveClass(Unknown Source)
   at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
   at java.io.ObjectInputStream.readClassDesc(Unknown Source)
   at java.io.ObjectInputStream.readArray(Unknown Source)
   at java.io.ObjectInputStream.readObject0(Unknown Source)
   at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
   at java.io.ObjectInputStream.readSerialData(Unknown Source)
   at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
   at java.io.ObjectInputStream.readObject0(Unknown Source)
   at java.io.ObjectInputStream.readObject(Unknown Source)
   at org.activiti.engine.impl.variable.SerializableType.getValue(SerializableType.java:49)
   … 37 more
2 REPLIES 2

trademak
Star Contributor
Star Contributor
Hi,

Did you implement the Serializable interface?
Is the class available on the classpath?

Best regards,

jaiwo99
Champ in-the-making
Champ in-the-making
Hi Tijs,

thx for the reply, i did implement the java.io.serializable interface, and the class is for sure available on the classpath.

here is what i tried to do..

i used multi-instance for a subprocess, so there is a collection List<myPojo> for the sub process and myPojo for each instance, in each instance myPojo.getter works fine, but if i use myPojo.setter(value), the value cannot be load later in this subprocess, and the exception tells me also that the pojo can't be deserialized.

other question: a task in a multi-instance subprocess, if i do :

executionId = getTaskService().createTaskQuery().taskId(task.getId).getExecutionId();
Execution execution = getRuntimeService().createExecutionQuery().executionId(executionId).singleResult();
the execution should be the execution of main process or execution of an instance of the subprocess?

Greeting, James