10 Replies Latest reply on Nov 5, 2011 4:46 AM by paul.robinson

    NullPointerException in crash recovery

    leaqui

      Hi, I'm testing the use of TxBrige 4.7 over JBoss TS 4.6.1 and JBoss EAP 5.1.1.

      TxBridge is working fine, but I have a problem with crash recovery.

      In one of my crash recovery tests I have two JBoss running and one of them initiates a distributed transaction using XTS and TxBridge. When one of them has answered to be prepared and is going to execute BridgeDurableParticipant.commit() I shut it down. Next I start it up and when the recovery process is executing, a NullPointerException is thrown:

       

      12:00:28,171 WARN  [XTSLoggerI18N] [org.jboss.transactions.xts.recovery.participant.at.XTSATRecoveryModule_3] exception reactivating recovered WS-AT participant BridgeParticipantAT_-53ebeebd:f2e:4ea96da6:49
      java.lang.NullPointerException
          at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768)
          at com.arjuna.ats.internal.jta.transaction.jts.jca.TransactionImporterImple.recoverTransaction(TransactionImporterImple.java:104)
          at org.jboss.jbossts.txbridge.BridgeDurableParticipant.readObject(BridgeDurableParticipant.java:130)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
          at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)
          at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
          at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
          at org.jboss.jbossts.txbridge.BridgeRecoveryManager.deserialize(BridgeRecoveryManager.java:80)
          at org.jboss.jbossts.xts.recovery.participant.at.ATParticipantRecoveryRecord.restoreParticipant(ATParticipantRecoveryRecord.java:151)
          at org.jboss.jbossts.xts.recovery.participant.at.XTSATRecoveryManagerImple.recoverParticipants(XTSATRecoveryManagerImple.java:222)
          at org.jboss.jbossts.xts.recovery.participant.at.ATParticipantRecoveryModule.processParticipantsStatus(ATParticipantRecoveryModule.java:325)
          at org.jboss.jbossts.xts.recovery.participant.at.ATParticipantRecoveryModule.periodicWorkSecondPass(ATParticipantRecoveryModule.java:151)
          at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:799)
          at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:412)
      

       

      The exception is thrown because the

      recovered.baseXid()
      

      is null.

       

      This is the code of com.arjuna.ats.internal.jta.transaction.jts.jca.TransactionImporterImple.recoverTransaction(TransactionImporterImple.java:104)

      public SubordinateTransaction recoverTransaction (Uid actId) throws XAException
          {
              if (actId == null)
                  throw new IllegalArgumentException();
              
              TransactionImple recovered = new TransactionImple(actId);
              TransactionImple tx = (TransactionImple) _transactions.get(recovered.baseXid());
      
              if (tx == null)
              {
                  recovered.recordTransaction();
      
                  _transactions.put(recovered.baseXid(), recovered);
                  
                  return recovered;
              }
              else
                  return tx;
          }
      

       

      Do you know if this is a bug or I miss to configure something?

      Do you know why the recovered.baseXid() could be null?

      Thanks in advance!

       

      Leandro

        • 1. Re: NullPointerException in crash recovery
          paul.robinson

          Leandro,

           

          The TXBridge was not implemented in JBossTS 4.6.1, which I assume is why you are using the TXBridge from JBossTS 4.7.0. Unfortunately, the TXBridge required further reaching changes to  JBossTS than to just the TXBridge component; thus you can't use a version of JBossTS that was released before the changes to support the TXBridge were implemented.

           

          You could try upgrading the version of JBossTS, in the app server, to 4.7.0 or above. However, I notice that you are using JBoss EAP, and making this upgrade would result in an unsupported configuration. This approach may be satisfactory for you if you are just in the development phase as EAP 6.0 will contain the TXBridge and is not too far away (assuming you are planning to upgrade).

           

          Paul.

          • 2. Re: NullPointerException in crash recovery
            leaqui

            Hi Paul, thanks for replying.

            You are assuming right, that is why I'm using TxBridge from JBossTS 4.7.

             

            So you are saying that it is not possible to use TxBridge from JBossTS 4.7 with JBossTS 4.6.1?

            Think I'm ready to make the necessary changes to it if you guide me.

             

            I've read in the README.txt of TxBridge 4.7:

            "This version, like the JBossTS it is bundled with, targets JBossAS 5.1  It will not work on earlier releases.

            Ideally the txbridge should be used in conjunction with the JBossTS release it is included in, although it may

            work with JBossTS 4.6.1 or later."

             

            Thanks in advance

             

            Leandro

            • 3. Re: NullPointerException in crash recovery
              paul.robinson

              Leandro,

               

              You can download JBossTS 4.7.0 from here:

               

              http://www.jboss.org/jbosstm/downloads/4-7-0-GA

               

              Instructions on how to upgrade JBoss AS 5.1.0 (Which is the version that ships with EAP 5.1) can be found at the top of the "INSTALL" file.

               

              You should check with your EAP support representative what effect this upgrade would have on your support contract. My guess is that it will not be supported, so you should check if you are using this for more than just development/educational purposes.

               

              Hope this helps,

               

              Paul.

              • 4. Re: NullPointerException in crash recovery
                leaqui

                Paul, do you think that JBossTS 4.7 works better than the version bundled with JBoss EAP 5.1.1?

                I know that the version bundled with JBoss EAP 5.1.1 has many patches applied, does JBossTS 4.7 has these patches applied?

                Thanks!

                 

                Leandro

                • 5. Re: NullPointerException in crash recovery
                  paul.robinson

                  Leandro,

                   

                  EAP 5.1.1 contains JBossTS 4.6.1.CP11-Patch-01. This is basically version 4.6.1 with 11 cumulative patches applied. If you look at the JBossTS change log you will see that the 11th CP was released on the 24/02/2011:

                   

                  https://issues.jboss.org/browse/JBTM#selectedTab=com.atlassian.jira.plugin.system.project:changelog-panel&allVersions=true

                   

                  The reason why 4.6.1 has received these CPs is due to the fact that it is a supported version that goes into EAP. Other releases such as 4.7.0 are (unsupported) community only releases, so they do not receive CPs. Notice that the following issue was fixed in 4.6.1.CP11:

                   

                  https://issues.jboss.org/browse/JBTM-774

                   

                  We can see that the only release containing the TXBridge to get this fix was 4.13.0. There are likely to be many other fixes like this that only appear in much later releases.

                   

                  So to answer your question, JBossTS 4.7.0 will not "work better" than the version bundled with JBoss EAP 5.1.1. as JBossTS 4.7.0 is missing many of the CPs that you get from using the supported 4.6.1 branch.

                   

                  Can you let me know a little more about your requirement for the TXBridge? If you need it in a supported environment you will need to wait for an EAP release that supports the TXBridge. If you just wish to use the TXBridge in development or for educational purposes, you could download a community version of JBossAS that contains the TXBridge, such as JBoss AS 6.1.0 which contains JBossTS 4.14.0.Final and thus also has the TXBridge.

                   

                  Paul.

                  • 6. Re: NullPointerException in crash recovery
                    leaqui

                    Hi Paul,

                    Paul Robinson escribió:

                     

                    Leandro,

                     

                    EAP 5.1.1 contains JBossTS 4.6.1.CP11-Patch-01. This is basically version 4.6.1 with 11 cumulative patches applied. If you look at the JBossTS change log you will see that the 11th CP was released on the 24/02/2011:

                     

                    https://issues.jboss.org/browse/JBTM#selectedTab=com.atlassian.jira.plugin.system.project:changelog-panel&allVersions=true

                    Yes, I know...

                     

                    The reason why 4.6.1 has received these CPs is due to the fact that it is a supported version that goes into EAP. Other releases such as 4.7.0 are (unsupported) community only releases, so they do not receive CPs. Notice that the following issue was fixed in 4.6.1.CP11:

                     

                    https://issues.jboss.org/browse/JBTM-774

                     

                    We can see that the only release containing the TXBridge to get this fix was 4.13.0. There are likely to be many other fixes like this that only appear in much later releases.

                     

                    So to answer your question, JBossTS 4.7.0 will not "work better" than the version bundled with JBoss EAP 5.1.1. as JBossTS 4.7.0 is missing many of the CPs that you get from using the supported 4.6.1 branch.

                    I imagined that...

                     

                    Can you let me know a little more about your requirement for the TXBridge? If you need it in a supported environment you will need to wait for an EAP release that supports the TXBridge. If you just wish to use the TXBridge in development or for educational purposes, you could download a community version of JBossAS that contains the TXBridge, such as JBoss AS 6.1.0 which contains JBossTS 4.14.0.Final and thus also has the TXBridge.

                     

                    Paul.

                    We need to integrate two productive systems using web services and distributed transactions so we decided to use JTS, XTS.

                    When we started to develop the solution we realized that we needed something to integrate JTS and XTS, so TxBridge appeared. But the version of JBoss TS included with EAP 5 doesn't include TxBridge, then we decided to test TxBridge from JBoss TS 4.7 with the version of JBoss TS provided with EAP 5.

                     

                    As you said, I think that we need to wait for EAP 6, do you know if it will include TxBridge?

                    Thanks!

                     

                    Leandro

                    • 7. Re: NullPointerException in crash recovery
                      paul.robinson

                      Leandro,

                       

                      The TXBridge code will ship with EAP 6.0. However, for it to be supported, there needs to be many other things in place, such as documentation and full QA. The support personnel also need to become knowledgeable enough in the new feature to be able to support it.

                       

                      We are expecting this work to be complete by EAP 6.0 GA. However, there is a chance that it could be delayed in order to divert resource elsewhere.

                       

                      You should let your support representative know that a supported TXBridge would be valuable to you. The more customers we have asking for it, the more resource we get to support it.

                       

                      Hope this helps,

                       

                      Paul.

                      • 8. Re: NullPointerException in crash recovery
                        paul.robinson

                        Leandro,

                         

                        I meant to say, if you want to try out the TXBridge prior to EAP 6.0 release, I recommend you try it on AS 7.1.0.GA (community release) which is due soon. This will be a similar release to what will go into EAP 6.0.

                         

                        You will also notice a few differences, in general, between AS 5.x and AS 7.x, so it makes sense to become familiar as soon as possible.

                         

                        Thanks,

                         

                        Paul.

                        1 of 1 people found this helpful
                        • 9. Re: NullPointerException in crash recovery
                          leaqui

                          Hi Paul, thanks for the information.

                          We will make our Red Hat representative know we are really interested in TxBridge.

                          It's a good idea to try TxBridge with AS 7, we will go that way until EAP 6 is released.

                          Again, thanks for the support.

                           

                          Leandro

                          • 10. Re: NullPointerException in crash recovery
                            paul.robinson

                            You're welcome, glad I could help.

                             

                            Paul.