sanoopsivan / jsmpp

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

NullPointerException while receving message using org.jsmpp.examples.SMPPServerSimulator #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Run the org.jsmpp.examples.SMPPServerSimulator
2. Send SMS using org.jsmpp.examples.SimpleSubmitExample
3.

What is the expected output? What do you see instead?
SMS should be displayed on SMPPserverSimulator console
instead a NullPointerException is seen

Exception in thread "main" java.lang.NullPointerException
    at
org.jsmpp.session.AbstractSessionContext.fireStateChanged(AbstractSessionContext
.java:65)
    at
org.jsmpp.session.SMPPServerSessionContext.changeState(SMPPServerSessionContext.
java:37)
    at
org.jsmpp.session.AbstractSessionContext.open(AbstractSessionContext.java:28)
    at org.jsmpp.session.SMPPServerSession.<init>(SMPPServerSession.java:91)
    at org.jsmpp.session.SMPPServerSession.<init>(SMPPServerSession.java:72)
    at
org.jsmpp.session.SMPPServerSessionListener.accept(SMPPServerSessionListener.jav
a:145)
    at org.jsmpp.examples.SMPPServerSimulator.run(SMPPServerSimulator.java:65)
    at org.jsmpp.examples.SMPPServerSimulator.main(SMPPServerSimulator.java:189)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

What version of the product are you using? On what operating system?
jsmpp-2.0b_03-src

Please provide any additional information below.
Seems that a null reference is added to the sessionstatelistener in
AbstractSessionContext class. Adding null check at line 65 resolved the
issue. The check must be while adding the Session state listener. Null
listener should not be added

Original issue reported on code.google.com by paliwala...@gmail.com on 20 Aug 2008 at 11:33

GoogleCodeExporter commented 8 years ago
Changing this function in org.jsmpp.session.AbstractSessionContext will help

public void addSessionStateListener(SessionStateListener l) {
        if(l != null) {
            sessionStateListeners.add(l);
        }
}

Original comment by paliwala...@gmail.com on 20 Aug 2008 at 11:36

GoogleCodeExporter commented 8 years ago
It's already been fixed on revision 167. Please checkout from the repository.

Original comment by uuda...@gmail.com on 21 Aug 2008 at 2:51