0 Replies Latest reply on Apr 25, 2015 2:15 AM by Pavan Andhukuri

    Unable to pass ArrayList as parameter while starting process

    Pavan Andhukuri Newbie

      We are facing the following error while trying to start a jBPM workflow from Java.

      Exception in thread "main" org.kie.remote.client.api.exception.RemoteApiException: IllegalStateException thrown with message 'Could not unmarshall user-defined class instance parameter of type 'jaxbListWrapper'':
      java
      .lang.IllegalStateException: Could not unmarshall user-defined class instance parameter of type 'jaxbListWrapper'
        at org
      .kie.remote.services.cdi.ProcessRequestBean.verifyObjectHasBeenUnmarshalled(ProcessRequestBean.java:219)
        at org
      .kie.remote.services.cdi.ProcessRequestBean.checkThatUserDefinedClassesWereUnmarshalled(ProcessRequestBean.java:208)
        at org
      .kie.remote.services.cdi.ProcessRequestBean.preprocessCommand(ProcessRequestBean.java:183)
        at org
      .kie.remote.services.cdi.ProcessRequestBean.processCommand(ProcessRequestBean.java:133)
        at org
      .kie.remote.services.cdi.ProcessRequestBean$Proxy$_$$_WeldClientProxy.processCommand(Unknown Source)
        at org
      .kie.remote.services.rest.ResourceBase.restProcessJaxbCommandsRequest(ResourceBase.java:153)
        at org
      .kie.remote.services.rest.ExecuteResourceImpl.execute(ExecuteResourceImpl.java:30)
        at org
      .kie.remote.services.rest.ExecuteResourceImpl$Proxy$_$$_WeldClientProxy.execute(Unknown Source)
        at sun
      .reflect.GeneratedMethodAccessor236.invoke(Unknown Source)
        at sun
      .reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java
      .lang.reflect.Method.invoke(Method.java:601)
        at org
      .jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
        at org
      .jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)
        at org
      .jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)
        at org
      .jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237)
        at org
      .jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
        at org
      .jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
        at org
      .jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
        at org
      .jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
        at org
      .jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
        at javax
      .servlet.http.HttpServlet.service(HttpServlet.java:790)
        at io
      .undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
        at io
      .undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130)
        at org
      .kie.remote.services.rest.jaxb.DynamicJaxbContextFilter.doFilter(DynamicJaxbContextFilter.java:45)
        at io
      .undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
        at io
      .undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
        at org
      .uberfire.ext.security.server.BasicAuthSecurityFilter.doFilter(BasicAuthSecurityFilter.java:53)
        at io
      .undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
        at io
      .undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
        at org
      .uberfire.ext.security.server.SecureHeadersFilter.doFilter(SecureHeadersFilter.java:53)
        at io
      .undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
        at io
      .undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
        at org
      .uberfire.ext.security.server.SecurityIntegrationFilter.doFilter(SecurityIntegrationFilter.java:64)
        at io
      .undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)
        at io
      .undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132)
        at io
      .undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85)
        at io
      .undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
        at io
      .undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
        at org
      .wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
        at io
      .undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:113)
        at io
      .undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
        at io
      .undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51)
        at io
      .undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
        at io
      .undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:61)
        at io
      .undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56)
        at io
      .undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
        at io
      .undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
        at io
      .undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
        at org
      .wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
        at io
      .undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
        at io
      .undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:240)
        at io
      .undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:227)
        at io
      .undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:73)
        at io
      .undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:146)
        at io
      .undertow.server.Connectors.executeRootHandler(Connectors.java:177)
        at io
      .undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727)
        at java
      .util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
        at java
      .util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
        at java
      .lang.Thread.run(Thread.java:722)

        at org
      .kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:457)
        at org
      .kie.services.client.api.command.AbstractRemoteCommandObject.executeCommand(AbstractRemoteCommandObject.java:128)
        at org
      .kie.services.client.api.command.KieSessionClientCommandObject.startProcess(KieSessionClientCommandObject.java:257)
        at com
      .aia.poc.jbpmclient.App.startProcess(App.java:62)
        at com
      .aia.poc.jbpmclient.App.main(App.java:27)

      The process accepts a parameter of type java.util.List and the same is defined in the process variable in the bpmn file.

      Following code is being used to start the process.

      public static void startProcess() throws MalformedURLException {
        
      KieSession kSession = connManager.getKieSession(DEPLOYMENT_ID, USER_ID,
        PASSWORD
      );

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

        
      List<String> listOfUsers = new ArrayList<String>();
        listOfUsers
      .add("admin");
        listOfUsers
      .add("pavan");

        params
      .put("list_of_users", listOfUsers);

        kSession
      .startProcess("com.sample.bpmn", params);

        
      }

      Connection is being established properly and we are able to trigger the process with null as params.