BTM
  1. BTM
  2. BTM-55

NPE in PoolingConnectionFactory.java:137 after a createRecoveryXaResourceHolder() did fail on a JmsConnection

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.3
    • Fix Version/s: 1.3.3
    • Labels:
      None
    • Environment:
      Spring 2.5.6, Jetty 7, JDK 6, 1.3.3-RC2 btm
    • Number of attachments :
      0

      Description

      Hi.
      I want to use JMS + JDBC with BTM Tx.
      But using the connection pooling stuff, i found this warning in my logs:

      WARN [bitronix-recovery-thread] bitronix.tm.recovery.Recoverer: error running recovery on resource 'activemq', resource marked as failed (background recoverer will retry recovery)
      bitronix.tm.recovery.RecoveryException: error starting recovery
      at bitronix.tm.resource.jms.PoolingConnectionFactory.startRecovery(PoolingConnectionFactory.java:128)
      at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:203)
      at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:174)
      at bitronix.tm.recovery.Recoverer.run(Recoverer.java:113)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.jms.InvalidClientIDException: Broker: indexBroker - Client: annotatedIndexService already connected from vm://indexBroker#0

      This line:

      recoveryXAResourceHolder = recoveryPooledConnection.createRecoveryXAResourceHolder();

      does provoke this exception.

      After this one there are more warnings coming to the log:

      WARN [bitronix-recovery-thread] bitronix.tm.recovery.Recoverer: error running recovery on resource 'activemq', resource marked as failed (background recoverer will retry recovery)
      bitronix.tm.recovery.RecoveryException: error ending recovery
      at bitronix.tm.resource.jms.PoolingConnectionFactory.endRecovery(PoolingConnectionFactory.java:143)
      at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:207)
      at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:174)
      at bitronix.tm.recovery.Recoverer.run(Recoverer.java:113)
      at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
      at bitronix.tm.resource.jms.PoolingConnectionFactory.endRecovery(PoolingConnectionFactory.java:137)
      ... 4 more

      A NPE is happening there.
      Looking at the code it seems like recoveryXAResourceHolder is only initalized if the connection can be aquired - but if this failes like above endRecovery should do something about.

        Activity

        Hide
        Ludovic Orban added a comment -

        Fixed in trunk and will be part of BTM 1.3.3 final. I'd be glad if you could test the fix.

        Thanks for the report!

        Show
        Ludovic Orban added a comment - Fixed in trunk and will be part of BTM 1.3.3 final. I'd be glad if you could test the fix. Thanks for the report!
        Hide
        Aswin Nair added a comment -

        Hi, I am getting similar exceptions using the 1.3.3 version. I am trying to use BTM with ActiveMQ through Spring's org.springframework.jms.listener.DefaultMessageListenerContainer. I am getting similar warnings as the OP has reported and the stack trace is as follows

        [15/12/09 12:48:33:033 CST] WARN recovery.Recoverer: error running recovery on resource 'activemq', resource marked as failed (background recoverer will retry recovery)
        bitronix.tm.recovery.RecoveryException: error starting recovery
        at bitronix.tm.resource.jms.PoolingConnectionFactory.startRecovery(PoolingConnectionFactory.java:128)
        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:203)
        at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:174)
        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:113)
        at java.lang.Thread.run(Thread.java:595)
        Caused by: javax.jms.InvalidClientIDException: Broker: localhost - Client: Spring already connected from /127.0.0.1:3531
        at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:216)
        at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82)
        at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82)
        at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:77)
        at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82)
        at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:89)
        at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:666)
        at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:83)
        at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:134)
        at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:297)
        at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:175)
        at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68)
        at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113)
        at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:210)
        at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84)
        at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:203)
        at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185)
        at java.lang.Thread.run(Unknown Source)
        [15/12/09 12:48:33:033 CST] INFO recovery.Recoverer: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 0 resource(s) [] (restricted to serverId 'spring-btm')
        [15/12/09 12:49:33:033 CST] WARN recovery.Recoverer: error running recovery on resource 'activemq', resource marked as failed (background recoverer will retry recovery)
        java.lang.NullPointerException
        at bitronix.tm.internal.XAResourceHolderState.getXAResource(XAResourceHolderState.java:75)
        at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:74)
        at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:39)
        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:205)
        at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:174)
        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:113)
        at java.lang.Thread.run(Thread.java:595)
        [15/12/09 12:49:33:033 CST] INFO recovery.Recoverer: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 0 resource(s) [] (restricted to serverId 'spring-btm')

        Show
        Aswin Nair added a comment - Hi, I am getting similar exceptions using the 1.3.3 version. I am trying to use BTM with ActiveMQ through Spring's org.springframework.jms.listener.DefaultMessageListenerContainer. I am getting similar warnings as the OP has reported and the stack trace is as follows [15/12/09 12:48:33:033 CST] WARN recovery.Recoverer: error running recovery on resource 'activemq', resource marked as failed (background recoverer will retry recovery) bitronix.tm.recovery.RecoveryException: error starting recovery at bitronix.tm.resource.jms.PoolingConnectionFactory.startRecovery(PoolingConnectionFactory.java:128) at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:203) at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:174) at bitronix.tm.recovery.Recoverer.run(Recoverer.java:113) at java.lang.Thread.run(Thread.java:595) Caused by: javax.jms.InvalidClientIDException: Broker: localhost - Client: Spring already connected from /127.0.0.1:3531 at org.apache.activemq.broker.region.RegionBroker.addConnection(RegionBroker.java:216) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82) at org.apache.activemq.advisory.AdvisoryBroker.addConnection(AdvisoryBroker.java:77) at org.apache.activemq.broker.BrokerFilter.addConnection(BrokerFilter.java:82) at org.apache.activemq.broker.MutableBrokerFilter.addConnection(MutableBrokerFilter.java:89) at org.apache.activemq.broker.TransportConnection.processAddConnection(TransportConnection.java:666) at org.apache.activemq.broker.jmx.ManagedTransportConnection.processAddConnection(ManagedTransportConnection.java:83) at org.apache.activemq.command.ConnectionInfo.visit(ConnectionInfo.java:134) at org.apache.activemq.broker.TransportConnection.service(TransportConnection.java:297) at org.apache.activemq.broker.TransportConnection$1.onCommand(TransportConnection.java:175) at org.apache.activemq.transport.TransportFilter.onCommand(TransportFilter.java:68) at org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:113) at org.apache.activemq.transport.InactivityMonitor.onCommand(InactivityMonitor.java:210) at org.apache.activemq.transport.TransportSupport.doConsume(TransportSupport.java:84) at org.apache.activemq.transport.tcp.TcpTransport.doRun(TcpTransport.java:203) at org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:185) at java.lang.Thread.run(Unknown Source) [15/12/09 12:48:33:033 CST] INFO recovery.Recoverer: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 0 resource(s) [] (restricted to serverId 'spring-btm') [15/12/09 12:49:33:033 CST] WARN recovery.Recoverer: error running recovery on resource 'activemq', resource marked as failed (background recoverer will retry recovery) java.lang.NullPointerException at bitronix.tm.internal.XAResourceHolderState.getXAResource(XAResourceHolderState.java:75) at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:74) at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:39) at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:205) at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:174) at bitronix.tm.recovery.Recoverer.run(Recoverer.java:113) at java.lang.Thread.run(Thread.java:595) [15/12/09 12:49:33:033 CST] INFO recovery.Recoverer: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 0 resource(s) [] (restricted to serverId 'spring-btm')
        Hide
        Ludovic Orban added a comment -

        This looks more or less related but definitely isn't the same issue.

        Please either post your findings on the mailing list or open a new issue to discuss this problem.

        Thanks!

        Show
        Ludovic Orban added a comment - This looks more or less related but definitely isn't the same issue. Please either post your findings on the mailing list or open a new issue to discuss this problem. Thanks!

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            Torsten Krah
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: