4 Replies Latest reply on Apr 14, 2004 9:26 PM by Adrian Brock

    MDB with JBoss

    danb99 Newbie

      I am trying to get the MDB example from the JBoss documentation running. Here is what I have to get a connection and a queue, etc:

      public void setupPTP() throws JMSException, NamingException
      Properties properties = new Properties();

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

      properties.setProperty(Context.PROVIDER_URL, "jnp://localhost:1099/");

      properties.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");

      InitialContext iniCtx = new InitialContext(properties);
      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory)tmp;
      conn = qcf.createQueueConnection();
      queA = (Queue)iniCtx.lookup("queue/A");
      queB = (Queue)iniCtx.lookup("queue/B");
      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      When executing Object tmp = iniCtx.lookup("ConnectionFactory") I get this exception:

      javax.naming.CommunicationException. Root exception is java.rmi.ConnectException: Connection refused to host:; nested exception is: java.net.ConnectException: Connection refused: connect

      Can anyone tell me what I am doing wrong? Where is coming from?


        • 1. Re: MDB with JBoss
          Adrian Brock Master

          Your broken host table/dns configuration.

          • 2. Re: MDB with JBoss
            danb99 Newbie

            My hosts file has just one entry:


            Any other suggestions?

            • 3. Re: MDB with JBoss
              Adrian Brock Master

              Please stop and think for one second before posting useless information.

              You don't have an entry for your host name or ip address in your host table,
              so where it is coming from? DNS/DHCP?
              Wherever it is coming from has broken configuration.

              Try running a basic test like

              import java.net.InetAddress;
              public class WhatIsMyAddress
               public static void main(String[] args) throws Exception

              If you can't figure it out, grab the guy who comes around your office
              plugging cables into the floor.
              He is your network admin.

              You might also want to read the FAQ topic.
              It is the one with BLOCK CAPTIALS trying to attract attention.


              • 4. Re: MDB with JBoss
                Adrian Brock Master

                I've just exanded on the networking FAQ question,
                there are now lots of things for you to investigate.