RestComm / ussdgateway

RestComm USSD Gateway
http://www.restcomm.com/
GNU Affero General Public License v3.0
90 stars 99 forks source link

NullPointerException in high load servers #43

Closed vetss closed 7 years ago

vetss commented 7 years ago

We have reported of NullPointerException only in high load servers (USSD GW 6.2.1.GA)

2016-06-24 00:25:09,559 ERROR (pool-34-thread-1) Exception while processing PROCESS_UNSTRUCTURED_SS_REQUEST_INDICATION = ProcessUnstructuredSSRequestWrapper [wrapped=ProcessUnstructuredSSRequest [DialogId=26593, ussdDataCodingSch=CBSDataCodingScheme [Code=15, CBSDataCodingGroup=GeneralGsm7, NationalLanguageShiftTable=LanguageUnspecified, CharacterSet=GSM7], ussdString=*4#], msisdn=ISDNAddressString[AddressNature=international_number, NumberingPlan=ISDN, Address=249124405899]]] MAPDialog = MAPDialogSupplementaryWrapper [wrappedDialog=MAPDialog: LocalDialogId=26593 RemoteDialogId=1478874 MAPDialogState=INITIAL_RECEIVED MAPApplicationContext=MAPApplicationContext [Name=networkUnstructuredSsContext, Version=version2, Oid=0, 4, 0, 0, 1, 0, 19, 2, ] TCAPDialogState=InitialReceived] java.lang.NullPointerException at org.mobicents.ussdgateway.slee.sip.SipClientSbb.buildInvite(SipClientSbb.java:590) at org.mobicents.ussdgateway.slee.sip.SipClientSbb.sendUssdData(SipClientSbb.java:429) at org.mobicents.ussdgateway.slee.ChildSbb.onProcessUnstructuredSSRequest(ChildSbb.java:156) at sun.reflect.GeneratedMethodAccessor277.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.mobicents.slee.runtime.sbbentity.SbbEntityImpl.invokeEventHandler(SbbEntityImpl.java:479) at org.mobicents.slee.runtime.eventrouter.routingtask.EventRoutingTaskImpl.routeQueuedEvent(EventRoutingTaskImpl.java:379) at org.mobicents.slee.runtime.eventrouter.routingtask.EventRoutingTaskImpl.run(EventRoutingTaskImpl.java:126) at org.mobicents.slee.runtime.eventrouter.EventRouterExecutorImpl$EventRoutingTaskStatsCollector.run(EventRouterExecutorImpl.java:76) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)

Tickets for them: 33355 and 33746

Messageflow is SS7 -> USSD GW -> SIP (ProcessUnstructuredSSRequest)

The probable reason is in the code ParentSbb.java: (https://github.com/RestComm/ussdgateway/blob/master/core/slee/sbbs/src/main/java/org/mobicents/ussdgateway/slee/ParentSbb.java) public void onProcessUnstructuredSSRequest(ProcessUnstructuredSSRequest evt, ActivityContextInterface aci) { // .............. ChildRelation relation = this.getSipSbb(); ChildSbbLocalObject child = (ChildSbbLocalObject) relation.create(); child.setCallFact(call); child.setXmlMAPDialog(this.getDialog()); forwardEvent(child, aci);

"child.setCallFact(call);" code sets "call" into a CMP variable of a child SBB. "forwardEvent(child, aci);" schuld then initiate of "onProcessUnstructuredSSRequest()" event in the child SBB. But inside child SBB this CMD is null. We need to investigate it.

vetss commented 7 years ago

Fixing by: https://github.com/RestComm/ussdgateway/commit/149482cced9998e4e6c91725d8e309b7975d0faf