We have an Oozie workflow with Java action node, which is supposed to call out another REST web service. Let us use a sample REST API link, http://www.thomas-bayer.com/sqlrest/INVOICE/10, as an example.
I build a small Java app that can get connected the web service and print some info back. It's implemented via Eclipse and works perfectly fine in Eclipse and command line. Then I upload the jar file and ask Oozie to invoke that jar. Oozie launcher can find that jar and launch it, but the connection is refused by the web service, http://www.thomas-bayer.com/sqlrest/INVOICE/10.
Logs below:
Invoking Main class now >>> Start web service calling ... <<< Invocation of Main class completed <<< Oozie Launcher ends
stderr logs org.apache.http.conn.HttpHostConnectException: Connect to www.thomas-bayer.com:80 [www.thomas-bayer.com/80.152.243.114] failed: Connection refused at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:138) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:314) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:85) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)