NullPointerException in crash recovery
leaqui Oct 27, 2011 12:08 PMHi, 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