RAMSession connection refused
I have a local RAM installation (7.5.1) which I am trying to connect to using the Java API.
RAMSession session = null;
session = new RAMSession("http://localhost:8080/ram.ws", "admin", admin");
RAMUser user = session.getUser("user1");
This throws a:
Exception in thread "main" com.ibm.ram.common.data.exception.RAMRuntimeException: Unable to access server services: ; nested exception is:
java.net.ConnectException: Connection refused: connect
at com.ibm.ram.client.RAMSession.fetchUserFromServer(RAMSession.java:1502)
at com.ibm.ram.client.RAMSession.getUser(RAMSession.java:1398)
Any ideas as to what may be causing this?
RAMSession session = null;
session = new RAMSession("http://localhost:8080/ram.ws", "admin", admin");
RAMUser user = session.getUser("user1");
This throws a:
Exception in thread "main" com.ibm.ram.common.data.exception.RAMRuntimeException: Unable to access server services: ; nested exception is:
java.net.ConnectException: Connection refused: connect
at com.ibm.ram.client.RAMSession.fetchUserFromServer(RAMSession.java:1502)
at com.ibm.ram.client.RAMSession.getUser(RAMSession.java:1398)
Any ideas as to what may be causing this?
Accepted answer
Ok, figured it out. I'm running from an eclipse client. I ran the code in the debugger which breaks on the first exception. The exception detail message stated that I was running on an old client. Upgrading to the new client fixes the error, and produces clearer error messages. If I use an invalid url it now says:
Exception in thread "main" com.ibm.ram.common.data.exception.RAMRuntimeException: http://127.0.0.1:13080/ram
http://127.0.0.1:13080/ram.ws
The above connection URLs should be used to connect to this repository.
at com.ibm.ram.client.RAMSession.<init>(RAMSession.java:282)
...
Thanks for your patience Rich.
6 other answers
Hi,
That usually means there is something wrong your URI and that it can't be accessed. Verify through a browser on the same system that you can use that URI.
Thanks Rich. I may be getting closer using 'http://localhost:13080/ram.ws' which does show up the services list in the browser. However using the api I get:
Exception in thread "main" com.ibm.ram.common.data.exception.RAMRuntimeException: URL specified for the connection is invalid.
at com.ibm.ram.client.RAMSession.fetchUserFromServer(RAMSession.java:1502)
at com.ibm.ram.client.RAMSession.getUser(RAMSession.java:1398)
Same error if I use 127.0.0.1.
Hi,
The best thing to do is through the browser go to the web home page and select Help(?)->Extensions and look at the Repository Location link and use that.
Thanks,
Rich
That's what I did. The Extensions web services section has the repository location listed as http://localhost:13080/ram.ws . When I click on that link I get a 'Rational Asset Manager WebServices' page listing all the services. (btw I've done this before on a previous machine and version of RAM and it worked)
The only thing I can think of is that I have incorrectly configured something, but what? Are there any other log files I can look at?
Thanks Rich, I did notice the different error messages. The first url was actually used after the second. I have tested a variety of combinations of url/userid/password.
Did you notice the different error messages?
http://localhost:13080/ram.ws - RAMRuntimeException: URL specified for the connection is invalid.
http://localhost:8080/ram.ws - RAMRuntimeException: Unable to access server services
I had thought that the second looked more promising, but without any error logs I'm stuck.
(In the documentation it mentions using 8080: In version 7.5 and later, you can use a web or web services URL when creating initial connections to Rational Asset Manager. This example uses a web URL)