wood burning stoves
The moose likes EJB and other Java EE Technologies and the fly likes JNDI Connection  refused Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "JNDI Connection  refused" Watch "JNDI Connection  refused" New topic

JNDI Connection refused

Pieter-Jan Malfait

Joined: Aug 23, 2005
Posts: 26
i'm trying to look up a helloworld test statemess session bean from a remote jboss server
when i telnet to port 1099 on the jboss server i can connect but when i try to lookup the jndi namen in my client with :

Context context = new InitialContext();
HelloWorld helloWorld = (HelloWorld)context.lookup("java:comp/env/ejb/HelloWorld");

i get a connection refused error

Exception in thread "main" javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: nested exception is:
java.net.ConnectException: Connection timed out: connect]
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:707)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)

can anyone help me with this problem ? i would be very grateful
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

Is the value of java.naming.provider.url proper.


where remoteHostMachineName is the name(or IP address) of the remote machine on which the bean is deployed

[My Blog] [JavaRanch Journal]
Pieter-Jan Malfait

Joined: Aug 23, 2005
Posts: 26
this is my jndi.properties
i added the jnp:// as it wasn't there before, but it still doesn't work , i get the same connection refused error

java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces

when i use a non-existing host it give another exception saying it can't get a connection to any of the given urls (as they are non-existing), just did this to make sure java uses the correct jndi.properties an it finds my remote server
[ August 23, 2005: Message edited by: pj malfait ]
Pieter-Jan Malfait

Joined: Aug 23, 2005
Posts: 26
it works now
apparently port 1098 was blocked by the jboss server and needed for rmi, the admin fixed it for me
[ August 23, 2005: Message edited by: pj malfait ]
I agree. Here's the link: http://aspose.com/file-tools
subject: JNDI Connection refused
It's not a secret anymore!