Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 52 by [email protected]: NPE in ClientRxSessionImpl for AAA with no result code
http://code.google.com/p/jdiameter/issues/detail?id=52

Result Code AVP is optional in AAA Rx operation but Result code is checked to see if the message is a success.

Class - ClientRxSessionImpl
Method - handleEventForSessionBased
Line - 331


My workaround is to assume the message is unsuccessful unless the result code is present.

e.g.
  private static final long DIAMETER_UNABLE_TO_COMPLY = 5012L;


                //Assume unsuccessful response unless result code specified.
                long resultCode = DIAMETER_UNABLE_TO_COMPLY;
                if (answer.getResultCodeAvp() != null) {
                    resultCode = answer.getResultCodeAvp().getUnsigned32();
                }


07:18:08,193 DEBUG [, , ] [org.jdiameter.client.impl.transport.tcp.TCPClientConnection] (TCPReader-4) Releasing lock and finished onEvent for connection [aaa://dra-central:3868] 07:18:08,193 DEBUG [, , ] [org.jdiameter.client.impl.fsm.PeerFSMImpl] (FSM-SPeer{Uri=aaa://172.16.121.36:3868; State=null; con=null; incConnull }_1-0) Got Event [Event{name:RECEIVE_MSG_EVENT, key:null, object:MessageImpl{commandCode=265, flags=96}}] from Queue 07:18:08,193 DEBUG [, , ] [org.jdiameter.client.impl.transport.tcp.TCPTransportClient] (TCPReader-4) Finished passing message on to parent 07:18:08,194 DEBUG [, , ] [org.jdiameter.client.impl.fsm.PeerFSMImpl] (FSM-SPeer{Uri=aaa://172.16.121.36:3868; State=null; con=null; incConnull }_1-0) Process event [Event{name:RECEIVE_MSG_EVENT, key:null, object:MessageImpl{commandCode=265, flags=96}}]. Peer State is [OKAY] 07:18:08,194 DEBUG [, , ] [org.jdiameter.server.impl.PeerImpl] (FSM-SPeer{Uri=aaa://172.16.121.36:3868; State=null; con=null; incConnull }_1-0) Receiving message in server. 07:18:08,195 DEBUG [, , ] [org.jdiameter.client.impl.controller.PeerImpl] (FSM-SPeer{Uri=aaa://172.16.121.36:3868; State=null; con=null; incConnull }_1-0) Receiving message in client. 07:18:08,195 DEBUG [, , ] [org.jdiameter.client.impl.controller.PeerImpl] (FSM-SPeer{Uri=aaa://172.16.121.36:3868; State=null; con=null; incConnull }_1-0) Message is an answer 07:18:08,196 DEBUG [, , ] [org.jdiameter.client.impl.app.rx.ClientRxSessionImpl] (ApplicationSession-0) Failure processing success message: org.jdiameter.api.InternalException: java.lang.NullPointerException at org.jdiameter.client.impl.app.rx.ClientRxSessionImpl.handleEventForSessionBased(ClientRxSessionImpl.java:503) [jdiameter-impl-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] at org.jdiameter.client.impl.app.rx.ClientRxSessionImpl.handleEvent(ClientRxSessionImpl.java:195) [jdiameter-impl-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] at org.jdiameter.client.impl.app.rx.ClientRxSessionImpl$AnswerDelivery.run(ClientRxSessionImpl.java:763) [jdiameter-impl-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] at org.jdiameter.common.impl.concurrent.DefaultRunnable.run(DefaultRunnable.java:47) [jdiameter-impl-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_17] at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_17] at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_17] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [rt.jar:1.7.0_17] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [rt.jar:1.7.0_17] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
Caused by: java.lang.NullPointerException
at org.jdiameter.client.impl.app.rx.ClientRxSessionImpl.handleEventForSessionBased(ClientRxSessionImpl.java:325) [jdiameter-impl-1.6.0-SNAPSHOT.jar:1.6.0-SNAPSHOT]
        ... 11 more

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "mobicents-all-issues-changes" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to