7 Replies Latest reply on Jul 9, 2008 12:09 AM by (mike123)

    Invoke Process through livecycle java api

    Level 1
      I was trying to invoke a process through java api call. And the program hit a IllegalStateException when calling the invoke API. The process is a long-lived process and have a input parameter of String type "strDate". What is the cause? I tried calling the invoke as asynchronous process request and also synchronous, both throw the same exception.

      The sample code is copied from the livecycle documentation. Part of the code is as follow:

      Properties connectionProps = new Properties();
      connectionProps.setProperty("DSC_DEFAULT_EJB_ENDPOINT", "iiop://localhost:2809");
      connectionProps.setProperty("DSC_SERVER_TYPE", "WebSphere");
      connectionProps.setProperty("DSC_CREDENTIAL_USERNAME", "Administrator");
      connectionProps.setProperty("DSC_CREDENTIAL_PASSWORD", "password");

      ServiceClientFactory myFactory = ServiceClientFactory.createInstance(connectionProps);
      ServiceClient myServiceClient = myFactory.getServiceClient();
      Map params = new HashMap();
      params.put("strDate", "12122008");
      InvocationRequest request = myFactory.createInvocationRequest(
      InvocationResponse response = myServiceClient.invoke(request); //this api throw
      String invocationId = response.getInvocationId();

      THE ERROR the program generated:

      java.lang.IllegalStateException at com.adobe.idp.dsc.clientsdk.ServiceClientFactory$1.handleThrowable(ServiceClientFactory.j ava:68)
      at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke ServiceClient.java:220)
      at InvokeProcess.main(Unknown Source)

      Thanks for any help.