2 Replies Latest reply on Sep 1, 2015 2:09 PM by sanjay05222

    RemoteConfiguration which is used along with RemoteRestRuntimeEngineFactory doesnt set serverBaseUrl

    sanjay05222

      I am creating a simple client to remotely invoke the process and I found that there is issue .

       

      RemoteConfiguration config = new RemoteConfiguration(bpmProcessDeploymentId, kieInstanceURL, kieUserName, kiePassword);

        RemoteRestRuntimeEngineFactory restSessionFactory = new RemoteRestRuntimeEngineFactory(config);

        RuntimeEngine engine = restSessionFactory.newRuntimeEngine();

        KieSession ksession = engine.getKieSession();

        Integer[] parameters = { new Integer(2), new Integer(4) };

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

        params.put("test", "test");

        ProcessInstance processInstance = ksession.startProcess(bpmProcessId, params);   <<== This throws null pointer exceptions

       

      Checked Further and looks like that the Code 

      Github Code For RemoteConfiguration

       

      public RemoteConfiguration(String deploymentId, URL url, String username, String password) {

              this(deploymentId, url, username, password, DEFAULT_TIMEOUT_IN_SECS);

          }


      public RemoteConfiguration(String deploymentId, URL url, String username, String password, int timeoutInSecs) {

              this.type = Type.REST;

              this.deploymentId = deploymentId;

             

              this.userName = username;

              this.password = password;

              this.timeoutInMillisecs = timeoutInSecs * 1000;

          }

       

      URL is not being set up in 6.2.x branch

       

      Due to which client throws null pointer exception

       

      java.lang.NullPointerException

        at org.kie.remote.common.rest.KieRemoteHttpRequest.relativeRequest(KieRemoteHttpRequest.java:929)

        at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:373)

        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.test.SimpleTestClient.startOasisBpmFlow(SimpleTestClient.java:91)

        at com.test.SimpleTestClient.main(SimpleTestClient.java:150)

       

       

       

      Thanks

      Sanjay Gautam