JBoss Community

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

created by Ouadi BEL in jBPM - View the full discussion

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.

Reply to this message by going to Community

Start a new discussion in jBPM at Community