mscic94 / jsmpp

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

org.jsmpp.PDUStringException: C-Octet String value 'System ID' cannot more than 9. Actual length of string is 9 #143

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm reciving this error when trying to connect :
[main] INFO org.jsmpp.session.SMPPSession - Connected
[main] ERROR org.jsmpp.session.SMPPSession - Failed sending bind command
org.jsmpp.PDUStringException: C-Octet String value 'System ID' cannot more than 
9. Actual length of string is 9
    at org.jsmpp.util.StringValidator.validateString(StringValidator.java:36)
    at org.jsmpp.util.DefaultComposer.bind(DefaultComposer.java:68)
    at org.jsmpp.DefaultPDUSender.sendBind(DefaultPDUSender.java:91)
    at org.jsmpp.SynchronizedPDUSender.sendBind(SynchronizedPDUSender.java:88)
    at org.jsmpp.session.BindCommandTask.executeTask(BindCommandTask.java:59)
    at org.jsmpp.session.AbstractSession.executeSendCommand(AbstractSession.java:248)
    at org.jsmpp.session.SMPPSession.sendBind(SMPPSession.java:294)
    at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:232)
    at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:200)
    at smppclient.SMPPClient.main(SMPPClient.java:122)
java.io.IOException: Failed sending bind since some string parameter area 
invalid : C-Octet String value 'System ID' cannot more than 9. Actual length of 
string is 9
[Thread-1] INFO org.jsmpp.session.SMPPSession - Starting PDUReaderWorker with 
processor degree:3 ...
[Thread-1] INFO org.jsmpp.session.SMPPSession - PDUReaderWorker stop

Very unclear error, what can I do?

Original issue reported on code.google.com by eric.itz...@gmail.com on 14 Aug 2013 at 2:24

GoogleCodeExporter commented 9 years ago
I tried changing the String to OctetString, but that didn't work as in 
BindParameter expects String

Original comment by eric.itz...@gmail.com on 14 Aug 2013 at 2:29

GoogleCodeExporter commented 9 years ago
I added a Github pull request [1] to fix this issue. Please review and apply 
the change and close this issue afterwards.

[1] https://github.com/uudashr/jsmpp/pull/23

Best,
Christian

Original comment by christia...@gmail.com on 2 Sep 2013 at 5:22

GoogleCodeExporter commented 9 years ago
Yes correct. The error message unclear.
Max 9 COctet String would result max 8 character on java string.

"In the case of all C-Octet String formats, the maximum field size is shown as 
a combination of string length and the NULL terminator, i.e., an 8-character 
C-Octet String is encoded in 9 octets when the NULL terminator is included."

Please use the string less than 9, the patch are on going.
Thanks for the report.

Original comment by uuda...@gmail.com on 4 Sep 2013 at 12:45

GoogleCodeExporter commented 9 years ago

Original comment by uuda...@gmail.com on 12 Sep 2013 at 1:27