title: Sending messages to a remote JMS Topic
body: <p>I am writing a small utility to send JMS messages to a remote server, but I am failing to configure correctly the InitialContext (or so it seems)</p>
  
  <p>code to init the Context:</p>
  
  <pre><code>      Properties p = new Properties();
        p.put(Context.INITIAL_CONTEXT_FACTORY, 
              "org.jnp.interfaces.NamingContextFactory");
        p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
        p.put(Context.PROVIDER_URL, "jnp://10.10.10.10:1099/");
        Context context = new InitialContext(p);
  </code></pre>
  
  <p>But when I run it I get an exception:</p>
  
  <blockquote>
  <pre><code>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]
  </code></pre>
  </blockquote>
  
  <p>So what is baffling me is that is complaining about 127.0.0.1 event though I am configuring it for 10.10.10.10, which is alive, running jboss, no firewall, I can get a telnet session to port 1099, so it seems to be ok</p>
  
  <p>Any pointers ? or helpers ?</p>