0 Replies Latest reply on Aug 14, 2019 9:56 AM by Rupesh Bende

    JBPM 7.25 unmarshalling error at kie server when custom object is passed

    Rupesh Bende Newbie

      I am trying to start JBPM process in JBPM7.25 server remotely using REST api. I also tried same thing using java client. But when I call start process, it gives following error.

       

      2019-08-14 15:12:15,007 ERROR [org.kie.server.remote.rest.jbpm.ProcessResource] (default task-15) Unexpected error during processing [withdrawProcess.withdraw:18 - Data Collection:12] -- java.util.LinkedHashMap cannot be cast to com.games24x7.withdrawprocess.PlayerWithdrawDetails: org.jbpm.workflow.instance.WorkflowRuntimeException: [withdrawProcess.withdraw:18 - Data Collection:12] -- java.util.LinkedHashMap cannot be cast to com.games24x7.withdrawprocess.PlayerWithdrawDetails at org.jbpm.workflow.instance.impl.NodeInstanceImpl.executeAction(NodeInstanceImpl.java:230)

      Following is the rest call I am using

      curl -X POST \ http://serverIP:port/kie-server/services/rest/server/containers/com.games24x7%3AwithdrawProcess%3A1.0.8-SNAPSHOT/processes/withdrawProcess.withdraw/instances \ -H 'Accept: */*' \ -H 'Accept-Encoding: gzip, deflate' \ -H 'Authorization: Basic a3Jpc3Y6a3Jpc3Y=' \ -H 'Cache-Control: no-cache' \ -H 'Connection: keep-alive' \ -H 'Content-Length: 74' \ -H 'Content-Type: application/json' \ -H 'cache-control: no-cache' \ -d '{ "plDetails": { "playerClub":7, "withdrawAllowed":1 } }'

      Also following is the java code I am trying to trigger remote process and receiving the same error.

                conf = KieServicesFactory.newRestConfiguration(URL, USER, PASSWORD); 
                Set<Class<?>> extraClassList = new HashSet<Class<?>>();
                extraClassList
      .add(PlayerWithdrawDetails.class);
                conf
      .addExtraClasses(extraClassList);
                conf
      .setMarshallingFormat(FORMAT);
                kieServicesClient
      = KieServicesFactory.newKieServicesClient(conf);
                Map<String, Object> map = new HashMap<String, Object>();
                PlayerWithdrawDetails plDetails = new PlayerWithdrawDetails();
                plDetails
      .setWithdrawalId(1);
                plDetails
      .setPlayerClub(7);
                map
      .put("plDetails", plDetails);
                processClient
      .startProcess("com.games24x7:withdrawProcess:1.0.8-SNAPSHOT", "withdrawProcess.withdraw", map);

      I have added PlayerWithdrawDetails in process variable also. I am not sure what I am doing wrong.