1 Reply Latest reply on Aug 6, 2013 5:15 AM by wdfink

    Connecting to a remote queue from Jboss4.2 to 4.3EAP

    tonygeorge

      Hi all,

       

      I am trying to send a message  from a java application ( Client : 10.1.3.170 ) which is runnning in JBoss4.2 to a remote queue in another server ( Server  : 10.1.3.160) which is JBoss4.3 EAP in another host.

      The below piece of code works fine when both Client and Sever running in same version ( that is 4.2 to 4.2 and 4.3 to 4.3 ). But when i try to send message from 4.2 to 4.3 am getting below exception from the statement  where i try to get the QueueConnectionFactory.

       

           InitialContext initialContext = null;

              try {

                       initialContext = new InitialContext();

                       String providerUrl ="jnp://10.1.3.160";// This is my remote IP where JBoss EAP is running and queue resides

               

                       Properties properties = new Properties();

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

                      properties.put(Context.PROVIDER_URL,providerUrl);

                      initialContext = new InitialContext(properties);

       

                     QueueConnectionFactory  qconFactory = (QueueConnectionFactory) initialContext.lookup("/ConnectionFactory");// Here i am getting exception

                      queueConnection = qconFactory.createQueueConnection();

              }

              catch (NamingException e){

                  initialContext = null;

                  messageCenter.error(" NamingException : "+ e.getMessage());

              }

       

      Exception I am getting is as given below :

       

      Could not obtain connection to any of these urls: 10.1.3.160 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]

       

       

      How we can establish the connection and send message when client and server is in different version ?

        • 1. Re: Connecting to a remote queue from Jboss4.2 to 4.3EAP
          wdfink

          I don't know whether the 4.2 and 4.3 libraries are compatible. But from what you describe it looks like not.

          In that case you need to bundle the external jbossall-client.jar in your application and configure the classloader to prevent loading the local API classes.  See classloading wiki

           

          But as there is a communication timeout, are you sure you have used the correct ports, maybe you set the port with jnp....host:1099 explicit.