Skip to main content

Unhandled Exception in event router:.. when receive event

4 replies [Last post]
scottjg
Offline
Joined: 2008-08-21
Points: 0

Hi,

I add to my example more and more logic and I encounter another problem.

In one SBB handler method I call methods on Parlay RA, which generete new events ( routeReq() ). I attache this SbbLocalObject (from SbbContext) to Activity representing every new created Activity (callLegs). During third or fourth call ( generete another event ) I get response to the first event (eventRaportRes) which should be delivred to the same SBB Entity ( I attached to this callLeg/Activity when it was created). And in that point I get exception like that :

8,586 DEBUG [CallForwardingSbb] ##TPCC## SbbID[CallForwarding SBB#pl.ivmx#1.0] : Route call to: 123456789
0,889 DEBUG [CallForwardingSbb] ##TPCC## SbbID[CallForwarding SBB#pl.ivmx#1.0] : CallLegSessionId: 2097154
0,949 DEBUG [CallForwardingSbb] ##TPCC## SbbID[CallForwarding SBB#pl.ivmx#1.0] : Route call to: 223456789
0,949 DEBUG [CallForwardingSbb] ##TPCC## SbbID[CallForwarding SBB#pl.ivmx#1.0] : CallLegSessionId: 2097155
1,049 DEBUG [CallForwardingSbb] ##TPCC## SbbID[CallForwarding SBB#pl.ivmx#1.0] : Route call to: 323456789
1,049 DEBUG [CallForwardingSbb] ##TPCC## SbbID[CallForwarding SBB#pl.ivmx#1.0] : CallLegSessionId: 2097156
1,189 DEBUG [CallForwardingSbb] ##TPCC## SbbID[CallForwarding SBB#pl.ivmx#1.0] : Route call to: 666666666
1,189 DEBUG [CallForwardingSbb] ##TPCC## SbbID[CallForwarding SBB#pl.ivmx#1.0] : CallLegSessionId: 2097157
1,320 INFO [XACacheXAManager] Failed to commit XACache writes in tx[TransactionImple < ac, BasicAction: -3f579b57:ade:48da4ca3:bd status: ActionStatus.COMMITTING >.
Entry version verification failed for Map[runtimeCache-activitycontext:10efdd245489da50:-7c89dbea:11c94bb5bdd:-7fae].
Committing entry is not newer version than the actual entry's version.
key[acState]
ting entry version[0]
ting entry value[Active Activity Context]
entry version[1].
entry value[Ending Activity Context]
1,330 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.commitxaerror] [com.arjuna.ats.internal.jta.resources.arjunacore.commitxaerror] XAResourceRecord.c
xa error XAException.XA_HEURRB
1,390 WARN [arjLoggerI18N] [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_4] TwoPhaseCoordinator.afterCompletion - returned failure for com.arjuna.ats.internal.jta.
es.arjunacore.SynchronizationImple@1ed364c
1,390 ERROR [EventRouterImpl] Unhandled Exception in event router:
ransaction.SystemException: Failed to commit tx. null
at org.mobicents.slee.runtime.transaction.TransactionManagerImpl.commit(TransactionManagerImpl.java:352)
at org.mobicents.slee.runtime.EventRouterImpl.routeQueuedEvent(EventRouterImpl.java:1070)
at org.mobicents.slee.runtime.EventRouterImpl.access$100(EventRouterImpl.java:64)
at org.mobicents.slee.runtime.EventRouterImpl$EventExecutor.run(EventRouterImpl.java:121)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
9,290 WARN [loggerI18N] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] [com.arjuna.ats.internal.jta.resources.arjunacore.norecoveryxa] Could not find new X
ce to use for recovering non-serializable XAResource < 131075, 27, 25, 1--3f579b57:ade:48da4ca3:bd-3f579b57:ade:48da4ca3:bf
------

I'm using mobicents-all-1.2.0.CR2-jboss-4.2.2.GA-0809121432 version.

scottjg

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
gmainerd
Offline
Joined: 2007-12-12
Points: 0

Hi all,

I have the same problem described. I have tried the solution given by
eduardomartins, but nothing changes, the error persists but I have noticed it happens randomly.
(I'm using mobicents-jainslee-server-1.2.6.GA-jboss-4.2.3.GA)

There is Parent Sbb that creates a Child Sbb, this Child Sbb have the sending method where I attach the ACI (this is what I guess cause the problem because if I do not attach anything it works fine), in the Parent Sbb I handler the submit_sm_resp as initial-event=true (because just in the Child Sbb it does not work) in this handler method I create a new Child Sbb an attach the event to it and then in the Child Sbb submit_sm_resp handler method I process the event.

Sometimes the error occurs just after sending the message, other times after processing it in the Child Sbb method and other times everything works fine.

It's frustrating, any help will be nice.

Regards,

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

While processing the event, one of the activities you created changes to ending state (probably due to some logic in the RA that ends the activity if a specific event comes), and then when you finish processing and the transaction tries to commit, and finally create the activities it rollbacks because it's committing a deprecated version of the state (version 0 on the SBB tx vs version on the tx that requested the ending of the activity).

scottjg
Offline
Joined: 2008-08-21
Points: 0

Thanks for the answer :)
So I understand I have to change logic of my application.
If I want create few activiteis (like IpCallLeg) and attache to them current Sbb Local Object to receive events from these activiteis in one handler method (which is execute in transaction) it is impossible to do it properly because in the meantime (during executing this handler method in transaction) can comes response to one of these legs (e.g. from Gateway) which change its state and then I can't commit transaction properly in handler method.
Do I understand your explanation correctly ?
I haven't read all specification yet. I do it little by little so sometimes I have problem to understand retentions.

scottjg

eduardomartins
Offline
Joined: 2005-10-10
Points: 0

That is the bad thing of the java transaction model not being propagated to RAs sending network messages. In this case, to avoid race conditions, the RA should only send network messages, or post events on the new activities, after the transaction committed...

One way to get over it is to use two sbbs, lets say RootSbb and ChildSbb, and define a child relation between them, set both to receive the event, but only the RootSbb as initial one. When a event comes Root SBB handles the event, creates a ChildSbb local object and attaches it to ACI of the event being handled, use the ChildSbb local object interface to set any state (if needed), then creates all activities, attach the ChildSbb local object to those activities, and let it go, the ChildSbb will then handle the event in a new java transaction already attached to all new activities and it should be safe for you to send the network messages...