8 Replies Latest reply on Aug 3, 2007 3:49 AM by Amjad farajallah

    NPE when closing connection

    Mika rooney Newbie

      I have visited this url:
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=79227&view=previous

      I have installed jboss-4.0.5.GA but I have the same problem.
      What's version have fixed this bug?

      Any suggestions are welcome.
      Mika

        • 1. Re: NPE when closing connection
          Adrian Brock Master

          Here's the source.
          http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/tags/JBoss_4_0_5_GA/messaging/src/main/org/jboss/mq/server/JMSDestinationManager.java?annotate=57516

          Since you don't post the stacktrace there's no way for me to validate your assertion.
          I don't see a possibility for an NPE in that code.

          • 2. Re: NPE when closing connection
            Mika rooney Newbie

            2007-07-25 09:47:13,656 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Exiting on IOE
            java.net.SocketException: Socket closed
            at java.net.SocketInputStream.read(SocketInputStream.java:162)
            at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
            at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
            at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:79)
            at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2196)
            at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2376)
            at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2443)
            at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2515)
            at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2664)
            at java.io.ObjectInputStream.readByte(ObjectInputStream.java:875)
            at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:316)
            at java.lang.Thread.run(Thread.java:595)
            2007-07-25 09:47:13,660 DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
            2007-07-25 09:47:13,676 DEBUG [org.jboss.mq.il.uil2.SocketManager] Failed to handle: org.jboss.mq.il.uil2.msgs.CloseMsg4537415[msgType: m_connectionClosing, msgID: 9, error: null]
            java.io.IOException: Client is not connected
            at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:264)
            at org.jboss.mq.il.uil2.SocketManager.sendReply(SocketManager.java:238)
            at org.jboss.mq.il.uil2.ServerSocketManagerHandler.handleMsg(ServerSocketManagerHandler.java:131)
            at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:395)
            at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
            at java.lang.Thread.run(Thread.java:595)
            2007-07-25 09:47:13,676 DEBUG [org.jboss.mq.il.uil2.SocketManager] Failed to send error reply
            java.io.IOException: Client is not connected
            at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:264)
            at org.jboss.mq.il.uil2.SocketManager.access$800(SocketManager.java:53)
            at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleMsg(SocketManager.java:408)
            at org.jboss.mq.il.uil2.msgs.BaseMsg.run(BaseMsg.java:398)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
            at java.lang.Thread.run(Thread.java:595)


            • 4. Re: NPE when closing connection
              Adrian Brock Master

              And there's no NPE in that stacktrace or even a reference to the DestinationManager
              for that matter.

              • 5. Re: NPE when closing connection
                Mika rooney Newbie

                Thank you Adrian,
                I didn't find FAQ about this error.
                I only have visited this url: http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMQIGetJava.net.SocketExceptionConnectionResetWhy
                But the exception is not the same:

                2006-12-12 17:41:21,752 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Exiting on IOE
                java.net.SocketException: Connection reset

                instead of (my exception):

                2007-07-25 09:47:13,656 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Exiting on IOE
                java.net.SocketException: Socket closed.


                And in this FAQ was written:
                Reason: The JMS client is not closing the connection. The connection is reset by the OS when the VM exits.

                My JMS client is closing the connection in a finally block.
                Thanks in advance.
                Mika

                • 6. Re: NPE when closing connection
                  Adrian Brock Master

                  There's currently two concurrent posts about this "error".

                  For the 10,000th time. DEBUG != ERROR

                  connection.close() -> socket.close() -> DEBUG message saying the socket was closed
                  and the client is no longer connected.

                  Mainly because you are not using the pooled jms resource adapter like you should be.

                  • 7. Re: NPE when closing connection
                    Adrian Brock Master

                    And also for the 10,000th time
                    the response "FAQ" doesn't just mean its in the FAQ on the WIKI.
                    It usually means the question has appeared hundreds of times before in this forum.

                    I don't create FAQs because people can't read or understand the word "DEBUG".

                    • 8. Re: NPE when closing connection
                      Amjad farajallah Newbie

                      I have the same problem. does any one find the solution