Two Laptop Bag*
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
Author

JNDI Connection refused

Pieter-Jan Malfait
Greenhorn

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
Marshal

Joined: Jul 20, 2005
Posts: 9937
    
159

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

java.naming.provider.url=jnp://remoteHostMachineName:1099

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
Greenhorn

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.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces
java.naming.provider.url=jnp://remoteMachine:1099

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
Greenhorn

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 ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JNDI Connection refused
 
Similar Threads
Eclipse 3 with Jboss3.2.3 using Lomboz 3.0 -> CommunicationException
SocketTimeoutException when doing JNDI lookup
remote JNDI lookup fails
javax.naming.CommunicationException
stopping jboss in myeclipse