6 Replies Latest reply on Oct 3, 2002 1:31 PM by smeg

    Connection failure

    vorlon

      I am having problems receiving JMS messages using JBoss 3.0.2. The remote client seems to run fine and does not throw an Exception. Just on the server side I get a connection failure and the message is never consumed by the MDB. It looks like a configuration problem, so I hope somebody can give me a hint on how to solve this problem.

      The following Exception is thrown by JBoss when I try to send a message using "ConnectionFactory":

      2002-09-23 15:15:36,629 DEBUG [org.jboss.mq.il.oil.OILClientIL] ConnectionReceiverOILClient is connecting to: xxx.xxx.xxx.xxx:2344
      2002-09-23 15:15:36,861 WARN [org.jboss.mq.il.oil.OILServerILService] Connection failure (1).
      java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(SocketInputStream.java:168)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
      at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
      at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2316)
      at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2383)
      at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2455)
      at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2604)
      at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
      at org.jboss.mq.il.oil.OILServerILService$Client.run(OILServerILService.java:205)
      at java.lang.Thread.run(Thread.java:536)

      and later I try to use "UILConnectionFactory":

      2002-09-23 15:21:19,198 DEBUG [org.jboss.mq.il.uil.UILServerILService] Setting up the UILClientIL Connection
      2002-09-23 15:21:19,215 DEBUG [org.jboss.mq.il.uil.UILServerILService] The UILClientIL Connection is set up
      2002-09-23 15:21:19,498 WARN [org.jboss.mq.il.uil.UILServerILService] Connection failure (1).
      java.net.SocketException: Connection reset
      at java.net.SocketInputStream.read(SocketInputStream.java:168)
      at java.net.SocketInputStream.read(SocketInputStream.java:182)
      at java.io.DataInputStream.readShort(DataInputStream.java:320)
      at org.jboss.mq.il.uil.multiplexor.StreamDemux.pumpData(StreamDemux.java:124)
      at org.jboss.mq.il.uil.multiplexor.DemuxInputStream.read(DemuxInputStream.java:87)
      at org.jboss.mq.il.uil.multiplexor.DemuxInputStream.read(DemuxInputStream.java:122)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
      at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
      at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2316)
      at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2383)
      at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2455)
      at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2604)
      at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
      at org.jboss.mq.il.uil.UILServerILService.run(UILServerILService.java:228)
      at java.lang.Thread.run(Thread.java:536)

      This is my *-destinations-service.xml file:



      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager








      This is the client code (MDB methods are never reached):

      private static final String QUEUE_CONNECTION_FACTORY_NAME = "UILConnectionFactory";
      private static final String QUEUE_NAME = "queue/PolypolAuditLogQueue";
      Hashtable env = new Hashtable();
      env.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      env.put("java.naming.factory.url.pkgs", "org.jboss.naming");
      env.put("java.naming.provider.url", "xxxxxxxxxxxx:1099");
      InitialContext initialContext = new InitialContext(env);
      QueueConnectionFactory factory = (QueueConnectionFactory)
      initialContext.lookup(QUEUE_CONNECTION_FACTORY_NAME);
      QueueConnection connection = factory.createQueueConnection();
      session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      queue = (Queue) initialContext.lookup(QUEUE_NAME);
      entry = ...
      ObjectMessage objectMessage = session.createObjectMessage();
      objectMessage.setObject(entry);
      QueueSender sender = session.createSender(queue);
      sender.send(objectMessage);

      Does anybody know what I am doing wrong???

      Thanks in advance,
      Michael

        • 1. Re: Connection failure
          vorlon

          The same happens if I try to send the JMS message to a local JBoss queue instead of sending it to the remote one. Also if I try to send it to the preconfigured "queue/A", then the same Exception occurs.

          • 2. Re: Connection failure
            vorlon

            The same happens if I try to use TextMessages instead of ObjectMessages. Also a clean JBoss 3.2.0beta installation shows the same error.

            • 3. Re: Connection failure
              vorlon

              The problem seems to be that I have to close sender, session, and connection.

              • 4. Re: Connection failure
                joelvogt

                probably yes

                • 5. Re: Connection failure
                  vorlon

                  Yes, it works now. The Exceptions were caused by the client abruptly closing the connection by terminating without calling close() before.

                  • 6. Re: Connection failure
                    smeg

                    I seem to be experincing the same sort of problem at the minute, I get an exception when I try and post onto my own queue on JBOss after I ve posted onto a remote queue.
                    Its something to do with the JNDI naming properties I have as it exceptions when I try and create a new context with teh standard values I used in the Jboss2.4.4.

                    If I get any where Ill come and let you know