Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ESB Client API - unable to connect to ESB.

AmitSoaDevJan 16 2009 — edited Jan 16 2009
Hi,

I am exploring ESB Client APIs. As a first step, I need to get the Console client. But I am not able to connect, and am instead getting 404 error. Here is the code

bq. package esbclientapi; \\ import oracle.tip.esb.client.ConsoleClient; \\ import oracle.tip.esb.client.ConsoleClientFactory; \\ public class BasicTest { \\ private String _host = "localhost"; \\ private int _port = 80; \\ private String _username = "oc4jadmin"; \\ private String _password = "welcome1"; \\ private void load() throws Exception { \\ System.out.println("Try to connect"); \\ ConsoleClient client = \\ ConsoleClientFactory.getConsoleClient(_host, _port, _username, \\ _password); \\ System.out.println("DVMLoader.load(): Got client"); \\ } \\ public static void main(String[] args) { \\ try { \\ BasicTest ldvm = new BasicTest(); \\ ldvm.load(); \\ } catch (Exception e) { \\ e.printStackTrace(); \\ } \\ } \\ } \\
Here is the error \\bq. Try to connect \\ oracle.tip.esb.client.ClientException: 404 : Not Found \\ at oracle.tip.esb.client.HttpClient.invoke(HttpClient.java:118) \\ at oracle.tip.esb.client.HttpClient.handleRedirectRequest(HttpClient.java:193) \\ at oracle.tip.esb.client.HttpClient.postAndReceive(HttpClient.java:147) \\ at oracle.tip.esb.client.HttpClient.invoke(HttpClient.java:114) \\ at oracle.tip.esb.client.impl.ConsoleClientImpl.authendicate(ConsoleClientImpl.java:102) \\ at oracle.tip.esb.client.impl.ConsoleClientImpl.<init>(ConsoleClientImpl.java:73) \\ at oracle.tip.esb.client.ConsoleClientFactory.getConsoleClient(ConsoleClientFactory.java:32) \\ at esbclientapi.BasicTest.load(BasicTest.java:15) \\ at esbclientapi.BasicTest.main(BasicTest.java:25) \\ Caused by: java.io.IOException: 404 : Not Found \\ at oracle.tip.esb.client.HttpClient.throwException(HttpClient.java:223) \\ at oracle.tip.esb.client.HttpClient.postAndReceive(HttpClient.java:150) \\ at oracle.tip.esb.client.HttpClient.invoke(HttpClient.java:114) \\ ... 8 more \\ Process exited with exit code 0. \\
Env Info:\\ I am using SOA 10.1.3.4. which has been installed over the advanced installation of SOA 10.1.3.1. I am using Jdev 10.1.3.4 \\ So, to access the ESB console, I simply use [http://localhost/esb] \\ To compile this program, I added Oraesb_patch.jar and xmlparserv2.jar to Libraries in JDeveloper \\ I guess the issue is with the hostname. I tried using the actual hostname, but it didnt help. To figure out the actual hostname, I looked at wsdl of one of the services which looks like this: \\[http://xxxx.yyyy.local:80/orabpel/default/SetPollingFreqForDBAdapter/1.0/SetPollingFreqForDBAdapter?wsdl|http://esswsl020-w209.emrlab.local/orabpel/default/SetPollingFreqForDBAdapter/1.0/SetPollingFreqForDBAdapter?wsdl] \\ So I tried using xxxx.yyyy.local, but got same error. \\ However, I feel the issue is something else. I tried giving some dummy string as host, and got a different error \\bq. private String _host = "ddd"; \\
error I got: \\bq. Try to connect \\ oracle.tip.esb.client.ClientException: ddd \\ at oracle.tip.esb.client.HttpClient.invoke(HttpClient.java:118) \\ at oracle.tip.esb.client.impl.ConsoleClientImpl.perform(ConsoleClientImpl.java:148) \\ at oracle.tip.esb.client.impl.ConsoleClientImpl.<init>(ConsoleClientImpl.java:71) \\ at oracle.tip.esb.client.ConsoleClientFactory.getConsoleClient(ConsoleClientFactory.java:32) \\ at esbclientapi.BasicTest.load(BasicTest.java:17) \\ at esbclientapi.BasicTest.main(BasicTest.java:27) \\ Caused by: java.net.UnknownHostException: ddd \\ at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177) \\ at java.net.Socket.connect(Socket.java:507) \\ I noticed that the error came in HttpClient.invoke \\ itself, a step which went off fine earlier (as per the earlier stack trace). \\ So my question is, how should I figure out the hostname.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 13 2009
Added on Jan 16 2009
2 comments
1,863 views