I need to sen a Message using JMS to a remote JBoss server
Here is the code:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "147.15.50.120");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
try {
jndiContext
= new InitialContext(env);
queueConnectionFactory = (QueueConnectionFactory)
jndiContext.lookup(fabricaColas);
ctxtosJMS.contexto1 = jndiContext;
ctxtosJMS.queueConnFact1 = queueConnectionFactory;
} catch
(NamingException ne) {
System.out.println("[EMISOR]: No se pudo crear contexto JNDI "
+ ne.toString());
ctxtosJMS.contexto1 = jndiContext;
ctxtosJMS.queueConnFact1 = queueConnectionFactory;
}
and the error is :
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]
Any idea why?