3 Replies Latest reply on Sep 30, 2004 3:22 PM by genman

    JMS Interrupted exception

    oz_ko

      Platform:
      jsdk 1.4.2_05-b04
      jboss 3.2.5
      WinXP

      I'm using a directory poller called jpoller ( http://jpoller.sourceforge.net/ ) which i've implemented as a SAR ( the sar lives in an ear atm )

      The DirectoryPollManager receives an event when a file appears in a directory. The file is loaded ( file size < 1k ) and posted as a text message to a queue where a MDB poccesses the message. (There is no security on the queue so don't be fooled by "cannot authenticate user", its a red herring.)

      When using the IUL2 ( not JVM invocation ) I'm getting an InterruptedException.


      org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.lang.InterruptedException)
      at org.jboss.mq.Connection.authenticate(Connection.java:1161)
      at org.jboss.mq.Connection.<init>(Connection.java:248)
      at org.jboss.mq.Connection.<init>(Connection.java:325)
      at org.jboss.mq.SpyConnection.<init>(SpyConnection.java:66)
      at org.jboss.mq.SpyConnectionFactory.createConnection(SpyConnectionFactory.java:87)
      at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:124)
      at au.com.service.DirectoryPollManager.sendMessage(DirectoryPollManager.java:74)
      at au.com.DirectoryPollManager.fileSetFound(DirectoryPollManager.java:48)
      at org.sadun.util.polling.DefaultListener.receive(DefaultListener.java:40)
      at com.deltax.util.listener.SignalQueue.run(SignalQueue.java:60)
      Caused by: java.lang.InterruptedException
      at EDU.oswego.cs.dl.util.concurrent.LinkedQueue.put(LinkedQueue.java:94)
      at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:239)
      at org.jboss.mq.il.uil2.SocketManager.sendMessage(SocketManager.java:192)
      at org.jboss.mq.il.uil2.UILServerIL.authenticate(UILServerIL.java:307)
      at org.jboss.mq.Connection.authenticate(Connection.java:1153)
      ... 9 more

      I'm not sure why this would be happening. The problem is somehere in
      EDU.oswego.cs.dl.util.concurrent.LinkedQueue.put(..)

      As you can see the thread that puts the message on the LinkedQueue is the same
      thread that read the file, but it is not the same thread that the directory poller
      service runs on (though I don't think this should be a problem).



      jboss.xml:
      <message-driven>
       <ejb-name>OAMPSMessageInMDB</ejb-name>
       <destination-jndi-name>queue/oampsQueueIn</destination-jndi-name>
       <resource-ref>
       <res-ref-name>jms/QCF</res-ref-name>
       <jndi-name>ConnectionFactory</jndi-name>
       </resource-ref>
      </message-driven>
      


      ejb.jar:
      <message-driven>
       <ejb-name>MessageInMDB</ejb-name>
       <ejb-class>au.com.message.MessageInMDB</ejb-class>
       <transaction-type>Container</transaction-type>
       <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
       <message-driven-destination>
       <destination-type>javax.jms.Queue</destination-type>
       </message-driven-destination>
       <resource-ref>
       <res-ref-name>jms/QCF</res-ref-name>
       <res-type>javax.jms.QueueConnectionFactory</res-type>
       <res-auth>Container</res-auth>
       </resource-ref>
      </message-driven>
      

      jbossmq-destinations-service.xml:
      <mbean code="org.jboss.mq.server.jmx.Queue" name="jboss.mq.destination:service=Queue,name=QueueIn">
       <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
      </mbean>
      


      Anybody have ideas if this is a bug or PEBKAC? Or how to diagnose it further? Maybe a solution?

      Oz

        • 1. Re: JMS Interrupted exception
          oz_ko

          Some addtional info. the Debug Log for org.jboss.mq:

          DEBUG [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] Extracting SpyConnectionFactory from reference
          DEBUG [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] The GenericConnectionFactory is: GenericConnectionFactory[server=org.jboss.mq.il.uil2.UILServerIL@52a2e3 connectionProperties={UIL_ADDRESS_KEY=169.254.25.129, UIL_CHUNKSIZE_KEY=1000000, UIL_TCPNODELAY_KEY=yes, ClientILService=org.jboss.mq.il.uil2.UILClientILService, UIL_PORT_KEY=8093, UIL_BUFFERSIZE_KEY=2048, PingPeriod=60000}]
          DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
          DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin WriteTask.run
          DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectOutputStream
          DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin ReadTask.run
          DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin WriteTask.run
          DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectOutputStream
          DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin ReadTask.run
          DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
          DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
          DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectInputStream
          DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectInputStream
          INFO [STDOUT] org.jboss.mq.SpyJMSException: Cannot authenticate user; - nested throwable: (java.lang.InterruptedException)
          INFO [STDOUT] at org.jboss.mq.Connection.authenticate(Connection.java:1161)
          INFO [STDOUT] at org.jboss.mq.Connection.<init>(Connection.java:248)
          INFO [STDOUT] at org.jboss.mq.Connection.<init>(Connection.java:325)
          INFO [STDOUT] at org.jboss.mq.SpyConnection.<init>(SpyConnection.java:66)
          INFO [STDOUT] at org.jboss.mq.SpyConnectionFactory.createConnection(SpyConnectionFactory.java:87)
          INFO [STDOUT] at org.jboss.mq.SpyConnectionFactory.createQueueConnection(SpyConnectionFactory.java:124)
          INFO [STDOUT] at au.com.service.DirectoryPollManager.sendMessage(DirectoryPollManager.java:74)
          INFO [STDOUT] at au.com.service.DirectoryPollManager.fileSetFound(DirectoryPollManager.java:48)
          INFO [STDOUT] at org.sadun.util.polling.DefaultListener.receive(DefaultListener.java:40)
          INFO [STDOUT] at com.deltax.util.listener.SignalQueue.run(SignalQueue.java:60)
          INFO [STDOUT] Caused by: java.lang.InterruptedException
          INFO [STDOUT] at EDU.oswego.cs.dl.util.concurrent.LinkedQueue.put(LinkedQueue.java:94)
          INFO [STDOUT] at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:239)
          INFO [STDOUT] at org.jboss.mq.il.uil2.SocketManager.sendMessage(SocketManager.java:192)
          DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
          DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
          DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Exiting on IOE
          java.io.EOFException
          at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2603)
          at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
          at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279)
          at java.lang.Thread.run(Thread.java:534)
          DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
          DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run


          Oz

          • 2. Re: JMS Interrupted exception
            oz_ko

            I've given up on using UIL2 as the transport layer. In memory invocation seems to work ok.

            It's a bit odd since the UIL2 seems to work fine when invoked via a web layer.

            However I would still like to know what the issue was to satisfy my own curiousity.


            Oz

            • 3. Re: JMS Interrupted exception
              genman


              It could be that your code (non-JBoss) is calling Thread.interrupt() some time, perhaps spuriously. If you have the code (or decompile it) check for that.