3 Replies Latest reply on Feb 4, 2005 10:14 PM by adrian.brock

    CommunicationException when looking up ConnectionFactory

    pepgrifell

       

      "pepgrifell" wrote:
      "pepgrifell" wrote:
      Hi,

      I have an application that sends a message to another application. They will be in different hosts but by the moment I´m trying the 2 applications in my machine. If I use the following code I can get the connection factory :

      InitialContext iniCtx = new InitialContext();
      queueConnectionFactory = (QueueConnectionFactory)iniCtx.lookup(ConnectionFactory);
      


      But if I use this code (the IP is my machine´s IP):

      Properties env = new Properties();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "jnp://192.156.23.166:1099");
      env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      InitialContext iniCtx = new InitialContext(env);
      queueConnectionFactory = (QueueConnectionFactory)iniCtx.lookup(ConnectionFactory);
      


      I get the following code :



      Error looking up 'ConnectionFactory
      javax.naming.CommunicationException: Receive timed out. Root exception is
      java.net.SocketTimeoutException: Receive timed out
      at java.net.PlainDatagramSocketImpl.receive(Native Method)
      at java.net.DatagramSocket.receive(DatagramSocket.java:671)
      at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1093)


      I cannot do this ?

      Thanks.