<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Process Variables made by Java cannot be deserialized
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/GerardoNS">Gerardo Navarro Suarez</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/538599#538599">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi All,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I have problems understanding why this little process doesn't work. Especially why the variable cannot be deserialized.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'm using jBoss-5.0.0.GA and jBPM-4.3.</p><p><span style="text-decoration: underline;">But first of all the process:</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;"><?xml version="1.0" encoding="UTF-8"?></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;"><span><process name="TaskformTest" xmlns="</span><a class="jive-link-external-small" href="http://jbpm.org/4.3/jpdl" target="_blank">http://jbpm.org/4.3/jpdl</a><span>"></span></p><p style="padding-left: 30px;">    <start g="72,104,48,48" name="start"></p><p style="padding-left: 30px;">        <transition to="Setting Variable" /></p><p style="padding-left: 30px;">    </start></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">    <java class="de.hpi.pois.firsttest.Application" g="151,102,92,52"</p><p style="padding-left: 30px;">        method="createApplication" name="Setting Variable" var="application"></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">        <arg></p><p style="padding-left: 30px;"><span>            <string value="Gerardo,</span><a class="jive-link-email-small" href="mailto:g@hpi.cu" target="_blank">g@hpi.cu</a><span>" /></span></p><p style="padding-left: 30px;">        </arg></p><p style="padding-left: 30px;">        <transition to="Taskform" /></p><p style="padding-left: 30px;">    </java></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">    <task candidate-users="alex" form="de/hpi/pois/firsttest/taskformTest.ftl"</p><p style="padding-left: 30px;">        g="249,160,92,52" name="Taskform"></p><p style="padding-left: 30px;">        <transition to="wait" /></p><p style="padding-left: 30px;">    </task></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">    <state g="362,94,92,52" name="wait"></p><p style="padding-left: 30px;">        <transition to="end" /></p><p style="padding-left: 30px;">    </state></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">    <end g="507,101,48,48" name="end" /></p><p style="padding-left: 30px;"></process></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="text-decoration: underline;">The class looks like this:</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">package de.hpi.pois.firsttest;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">import java.io.Serializable;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">public class Application implements Serializable<br/>{<br/>    private static final long serialVersionUID = 1L;<br/>    <br/>    public String name;<br/>    public String email; <br/>    <br/>    public Application(){}<br/>    <br/>    public Application(String name, String email)<br/>    {<br/>        setName(name);<br/>        setEmail(email);<br/>    }<br/>    <br/>    public static Application createApplication(String entry)<br/>    {<br/>        String[] entryElements = entry.split(",");<br/>        <br/>        return new Application(entryElements[0], entryElements[1]);<br/>    }<br/>    <br/>    public void setName(String name) {<br/>        this.name = name;<br/>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">    public String getName() {<br/>        return name;</p><p style="padding-left: 30px;">    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">    public void setEmail(String email) {<br/>        this.email = email;<br/>    }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">    public String getEmail() {<br/>        return email;<br/>    }<br/>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="text-decoration: underline;">the taskformTest.flt looks like this:</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;"><html><br/>  <head><br/>    <style type="text/css">   <br/>     ${CSS!".body {font-family:sans-serif;}"}<br/>    </style><br/>  </head><br/>  <body><br/>    <br/>    <form action="${form.action}" method="POST" enctype="multipart/form-data"><br/>    <br/>      <h3>Getting the name of the applicant</h3><br/>      <br/>      <br/><br/>      <br/><br/> <br/>      Name of the applicant: ${application.name}<br/>      <br/>      <br/><br/>      <br/><br/> <br/>      <input type="submit" name="done" value="Done"/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="padding-left: 30px;">    </form><br/>  </body><br/></html></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>So what happens?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>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.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h1 style="padding-left: 30px;">HTTP Status 500 -</h1><hr noshade="noshade" size="1" style="padding-left: 30px;"/><p style="padding-left: 30px;"><strong>type</strong> Exception report</p><p style="padding-left: 30px;"><strong>message</strong></p><p style="padding-left: 30px;"><strong>description</strong> <span style="text-decoration: underline;">The server encountered an internal error () that prevented it from fulfilling this request.</span></p><p style="padding-left: 30px;"><strong>exception</strong></p><pre style="padding-left: 30px;">org.jboss.resteasy.spi.UnhandledException: org.jbpm.api.JbpmException: couldn't deserialize object<br/>     org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)<br/>     org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)<br/>     org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)<br/>     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)<br/>     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)<br/>     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)<br/>     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)<br/>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)<br/>     org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)<br/>     org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)<br/></pre><p style="padding-left: 30px;"><strong>root cause</strong></p><pre style="padding-left: 30px;">org.jbpm.api.JbpmException: couldn't deserialize object<br/>     org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter.revert(SerializableToBytesConverter.java:79)<br/>     org.jbpm.pvm.internal.type.Variable.getValue(Variable.java:105)<br/>     org.jbpm.pvm.internal.type.variable.BlobVariable.getValue(BlobVariable.java:61)<br/>     org.jbpm.pvm.internal.model.ScopeInstanceImpl.getVariable(ScopeInstanceImpl.java:192)<br/>     org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:63)<br/>     org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:36)<br/>     org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)<br/>     org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:87)<br/>     org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:66)<br/>     org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)<br/>     org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)<br/>     org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)<br/>     org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)<br/>     org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)<br/>     org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)<br/>     org.jbpm.pvm.internal.svc.ExecutionServiceImpl.getVariables(ExecutionServiceImpl.java:139)<br/>     org.jbpm.integration.console.forms.TaskFormDispatcher.provideForm(TaskFormDispatcher.java:103)<br/>     org.jbpm.integration.console.forms.FormDispatcherComposite.provideForm(FormDispatcherComposite.java:65)<br/>     org.jboss.bpm.console.server.FormProcessingFacade.provideForm(FormProcessingFacade.java:203)<br/>     org.jboss.bpm.console.server.FormProcessingFacade.renderTaskUI(FormProcessingFacade.java:125)<br/>     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br/>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br/>     java.lang.reflect.Method.invoke(Method.java:597)<br/>     org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)<br/>     org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)<br/>     org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)<br/>     org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)<br/>     org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)<br/>     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)<br/>     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)<br/>     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)<br/>     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)<br/>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)<br/>     org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)<br/>     org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)<br/></pre><p style="padding-left: 30px;"><strong>root cause</strong></p><pre style="padding-left: 30px;">java.lang.ClassNotFoundException: de.hpi.pois.firsttest.Application<br/>     java.net.URLClassLoader$1.run(URLClassLoader.java:202)<br/>     java.security.AccessController.doPrivileged(Native Method)<br/>     java.net.URLClassLoader.findClass(URLClassLoader.java:190)<br/>     java.lang.ClassLoader.loadClass(ClassLoader.java:307)<br/>     sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)<br/>     java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br/>     java.lang.Class.forName0(Native Method)<br/>     java.lang.Class.forName(Class.java:247)<br/>     org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:276)<br/>     org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1099)<br/>     org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:735)<br/>     org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:378)<br/>     java.lang.ClassLoader.loadClass(ClassLoader.java:248)<br/>     java.lang.Class.forName0(Native Method)<br/>     java.lang.Class.forName(Class.java:247)<br/>     java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)<br/>     java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)<br/>     java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)<br/>     java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)<br/>     java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)<br/>     java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)<br/>     org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter.revert(SerializableToBytesConverter.java:69)<br/>     org.jbpm.pvm.internal.type.Variable.getValue(Variable.java:105)<br/>     org.jbpm.pvm.internal.type.variable.BlobVariable.getValue(BlobVariable.java:61)<br/>     org.jbpm.pvm.internal.model.ScopeInstanceImpl.getVariable(ScopeInstanceImpl.java:192)<br/>     org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:63)<br/>     org.jbpm.pvm.internal.cmd.GetExecutionVariablesCmd.execute(GetExecutionVariablesCmd.java:36)<br/>     org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42)<br/>     org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.executeInNewTx(JtaTransactionInterceptor.java:87)<br/>     org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:66)<br/>     org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)<br/>     org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithRetry(JtaRetryInterceptor.java:52)<br/>     org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:45)<br/>     org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)<br/>     org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)<br/>     org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)<br/>     org.jbpm.pvm.internal.svc.ExecutionServiceImpl.getVariables(ExecutionServiceImpl.java:139)<br/>     org.jbpm.integration.console.forms.TaskFormDispatcher.provideForm(TaskFormDispatcher.java:103)<br/>     org.jbpm.integration.console.forms.FormDispatcherComposite.provideForm(FormDispatcherComposite.java:65)<br/>     org.jboss.bpm.console.server.FormProcessingFacade.provideForm(FormProcessingFacade.java:203)<br/>     org.jboss.bpm.console.server.FormProcessingFacade.renderTaskUI(FormProcessingFacade.java:125)<br/>     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br/>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br/>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br/>     java.lang.reflect.Method.invoke(Method.java:597)<br/>     org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117)<br/>     org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260)<br/>     org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232)<br/>     org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166)<br/>     org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142)<br/>     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)<br/>     org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)<br/>     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)<br/>     org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)<br/>     javax.servlet.http.HttpServlet.service(HttpServlet.java:803)<br/>     org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)<br/>     org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)<br/></pre><p style="padding-left: 30px;"><strong>note</strong> <span style="text-decoration: underline;">The full stack trace of the root cause is available in the JBoss Web/2.1.1.GA logs.</span></p><hr noshade="noshade" size="1" style="padding-left: 30px;"/><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-size: 10pt;">I hope you got an impression of my problem. What I've done wrong? I would very much appreciate if you could help me.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-size: 10pt;">Greetings,</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-size: 10pt;">Gerardo<br/></span></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/538599#538599">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>