14 Replies Latest reply on Apr 5, 2013 9:13 AM by TC ONG

    java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper

    TC ONG Newbie

                     String respond = "SOME_VALUE";

                Map result = new HashMap();           result.put("answer", respond);           ContentData contentData = null;           ByteArrayOutputStream bos = new ByteArrayOutputStream();           ObjectOutputStream out;           try {                out = new ObjectOutputStream(bos);                out.writeObject(result);                out.close();                contentData = new ContentData();                contentData.setContent(bos.toByteArray());                contentData.setAccessType(AccessType.Inline);           } catch (IOException ioe) {                ioe.printStackTrace();           }                      localTaskService.complete(taskId, userName, contentData);

      My process has a sequence of human tasks.

      When I ran the code above, the first task executed fine, but the second task gives me:

           java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper

      Any idea why it suddently doesn't work?

      Full stack trace:

      Application Message - java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper 
       java.lang.ClassCastException: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
           at org.jbpm.task.utils.ContentMarshallerHelper.unmarshall(ContentMarshallerHelper.java:157)
           at org.jbpm.process.workitem.wsht.SyncWSHumanTaskHandler$TaskCompletedHandler.handleCompletedTask(SyncWSHumanTaskHandler.java:354)
           at org.jbpm.process.workitem.wsht.SyncWSHumanTaskHandler$TaskCompletedHandler.execute(SyncWSHumanTaskHandler.java:329)
           at org.jbpm.task.service.local.LocalTaskService$SimpleEventTransport.trigger(LocalTaskService.java:307)
           at org.jbpm.task.event.MessagingTaskEventListener.taskCompleted(MessagingTaskEventListener.java:73)
           at org.jbpm.task.event.TaskEventSupport.fireTaskCompleted(TaskEventSupport.java:46)
           at org.jbpm.task.service.TaskServiceSession.postTaskCompleteOperation(TaskServiceSession.java:502)
           at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:468)
           at org.jbpm.task.service.local.LocalTaskService.complete(LocalTaskService.java:80)
        • 1. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
          TC ONG Newbie

          I see the code changes in ContentMarshallerHelper.java from GitHub. Please tell me this is some kind of bug that already been fixed in latest code so that I can rest in peace...

          • 2. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
            Mauricio Salatino Master

            This is already solved in master. and now you don't need to do all that stuff.. just send the object that you have as results that usually will be a Map.

             

            Can you take a look at the method called completeWithResults? Can you test with the latest snapshots to see that it's working?

            Cheers

            • 4. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
              TC ONG Newbie

              Yes. I thought that would be the case. I did notice the completeWithResults method. But no time to test it today. Will also try the snapshots as well next week.

              • 5. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                Mauricio Salatino Master

                The snapshots will work perfectly.. from now we want the user to avoid doing stuff like:

                ByteArrayOutputStream bos = new ByteArrayOutputStream();           ObjectOutputStream out;           try {                out = new ObjectOutputStream(bos);                out.writeObject(result);                out.close();

                So if you find yourself doing that and you don't find any other simple way just let us know and we will fix it.

                Cheers


                • 6. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                  TC ONG Newbie

                  I tried the completeWithResults in Drools 5.4 and it is not working. Because I'm not using maven in my project, so I did not try the snapshot. (lazy)

                  Any idea when the next release will be?

                  • 7. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                    Jiri Svitak Novice

                    Hello, I have experienced the same problem "java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper" in jBPM version 5.3.0-SNAPSHOT. That happened in my application which uses jBPM, so it was on client side. I have switched to 5.4.0-SNAPSHOT, but now I experience a different exception. I use HornetQHTWorkItemHandler in my application. My business process contains just a simple human task in which I want to receive just one String value. In jbpm-console I can see my task waiting to be finished. I view it, fill my String value and after I confirm it, my application hangs (no exceptions) and I see the exception below in server.log:

                    16:10:28,984 WARNING [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (hornetq-failure-check-thread) Connection failure has been detected: Did not receive data from /127.0.0.1:44514. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3]
                    16:10:28,984 WARNING [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Client connection failed, clearing up resources for session 08d8f96b-c12a-11e1-9037-f0def167dbd3
                    16:10:28,990 WARNING [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Cleared up resources for session 08d8f96b-c12a-11e1-9037-f0def167dbd3
                    16:10:44,991 WARNING [org.hornetq.core.protocol.core.impl.RemotingConnectionImpl] (hornetq-failure-check-thread) Connection failure has been detected: Did not receive data from /127.0.0.1:44222. It is likely the client has exited or crashed without closing its connection, or the network between the server and client has failed. You also might have configured connection-ttl and client-failure-check-period incorrectly. Please check user manual for more information. The connection will now be closed. [code=3]
                    16:10:44,992 WARNING [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Client connection failed, clearing up resources for session 4d2c6ab8-c126-11e1-9037-f0def167dbd3
                    16:10:44,992 WARNING [org.hornetq.core.server.impl.ServerSessionImpl] (hornetq-failure-check-thread) Cleared up resources for session 4d2c6ab8-c126-11e1-9037-f0def167dbd3
                    16:11:54,041 INFO  [stdout] (http-localhost-127.0.0.1-8080-3) INFO  28-06 16:11:54,041 (DemoAuthenticator.java:authenticate:54)       Demo login for user (null) failed: unsupported username/credential.
                    16:11:54,042 INFO  [stdout] (http-localhost-127.0.0.1-8080-3) WARN  28-06 16:11:54,041 (AuthorizationHeaderChecker.java:loginByHeader:65)       Unable to authenticate for rest api: null
                    16:11:54,047 INFO  [stdout] (http-localhost-127.0.0.1-8080-3) INFO  28-06 16:11:54,047 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:11:54,048 INFO  [stdout] (http-localhost-127.0.0.1-8080-3) INFO  28-06 16:11:54,047 (AuthorizationHeaderChecker.java:loginByHeader:68)       admin authenticated for rest api
                    16:11:54,054 INFO  [stdout] (http-localhost-127.0.0.1-8080-3) INFO  28-06 16:11:54,054 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:11:54,055 INFO  [stdout] (http-localhost-127.0.0.1-8080-3) INFO  28-06 16:11:54,055 (AuthorizationHeaderChecker.java:loginByHeader:68)       admin authenticated for rest api
                    16:12:08,650 ERROR [stderr] (http-localhost-127.0.0.1-8080-9) java.io.OptionalDataException
                    16:12:08,650 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1339)
                    16:12:08,650 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
                    16:12:08,650 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jbpm.integration.console.forms.TaskFormDispatcher.provideForm(TaskFormDispatcher.java:77)
                    16:12:08,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jbpm.integration.console.forms.FormDispatcherComposite.provideForm(FormDispatcherComposite.java:50)
                    16:12:08,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.bpm.console.server.FormProcessingFacade.provideForm(FormProcessingFacade.java:205)
                    16:12:08,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.bpm.console.server.FormProcessingFacade.renderTaskUI(FormProcessingFacade.java:127)
                    16:12:08,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    16:12:08,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    16:12:08,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    16:12:08,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at java.lang.reflect.Method.invoke(Method.java:597)
                    16:12:08,651 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:140)
                    16:12:08,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:255)
                    16:12:08,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:220)
                    16:12:08,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:209)
                    16:12:08,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:519)
                    16:12:08,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:496)
                    16:12:08,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:119)
                    16:12:08,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)
                    16:12:08,652 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)
                    16:12:08,653 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)
                    16:12:08,654 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139)
                    16:12:08,654 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:480)
                    16:12:08,654 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)
                    16:12:08,654 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)
                    16:12:08,654 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                    16:12:08,654 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                    16:12:08,654 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)
                    16:12:08,654 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)
                    16:12:08,655 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)
                    16:12:08,655 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)
                    16:12:08,655 ERROR [stderr] (http-localhost-127.0.0.1-8080-9)      at java.lang.Thread.run(Thread.java:662)
                    16:12:08,659 INFO  [stdout] (http-localhost-127.0.0.1-8080-4) INFO  28-06 16:12:08,658 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:12:08,666 INFO  [stdout] (http-localhost-127.0.0.1-8080-3) INFO  28-06 16:12:08,666 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:12:08,699 INFO  [stdout] (http-localhost-127.0.0.1-8080-3) INFO  28-06 16:12:08,699 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:12:08,704 INFO  [stdout] (http-localhost-127.0.0.1-8080-4) INFO  28-06 16:12:08,704 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:12:08,712 INFO  [stdout] (http-localhost-127.0.0.1-8080-4) INFO  28-06 16:12:08,712 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:12:08,731 INFO  [stdout] (http-localhost-127.0.0.1-8080-4) INFO  28-06 16:12:08,731 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:12:08,739 INFO  [stdout] (http-localhost-127.0.0.1-8080-1) INFO  28-06 16:12:08,738 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:12:08,748 INFO  [stdout] (http-localhost-127.0.0.1-8080-13) INFO  28-06 16:12:08,748 (DemoAuthenticator.java:authenticate:65)       Demo login for user (admin) succeeded.
                    16:12:08,749 INFO  [stdout] (http-localhost-127.0.0.1-8080-13) INFO  28-06 16:12:08,749 (AuthorizationHeaderChecker.java:loginByHeader:68)       admin authenticated for rest api
                    16:12:08,750 INFO  [stdout] (http-localhost-127.0.0.1-8080-13) INFO  28-06 16:12:08,750 (PackageDeploymentServlet.java:execute:143)       PackageName: org.jenkinsci.plugins.jbpm
                    16:12:08,751 INFO  [stdout] (http-localhost-127.0.0.1-8080-13) INFO  28-06 16:12:08,750 (PackageDeploymentServlet.java:execute:144)       PackageVersion: LATEST
                    16:12:08,751 INFO  [stdout] (http-localhost-127.0.0.1-8080-13) INFO  28-06 16:12:08,751 (PackageDeploymentServlet.java:execute:145)       PackageIsLatest: true
                    16:12:08,751 INFO  [stdout] (http-localhost-127.0.0.1-8080-13) INFO  28-06 16:12:08,751 (PackageDeploymentServlet.java:execute:146)       PackageIsSource: true
                    
                    • 8. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                      kifayath khan Newbie

                      I am also getting same error, i am putting my code and error. Please help me. I am  using jbpm 5.3

                       

                       

                      package com.sample;

                       

                       

                      import java.util.HashMap;

                      import java.util.Map;

                       

                       

                      import org.drools.KnowledgeBase;

                      import org.drools.builder.KnowledgeBuilder;

                      import org.drools.builder.KnowledgeBuilderFactory;

                      import org.drools.builder.ResourceType;

                      import org.drools.io.ResourceFactory;

                      import org.drools.logger.KnowledgeRuntimeLogger;

                      import org.drools.logger.KnowledgeRuntimeLoggerFactory;

                      import org.drools.runtime.StatefulKnowledgeSession;

                      import org.jbpm.process.workitem.wsht.HornetQHTWorkItemHandler;

                       

                       

                      /**

                      * This is a sample file to launch a process.

                      */

                      public class ProcessTest {

                       

                       

                                public static final void main(String[] args) {

                                          try {

                                                    // load up the knowledge base

                                                    KnowledgeBase kbase = readKnowledgeBase();

                                                    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

                                                    KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(ksession, "test", 1000);

                                                    // start a new process instance

                                                    Map<String, Object> params = new HashMap<String, Object>();

                                                    params.put("employee", "krisv");

                                                    params.put("reason", "Yearly performance evaluation");

                                                    ksession.startProcess("com.sample.evaluation", params);

                                                    System.out.println("Process started ...");

                                                    logger.close();

                                          } catch (Throwable t) {

                                                    t.printStackTrace();

                                          }

                                }

                       

                       

                                private static KnowledgeBase readKnowledgeBase() throws Exception {

                                          KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                                          kbuilder.add(ResourceFactory.newClassPathResource("Evaluation.bpmn"), ResourceType.BPMN2);

                                          return kbuilder.newKnowledgeBase();

                                }

                       

                                private static StatefulKnowledgeSession createKnowledgeSession(KnowledgeBase kbase) {

                                          StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

                                          HornetQHTWorkItemHandler humanTaskHandler = new HornetQHTWorkItemHandler(ksession);

                                          humanTaskHandler.setIpAddress("127.0.0.1");

                                          humanTaskHandler.setPort(5445);

                                          ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);

                                          return ksession;

                                }

                       

                       

                       

                      }

                       

                       

                      When I ran the code above, the first task executed fine, but the second task gives me:

                           java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper

                       

                      Process started ...

                      Exception in thread "Thread-3" java.lang.ClassCastException: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper

                                at org.jbpm.task.utils.ContentMarshallerHelper.unmarshall(ContentMarshallerHelper.java:157)

                                at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:208)

                                at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler$1.run(GenericHTWorkItemHandler.java:187)

                                at java.lang.Thread.run(Thread.java:722)

                       

                      • 9. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                        Alessandro Dionisi Newbie

                        I have the same problem, executing the following code:

                         

                        Map<String, Object> results = new HashMap<String, Object>();

                        results.put("outcome", transition);

                        taskService.completeWithResults(selectedTask.getId(), currentUser, results);

                        • 10. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                          TC ONG Newbie

                          Well, I did download the latest code from github master.

                          Import into eclipse, compile and export them.

                          Now I am using jbpm 5.4 snapshot and drools 5.5 snap shot.

                          I try to run my web application.

                          Oh! I need to replace all my drools/jbpm jar. ok. replace and run.

                          Oh! need to replace mvel2 jar too. ok. replace and run.

                          Oh! need to recompile my drools package. ok, recompile and...

                          Exception in thread "main" java.lang.ExceptionInInitializerError

                                    at org.jbpm.process.builder.dialect.java.JavaProcessDialect.<clinit>(JavaProcessDialect.java:21)

                                    at org.jbpm.process.builder.dialect.ProcessDialectRegistry.<clinit>(ProcessDialectRegistry.java:15)

                                    at org.jbpm.bpmn2.BPMN2ProcessProviderImpl.<clinit>(BPMN2ProcessProviderImpl.java:31)

                                    at java.lang.Class.forName0(Native Method)

                                    at java.lang.Class.forName(Class.java:169)

                                    at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:214)

                                    at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceRegistryImpl.java:209)

                                    at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:164)

                                    at org.drools.compiler.BPMN2ProcessFactory.loadProvider(BPMN2ProcessFactory.java:28)

                                    at org.drools.compiler.BPMN2ProcessFactory.getBPMN2ProcessProvider(BPMN2ProcessFactory.java:20)

                                    at org.drools.compiler.BPMN2ProcessFactory.configurePackageBuilder(BPMN2ProcessFactory.java:11)

                                    at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:688)

                                    at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:50)

                                    at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:39)

                                    at com.geneoz.drools.RulesEngineBuilder.buildKB(RulesEngineBuilder.java:127)

                                    at com.geneoz.drools.RulesEngineBuilder.build(RulesEngineBuilder.java:94)

                                    at com.geneoz.drools.RulesEngineBuilder.main(RulesEngineBuilder.java:63)

                          Caused by: org.mvel2.templates.TemplateError: null input stream

                                    at org.mvel2.templates.util.TemplateTools.readStream(TemplateTools.java:113)

                                    at org.mvel2.templates.TemplateCompiler.compileTemplate(TemplateCompiler.java:414)

                                    at org.mvel2.templates.TemplateCompiler.compileTemplate(TemplateCompiler.java:405)

                                    at org.mvel2.templates.TemplateCompiler.compileTemplate(TemplateCompiler.java:401)

                                    at org.jbpm.process.builder.dialect.java.AbstractJavaProcessBuilder.<clinit>(AbstractJavaProcessBuilder.java:27)

                                    ... 17 more

                          Caused by: java.lang.NullPointerException

                                    at org.mvel2.templates.util.TemplateTools.readStream(TemplateTools.java:103)

                                    ... 21 more

                           

                          I am going deeper and deeper into this shit.

                          God I had enough of surprices.

                          I'll get the source for jbpm 5.3 and try to fix it manually. Hope will have some luck.

                          Jboss!!! WHY you release something like this!! WHYYYYY~~~~~~~!!!!!

                          • 11. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                            TC ONG Newbie

                            I end up fall back to drools 5.3 + jbpm 5.1.2.

                            When will jbpm 5.3.1+ be released? Any news?

                            • 12. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                              Ouadi BELMOKHTAR Newbie

                              Hi,

                               

                              I have the same with completeWithResults() method

                               

                              When I want to complete a human task, this exception is triggered, and I'm not able to solve this situation :

                               

                               

                              17:17:46,192 ERROR [org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler] (NioProcessor-6) null: java.io.OptionalDataException
                                        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1358) [rt.jar:1.7.0_15]
                                        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) [rt.jar:1.7.0_15]
                                        at org.jbpm.process.workitem.wsht.CommandBasedWSHumanTaskHandler$GetResultContentResponseHandler.execute(CommandBasedWSHumanTaskHandler.java:330) [jbpm-human-task-mina-5.4.0.Final.jar:5.4.0.Final]
                                        at org.jbpm.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:153) [jbpm-human-task-core-5.4.0.Final.jar:5.4.0.Final]
                                        at org.jbpm.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47) [jbpm-human-task-mina-5.4.0.Final.jar:5.4.0.Final]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078) [mina-core-2.0.1.jar:]
                                        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64) [mina-core-2.0.1.jar:]
                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_15]
                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_15]
                                        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_15]
                              

                               

                              Here is my compete taskmethod code :

                               


                              TaskClient client = null;
                               
                              try {
                                    client = connectToTaskServer(TASK_SERVER_HOST_IP_ADD,
                                                                                TASK_SERVER_PORT);
                               
                                    BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
                               
                                   Map<String, Object> taskVariables = new HashMap<String, Object>();
                                   // Currency validation accepted
                               
                                   taskVariables.put("o_validationResult", true);
                               
                               
                                    client.completeWithResults(aTaskId, aOwnerId, taskVariables, responseHandler);
                               
                                    responseHandler.waitTillDone(2000);
                                
                                    client.disconnect();
                               
                               
                              } catch (Exception e) {
                                  try {
                                        client.disconnect();
                                  } catch (Exception e1) {
                                       e1.printStackTrace();
                                  }
                                    e.printStackTrace();
                                    logger.error("Unable to completing the Task '" + aTaskId
                                                       + "' assigned to user '" + aOwnerId + "' : " + e.toString());
                                    throw new TaskManagerException("Unable to completing the Task '"
                                                       + aTaskId + "' assigned to user '" + aOwnerId + "' : "
                                                       + e.toString(), e);
                              }
                              

                               

                              After hard searching in the net, I'm not able to detect where this exception triggered !

                               

                              Here is exception javadoc :

                               

                              http://docs.oracle.com/javase/6/docs/api/java/io/OptionalDataException.html

                               

                              Thanks for helps.

                              • 14. Re: java.lang.String cannot be cast to org.jbpm.task.utils.MarshalledContentWrapper
                                TC ONG Newbie

                                It finally works on jBPM 5.4.0 final. I posted an example on here. Hope it helps.