Hi folks,
I am having a little problem.
When i try to connect to jndi at remote server:
---
javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
java.net.ConnectException: Connection refused: connect]
---
piece of code using jndi.properties:
jndiContext = new InitialContext();
topicConnectionFactory = (TopicConnectionFactory) jndiContext.lookup("ConnectionFactory");
the jndi.properties file is at classpath
---
jndi.properties
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=172.20.100.67:1099
java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
piece of code using hashtable:
java.util.Hashtable env = new java.util.Hashtable();
env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
env.put("java.naming.provider.url", server);
env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
jndiContext = new InitialContext(env);
topicConnectionFactory = (TopicConnectionFactory) jndiContext.lookup("ConnectionFactory");
Can anyone help me ??
I´d apreciate that!!
tks,
Aleke
if your using linux on either machine (RedHat) then check your /etc/hosts has a line mapping the 172 address to your machines name.