Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4697

Use of EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.toArray() is not thread safe and should be replace with java.util.concurrent.ConcurrentHashMap when using MQ transactions.

    XMLWordPrintable

    Details

      Description

      Custom Transaction engine throws the following exception...

      SEVERE: TransactionManager
      org.jboss.mq.SpyXAException: Resource manager error during recover; - nested throwable: (org.jboss.mq.SpyJMSException: Cannot recover; - nested throwable:
      (java.util.NoSuchElementException))
      at org.jboss.mq.SpyXAException.getAsXAException(SpyXAException.java:72)
      at org.jboss.mq.SpyXAResource.recover(SpyXAResource.java:166)
      at org.jboss.resource.connectionmanager.xa.JcaXAResourceWrapper.recover(JcaXAResourceWrapper.java:98)
      at com.gs.fw.aig.ljtm.LJTMTransactionManager.tryToRecover(LJTMTransactionManager.java:941)
      Caused by: org.jboss.mq.SpyJMSException: Cannot recover; - nested throwable: (java.util.NoSuchElementException)
      at org.jboss.mq.SpyJMSException.getAsJMSException(SpyJMSException.java:72)
      at org.jboss.mq.SpyJMSException.rethrowAsJMSException(SpyJMSException.java:57)
      at org.jboss.mq.Connection.recover(Connection.java:1142)
      at org.jboss.mq.SpyXAResourceManager.recover(SpyXAResourceManager.java:325)
      at org.jboss.mq.SpyXAResource.recover(SpyXAResource.java:162)
      ... 76 more
      Caused by: java.util.NoSuchElementException
      at EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap$HashIterator.next(ConcurrentHashMap.java:1131)
      at java.util.AbstractCollection.toArray(AbstractCollection.java:176)
      at org.jboss.mq.pm.TxManager.recover(TxManager.java:317)
      at org.jboss.mq.server.JMSDestinationManager.recover(JMSDestinationManager.java:502)
      at org.jboss.mq.server.JMSServerInterceptorSupport.recover(JMSServerInterceptorSupport.java:197)
      at org.jboss.mq.server.JMSServerInterceptorSupport.recover(JMSServerInterceptorSupport.java:197)
      at org.jboss.mq.server.TracingInterceptor.recover(TracingInterceptor.java:769)
      at org.jboss.mq.server.JMSServerInvoker.recover(JMSServerInvoker.java:203)
      at org.jboss.mq.il.jvm.JVMServerIL.recover(JVMServerIL.java:188)
      at org.jboss.mq.Connection.recover(Connection.java:1137)
      ... 78 more

      The EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap.toArray() calls values() which is not thread safe. This needs to be switched to java.util.concurrent.ConcurrentHashMap.

      The class org.jboss.mq.pm.TxManager needs to be changed to use java.util.concurrent.ConcurrentHashMap.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  adrian.brock Adrian Brock
                  Reporter:
                  jay.howell Jay Howell
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: