xinbc / jdiameter

Automatically exported from code.google.com/p/jdiameter
0 stars 0 forks source link

Rx: ClientRxSessionImpl: ClassCastException handling STA at handleFailureMessage #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

What steps will reproduce the problem?
1. Send an STA without a result code.

What is the expected output? What do you see instead?
Should deliver STA to listener and set FSM to IDLE.

What version of the product are you using? On what operating system?
SNAPSHOT from repository on Mac.

Please provide any additional information below.
Fix ready to commit. HandleFailureMessage only takes RxAA objects. Change the 
input parameters to something generic i.e. AppAnswerEvent and AppRequestEvent 
and remove the cast statements in handleEventForSessionBased method.

12:03:23,901 DEBUG  [, ] [org.jdiameter.client.impl.fsm.PeerFSMImpl] 
(FSM-SPeer{Uri=aaa://127.0.0.1:3870; State=null; con=null; incConnull }_1-0) 
Got Event [Event{name:RECEIVE_MSG_EVENT, key:null, 
object:MessageImpl{commandCode=275, flags=96}}] from Queue
12:03:23,901 DEBUG  [, ] [org.jdiameter.client.impl.fsm.PeerFSMImpl] 
(FSM-SPeer{Uri=aaa://127.0.0.1:3870; State=null; con=null; incConnull }_1-0) 
Process event [Event{name:RECEIVE_MSG_EVENT, key:null, 
object:MessageImpl{commandCode=275, flags=96}}]. Peer State is [OKAY]
12:03:23,901 DEBUG  [, ] [org.jdiameter.server.impl.PeerImpl] 
(FSM-SPeer{Uri=aaa://127.0.0.1:3870; State=null; con=null; incConnull }_1-0) 
Receiving message in server.
12:03:23,902 DEBUG  [, ] [org.jdiameter.client.impl.controller.PeerImpl] 
(FSM-SPeer{Uri=aaa://127.0.0.1:3870; State=null; con=null; incConnull }_1-0) 
Receiving message in client.
12:03:23,902 DEBUG  [, ] [org.jdiameter.client.impl.controller.PeerImpl] 
(FSM-SPeer{Uri=aaa://127.0.0.1:3870; State=null; con=null; incConnull }_1-0) 
Message is an answer
12:03:23,910 DEBUG  [, ] [org.jdiameter.client.impl.app.rx.ClientRxSessionImpl] 
(ApplicationSession-0) Failure processing success message: 
org.jdiameter.api.InternalException: java.lang.ClassCastException: 
org.jdiameter.common.impl.app.rx.RxSessionTermAnswerImpl cannot be cast to 
org.jdiameter.api.rx.events.RxAAAnswer
    at org.jdiameter.client.impl.app.rx.ClientRxSessionImpl.handleEventForSessionBased(ClientRxSessionImpl.java:506) [jdiameter-impl-1.5.10.0-build639.jar:1.5.10.0-build639]
    at org.jdiameter.client.impl.app.rx.ClientRxSessionImpl.handleEvent(ClientRxSessionImpl.java:200) [jdiameter-impl-1.5.10.0-build639.jar:1.5.10.0-build639]
    at org.jdiameter.client.impl.app.rx.ClientRxSessionImpl$AnswerDelivery.run(ClientRxSessionImpl.java:773) [jdiameter-impl-1.5.10.0-build639.jar:1.5.10.0-build639]
    at org.jdiameter.common.impl.concurrent.DefaultRunnable.run(DefaultRunnable.java:47) [jdiameter-impl-1.5.10.0-build639.jar:1.5.10.0-build639]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_25]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_25]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_25]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178) [rt.jar:1.7.0_25]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292) [rt.jar:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_25]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_25]
    at java.lang.Thread.run(Thread.java:724) [rt.jar:1.7.0_25]
Caused by: java.lang.ClassCastException: 
org.jdiameter.common.impl.app.rx.RxSessionTermAnswerImpl cannot be cast to 
org.jdiameter.api.rx.events.RxAAAnswer
    at org.jdiameter.client.impl.app.rx.ClientRxSessionImpl.handleEventForSessionBased(ClientRxSessionImpl.java:399) [jdiameter-impl-1.5.10.0-build639.jar:1.5.10.0-build639]
    ... 11 more

Original issue reported on code.google.com by kilian.w...@gmail.com on 4 Nov 2013 at 12:11

GoogleCodeExporter commented 9 years ago

Original comment by brainslog on 16 Dec 2013 at 12:40

GoogleCodeExporter commented 9 years ago
This issue was updated by revision 5df8f9cd3dd0.

Fixed as suggested above.

Original comment by brainslog on 16 Dec 2013 at 12:40