MazWoz / jsmpp

Automatically exported from code.google.com/p/jsmpp
Apache License 2.0
0 stars 0 forks source link

Enum lookup fails on delivery failure notification #149

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. send a message with unknown number, 
RegisteredDelivery(SMEOriginatedAcknowledgement.DELIVERY) set, and a 
MessageReceiverListener configured to the SMPP gateway of SMS Global
2. wait for the negative receipt
3. call DeliverSm.getShortMessageAsDeliveryReceipt() on the received object in 
the listener

What is the expected output? What do you see instead?

As far as I understand the method should succeed and returns an instance of 
DeliveryReceipt, which we could then check for a failure condition.

Instead I get the following stack trace in my log file:

14:40:01.455 [pool-3-thread-2] ERROR c.s.d.smsa.MessageReceiptHandler - Failed 
getting delivery receipt
org.jsmpp.util.InvalidDeliveryReceiptException: There is an error found when 
parsing delivery receipt
    at org.jsmpp.bean.DeliveryReceipt.<init>(DeliveryReceipt.java:80) ~[jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.util.DefaultDecomposer.deliveryReceipt(DefaultDecomposer.java:394) ~[jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.util.DefaultDecomposer.deliveryReceipt(DefaultDecomposer.java:404) ~[jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.bean.DefaultDeliveryReceiptStripper.strip(DefaultDeliveryReceiptStripper.java:36) ~[jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.bean.DefaultDeliveryReceiptStripper.strip(DefaultDeliveryReceiptStripper.java:27) ~[jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.bean.DeliverSm.getDeliveryReceipt(DeliverSm.java:53) ~[jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.bean.DeliverSm.getShortMessageAsDeliveryReceipt(DeliverSm.java:40) ~[jsmpp-2.1.0-RELEASE.jar:na]
    at com.sigtec.dispatcher8.smsa.MessageReceiptHandler.onAcceptDeliverSm(MessageReceiptHandler.java:27) ~[smsa-1.0.jar:na]
    at org.jsmpp.session.SMPPSession.fireAcceptDeliverSm(SMPPSession.java:457) [jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.session.SMPPSession.access$400(SMPPSession.java:92) [jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.session.SMPPSession$ResponseHandlerImpl.processDeliverSm(SMPPSession.java:474) [jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.session.state.SMPPSessionBoundRX.processDeliverSm0(SMPPSessionBoundRX.java:109) [jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.session.state.SMPPSessionBoundTRX.processDeliverSm(SMPPSessionBoundTRX.java:42) [jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:81) [jsmpp-2.1.0-RELEASE.jar:na]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_17]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_17]
    at java.lang.Thread.run(Thread.java:722) [na:1.7.0_17]
Caused by: java.lang.IllegalArgumentException: No enum constant 
org.jsmpp.util.DeliveryReceiptState.FAILED
    at java.lang.Enum.valueOf(Enum.java:236) ~[na:1.7.0_17]
    at org.jsmpp.util.DeliveryReceiptState.getByName(DeliveryReceiptState.java:60) ~[jsmpp-2.1.0-RELEASE.jar:na]
    at org.jsmpp.bean.DeliveryReceipt.<init>(DeliveryReceipt.java:74) ~[jsmpp-2.1.0-RELEASE.jar:na]
    ... 16 common frames omitted

What version of the product are you using? On what operating system?

2.1.0-RELEASE

Windows Server 2008

Original issue reported on code.google.com by peter.be...@gmail.com on 19 Sep 2013 at 5:38