RuntimeEngine engine = null;
KieSession ksession = null;
System.out.println(
"url=" + url + " username=" + username + " password=" + password + " deploymentId=" + deploymentId);
try {
engine = RemoteRuntimeEngineFactory.newRestBuilder().addTimeout(REST_TIMEOUT_SECS).addUrl(new URL(url)).addUserName(username)
.addPassword(password).addDeploymentId(deploymentId).build();
ksession = engine.getKieSession();
for (Integer id : myList) {
// start a new process instance
if (id != null) {
Map<String, Object> params = new HashMap<String, Object>();
params.put("id", id);
ProcessInstance processInstance = ksession.startProcess(definitionId, params);
}
}
} catch (Exception e) {
e.printStackTrace();
}
Exception in thread "main" org.kie.remote.client.api.exception.RemoteCommunicationException: Unable to post request: Error occurred when trying to retrieve response code
at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:396)
at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeCommand(AbstractRemoteCommandObject.java:128)
at org.kie.services.client.api.command.KieSessionClientCommandObject.getProcessInstances(KieSessionClientCommandObject.java:290)
at com.colt.novitas.client.JbpmClientCronJob.createConnection(JbpmClientCronJob.java:162)
at com.colt.novitas.client.JbpmClientCronJob.<init>(JbpmClientCronJob.java:69)
at com.colt.novitas.client.JbpmClientCronJob.main(JbpmClientCronJob.java:42)
Caused by: org.kie.remote.common.rest.KieRemoteHttpRequestException: Error occurred when trying to retrieve response code
at org.kie.remote.common.rest.KieRemoteHttpRequest.responseCode(KieRemoteHttpRequest.java:1307)
at org.kie.remote.common.rest.KieRemoteHttpRequest.post(KieRemoteHttpRequest.java:719)
at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeRestCommand(AbstractRemoteCommandObject.java:392)
... 5 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:152)
at java.net.SocketInputStream.read(SocketInputStream.java:122)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:689)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1324)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at org.kie.remote.common.rest.KieRemoteHttpRequest.responseCode(KieRemoteHttpRequest.java:1305)