Remote CommandWebService API can't connect to remote server

45 views
Skip to first unread message

Ehsan Zaery Moghaddam

unread,
Jan 18, 2016, 8:58:32 AM1/18/16
to jBPM Usage
Hi Guys

I've installed the jbpm 6.3 community edition using jbpm-installer on wildfly 8. I can call services remotely using RemoteRuntimeEngineFactory.newRestBuilder(). But when I try to use the new CommandWebService API (RemoteRuntimeEngineFactory.newCommandClientWebServiceBuilder()), command execution fails with following exception:

Exception in thread "main" javax.xml.ws.WebServiceException: Could not send Message.
 at org
.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:147)
 at com
.sun.proxy.$Proxy46.execute(Unknown Source)
 at com
.gam.test.jbpm.api.Main.run(Main.java:35)
 at com
.gam.test.jbpm.api.Main.main(Main.java:25)
 at sun
.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:497)
 at com
.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.net.ConnectException: ConnectException invoking http://localhost:8080/jbpm-console/ws/CommandService: Connection refused: connect
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun
.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
 at sun
.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java
.lang.reflect.Constructor.newInstance(Constructor.java:422)
 at org
.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.mapException(HTTPConduit.java:1347)
 at org
.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1331)
 at org
.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
 at org
.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:633)
 at org
.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
 at org
.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
 at org
.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:572)
 at org
.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:481)
 at org
.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
 at org
.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
 at org
.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
 at org
.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)
 
... 8 more


Here is my code snippet:

CommandWebService commandWebService = RemoteRuntimeEngineFactory.newCommandWebServiceClientBuilder()
   
.addServerUrl(new URL("http://bpms-server:8080/jbpm-console"))
   
.addUserName("admin")
   
.addPassword("admin")
   
.buildBasicAuthClient();
 
GetTaskAssignedAsPotentialOwnerCommand potentialOwnerCommand = new GetTaskAssignedAsPotentialOwnerCommand();
potentialOwnerCommand
.setUserId("admin");
JaxbCommandsRequest commandsRequest = new JaxbCommandsRequest(potentialOwnerCommand);
JaxbCommandsResponse commandsResponse = commandWebService .execute(commandsRequest);


As can be seen, while I'm trying to connect to a remote server, the actual call is going to be made to the localhost, and so it fails.

Did I missed something? I've read in another post that the Remote CommandWebService API is not going to be used remotely. If it's true, so why did they prefix it with the Remote?

Regards
Ehsan

Reply all
Reply to author
Forward
0 new messages