[jboss-user] [jBPM] - Process Variables made by Java cannot be deserialized

Gerardo Navarro Suarez do-not-reply at jboss.com
Tue Apr 20 18:54:33 EDT 2010


Gerardo Navarro Suarez [http://community.jboss.org/people/GerardoNS] created the discussion

"Process Variables made by Java cannot be deserialized"

To view the discussion, visit: http://community.jboss.org/message/538599#538599

--------------------------------------------------------------
Hi All,

I have problems understanding why this little process doesn't work. Especially why the variable cannot be deserialized.

I'm using jBoss-5.0.0.GA and jBPM-4.3.
But first of all the process:

<?xml version="1.0" encoding="UTF-8"?>

<process name="TaskformTest" xmlns=" http://jbpm.org/4.3/jpdl http://jbpm.org/4.3/jpdl">
    <start g="72,104,48,48" name="start">
        <transition to="Setting Variable" />
    </start>

    <java class="de.hpi.pois.firsttest.Application" g="151,102,92,52"
        method="createApplication" name="Setting Variable" var="application">

        <arg>
            <string value="Gerardo, mailto:g at hpi.cu g at hpi.cu" />
        </arg>
        <transition to="Taskform" />
    </java>

    <task candidate-users="alex" form="de/hpi/pois/firsttest/taskformTest.ftl"
        g="249,160,92,52" name="Taskform">
        <transition to="wait" />
    </task>

    <state g="362,94,92,52" name="wait">
        <transition to="end" />
    </state>

    <end g="507,101,48,48" name="end" />
</process>

The class looks like this:

package de.hpi.pois.firsttest;

import java.io.Serializable;

public class Application implements Serializable
{
    private static final long serialVersionUID = 1L;
    
    public String name;
    public String email; 
    
    public Application(){}
    
    public Application(String name, String email)
    {
        setName(name);
        setEmail(email);
    }
    
    public static Application createApplication(String entry)
    {
        String[] entryElements = entry.split(",");
        
        return new Application(entryElements[0], entryElements[1]);
    }
    
    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail() {
        return email;
    }
}

the taskformTest.flt looks like this:

<html>
  <head>
    <style type="text/css">   
     ${CSS!".body {font-family:sans-serif;}"}
    </style>
  </head>
  <body>
    
    <form action="${form.action}" method="POST" enctype="multipart/form-data">
    
      <h3>Getting the name of the applicant</h3>
      
      <br/>
      <br/>
 
      Name of the applicant: ${application.name}
      
      <br/>
      <br/>
 
      <input type="submit" name="done" value="Done"/>

    </form>
  </body>
</html>

So what happens?

I start a new process instance via jbpm-console. Afterwards I go to alex's Personal Tasks and open the taskform (taskformTest.ftl). Then the following error occurs. I cannot understand why the object application cannot be deserialized, although the class application implements Serializable. In DevGuide it is said that process variables can be used in freemarker as variables, but I don't think the problem lies there. The same error happen when I select the created process instance and then click on Instance Data.

h1. HTTP Status 500 -
----
*type* Exception report
*message*
*description* The server encountered an internal error () that prevented it from fulfilling this request.
*exception*
org.jboss.resteasy.spi.UnhandledException: org.jbpm.api.JbpmException: couldn't deserialize object
     org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
     org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
     org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
     org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

*root cause*
org.jbpm.api.JbpmException: couldn't deserialize object
     org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter.revert(SerializableToBytesConverter.java:79)
     org.jbpm.pvm.internal.type.Variable.getValue(Variable.java:105)
     org.jbpm.pvm.internal.type.variable.BlobVariable.getValue(BlobVariable.java:61)
     org.jbpm.pvm.internal.model.ScopeInstanceImpl.getVariable(ScopeInstanceImpl.java:192)
     org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:63)
     org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:36)
     org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
     org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:87)
     org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:66)
     org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
     org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)
     org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)
     org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
     org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
     org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
     org.jbpm.pvm.internal.svc.ExecutionServiceImpl.getVariables(ExecutionServiceImpl.java:139)
     org.jbpm.integration.console.forms.TaskFormDispatcher.provideForm(TaskFormDispatcher.java:103)
     org.jbpm.integration.console.forms.FormDispatcherComposite.provideForm(FormDispatcherComposite.java:65)
     org.jboss.bpm.console.server.FormProcessingFacade.provideForm(FormProcessingFacade.java:203)
     org.jboss.bpm.console.server.FormProcessingFacade.renderTaskUI(FormProcessingFacade.java:125)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     java.lang.reflect.Method.invoke(Method.java:597)
     org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
     org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
     org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
     org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
     org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
     org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

*root cause*
java.lang.ClassNotFoundException: de.hpi.pois.firsttest.Application
     java.net.URLClassLoader$1.run(URLClassLoader.java:202)
     java.security.AccessController.doPrivileged(Native Method)
     java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     java.lang.ClassLoader.loadClass(ClassLoader.java:307)
     sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
     java.lang.ClassLoader.loadClass(ClassLoader.java:248)
     java.lang.Class.forName0(Native Method)
     java.lang.Class.forName(Class.java:247)
     org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:276)
     org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1099)
     org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:735)
     org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:378)
     java.lang.ClassLoader.loadClass(ClassLoader.java:248)
     java.lang.Class.forName0(Native Method)
     java.lang.Class.forName(Class.java:247)
     java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)
     java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
     java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
     java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
     java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
     java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
     org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter.revert(SerializableToBytesConverter.java:69)
     org.jbpm.pvm.internal.type.Variable.getValue(Variable.java:105)
     org.jbpm.pvm.internal.type.variable.BlobVariable.getValue(BlobVariable.java:61)
     org.jbpm.pvm.internal.model.ScopeInstanceImpl.getVariable(ScopeInstanceImpl.java:192)
     org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:63)
     org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:36)
     org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)
     org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:87)
     org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:66)
     org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
     org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)
     org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)
     org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)
     org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)
     org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)
     org.jbpm.pvm.internal.svc.ExecutionServiceImpl.getVariables(ExecutionServiceImpl.java:139)
     org.jbpm.integration.console.forms.TaskFormDispatcher.provideForm(TaskFormDispatcher.java:103)
     org.jbpm.integration.console.forms.FormDispatcherComposite.provideForm(FormDispatcherComposite.java:65)
     org.jboss.bpm.console.server.FormProcessingFacade.provideForm(FormProcessingFacade.java:203)
     org.jboss.bpm.console.server.FormProcessingFacade.renderTaskUI(FormProcessingFacade.java:125)
     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     java.lang.reflect.Method.invoke(Method.java:597)
     org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)
     org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)
     org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)
     org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)
     org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)
     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
     org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
     org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

*note* The full stack trace of the root cause is available in the JBoss Web/2.1.1.GA logs.
----

I hope you got an impression of my problem. What I've done wrong? I would very much appreciate if you could help me.

Greetings,

Gerardo


--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/538599#538599]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100420/552539c0/attachment.html 


More information about the jboss-user mailing list