• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

JNDI Connection refused  RSS feed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pieter-Jan Malfait
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!