Win a copy of liveProject: Protecting User Data with Spring Security and OAuth2 this week in the Spring forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

JMS Client Communication behind NAT

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a problem in JMS Client lookup. Our present network configuration is
Client <-->NAT<-->NAT<--->Server.
When I try to lookup the Server from my Client I am getting an error like connection refused.
But I can able to connect through browser(i.e. http).

In the jndi lookup I specified the NAT address. The code can able to communicate the NAT address and able to identify the corresponding local Computer IP Address also.But I am getting connection refused exception.
What could be the problem?

My JNDI Lookup Code is
java.util.Properties properties = new java.util.Properties();

properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");

properties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming rg.jnp.interfaces");

properties.put(Context.PROVIDER_URL,"jnp://203.101.41.32:1099");

InitialContext iniCtx = new InitialContext(properties);
Object tmp = iniCtx.lookup("ConnectionFactory");
TopicConnectionFactory tcf = (TopicConnectionFactory) tmp;


I am getting the following error if try to run my client

Exception in thread "main" javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.27.136 (Internal IP Address)

Do I need to specify anything else?


Thanks


Regards
Maruthi
 
Maruthi Chokkanathan
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
Finally I got the answer by referring the wiki page in JBOSS web site.
When I try a JNDI lookup, JBOSS returns the internal IP address i.e. jboss binds the system ip address instead of the NAT address. So I set a system property by specifying the rmi address of server to the corresponding NAT address in the server side. Now it works.
Thanks

Maruthi
 
reply
    Bookmark Topic Watch Topic
  • New Topic