Highlighted

Invoke Process through livecycle java api

Avatar

01-07-2008

Hi,

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_TRANSPORT_PROTOCOL","EJB");

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(

"TestJDBC","invoke",params,false);

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.java:68)

at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke ServiceClient.java:220)

at InvokeProcess.main(Unknown Source)



Thanks for any help.

Replies

Highlighted

Avatar

Avatar

Jasmin_Charbonn

Avatar

Jasmin_Charbonn

Jasmin_Charbonn

02-07-2008

Can you put a variable logger as the first step of your process to see if it calls it. Maybe you have a problem in the process you're calling.



Jasmin
Highlighted

Avatar

02-07-2008

Thanks Jasmin,

I tried to search for the running process at the livecycle 'adminui', but cannot be found. The process is not even trigger and run. Is there any configuration or right issue that need to be configured. I have add the invoke rights for the user 'administrator' under the security at the endpoint of the process.



Thanks.
Highlighted

Avatar

Avatar

Jasmin_Charbonn

Avatar

Jasmin_Charbonn

Jasmin_Charbonn

03-07-2008

Can you call it using another way. Try with a watch folder or something. I just want to make sure it's not something with your process.



Jasmin
Highlighted
Highlighted

Avatar

Avatar

Jasmin_Charbonn

Avatar

Jasmin_Charbonn

Jasmin_Charbonn

03-07-2008

Are you sure the iiop port is on 2809 on that machine?



Is you java component deployed on the same server (since you're using iiop://localhost)?



Jasmin
Highlighted

Avatar

03-07-2008

Yes, the java component is deployed on the same server and the iiop port is the default port.

Thanks.
Highlighted

Avatar

09-07-2008

Just to update, I manage to get it work. It is due to classpath not correct set when I run the InvokeProcess program. I am using websphere as the application server. The classpath I use is as follow:



"C:\Program Files\IBM\WebSphere\AppServer\java\bin\java" -classpath .;"C:\Program Files\IBM\WebSphere\AppServer\lib\bootstrap.jar";"C:\Program Files\IBM\WebSphere\AppServer\java\jre\lib\ibmorb.jar";"C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.runtime_6.1.0.jar";C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common\adobe-usermanager-client.jar;C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common\adobe-livecycle-client.jar;C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\common\adobe-jobmanager-client-sdk.jar;C:\Adobe\LiveCycle8\LiveCycle_ES_SDK\client-libs\websphere\adobe-utilities.jar;"C:\Program Files\IBM\WebSphere\AppServer\lib\j2ee.jar";"C:\Program Files\IBM\WebSphere\AppServer\plugins\com.ibm.ws.emf_2.1.0.jar";"C:\Program Files\IBM\WebSphere\AppServer\plugins\org.eclipse.emf.ecore_2.2.1.v200609210005.jar";"C:\Program Files\IBM\WebSphere\AppServer\plugins\org.eclipse.emf.common_2.2.1.v200609210005.jar";"C:\Program Files\IBM\WebSphere\AppServer\runtimes\com.ibm.ws.webservices.thinclient_6.1.0.jar"; com.utilities.japp.InvokeProcess