Hi Alberto,

Just to make sure, you're not unmarshalling data that was created by a previous version of jBPM than the version you're currently using? That would definitely cause this type of bug.

If this is created using a clean/empty database, then it does look like a valid bug.  y

Would you mind doing the following?

- Make a jira for this (https://jira.jboss.org/) . You can pretty much paste what you've written in your e-mail.
- Please attach the bpmn file you're using, or if that's not possible, a bpmn file that is very similar to the one you're using (and one which hopefully also causes the bug you describe).
- What is also always great, is to attach a Java test case which produces the exception noted.

Feel free to assign it to me (Marco Rietveld), if you want.

Thanks,
Marco




29-06-12 11:21, Alberto R. Galdo:
Hi,

   I'm posting in this list because I will post very low level details which may not fit well in the user list. Please tell me if this is correct.

   We are trying to build a system using JBPM with human task, and we are now using the recent LocalTaskService and LocalHTWorkItemHandler ... that way:

humanTaskClient = new LocalTaskService(taskService);
....

LocalHTWorkItemHandler localHTWorkItemHandler = new LocalHTWorkItemHandler(humanTaskClient, sesion);

....

   We are facing a NullpointerException when unmarshalling the result of a completed human task. Here's the relevant stack trace:

11:11:21,734 ERROR [stderr] (http--0.0.0.0-8080-1) java.lang.NullPointerException
11:11:21,734 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.marshalling.impl.ProtobufProcessMarshaller.unmarshallVariableValue(ProtobufProcessMarshaller.java:270)
11:11:21,734 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.task.utils.ContentMarshallerHelper.unmarshall(ContentMarshallerHelper.java:112)
11:11:21,750 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.handleCompletedTask(GenericHTWorkItemHandler.java:230)
11:11:21,750 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.process.workitem.wsht.GenericHTWorkItemHandler$TaskCompletedHandler.execute(GenericHTWorkItemHandler.java:204)
11:11:21,750 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.task.service.local.LocalTaskService$SimpleEventTransport.trigger(LocalTaskService.java:320)
11:11:21,750 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.task.event.MessagingTaskEventListener.taskCompleted(MessagingTaskEventListener.java:80)
11:11:21,765 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.task.event.TaskEventSupport.fireTaskCompleted(TaskEventSupport.java:46)
11:11:21,765 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.task.service.TaskServiceSession.postTaskCompleteOperation(TaskServiceSession.java:563)
11:11:21,765 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:495)
11:11:21,765 ERROR [stderr] (http--0.0.0.0-8080-1)      at org.jbpm.task.service.local.LocalTaskService.complete(LocalTaskService.java:82)

   Some inspection lead us to locate this snippet that is


            ObjectMarshallingStrategyStore objectMarshallingStrategyStore = marshallingConfigurationImpl.getObjectMarshallingStrategyStore();
            context = new MarshallerReaderContext(stream, null, null, objectMarshallingStrategyStore, null, env);
            if(classloader != null){
                context.classLoader = classloader;
            }else{
                context.classLoader = ContentMarshallerHelper.class.getClassLoader();
            }
            ExtensionRegistry registry = PersisterHelper.buildRegistry( context, null );
            Header _header = PersisterHelper.readFromStreamWithHeader(context, registry);
            Variable parseFrom = JBPMMessages.Variable.parseFrom(_header.getPayload(), registry);
            Object value = ProtobufProcessMarshaller.unmarshallVariableValue(context, parseFrom);


    which is radically different from the previous implementation ( protocol buffers appears ).

    The problem is that in this code  ( in ProtobufProcessMarshaller ) :

        ObjectMarshallingStrategy strategy = context.usedStrategies.get( _variable.getStrategyIndex() );
        Object value = strategy.unmarshal( context.strategyContexts.get( strategy ),
                                           context,
                                           _variable.getValue().toByteArray(),
                                           (context.ruleBase == null)?null:context.ruleBase.getRootClassLoader() );
        return value;

     context.usedStrategies  and  context.strategyContexts are both Maps of size 0. And so the NPE.

     Our process runs ok before creating the human task and it only fails when completing a human task.

     Any insight on what can be happening here? 

Greets,


Alberto R. Galdo
argaldo@gmail.com



_______________________________________________
jbpm-dev mailing list
jbpm-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jbpm-dev


-- 
jBPM/Drools developer
Utrecht, the Netherlands