Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException in Tomcat environment #38

Open
GoogleCodeExporter opened this issue Oct 9, 2015 · 0 comments
Open

NullPointerException in Tomcat environment #38

GoogleCodeExporter opened this issue Oct 9, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Use JSMPP 2.0.1 in Tomcat 6.0.18 environment
2. Restart the context
3. NullPointerExceptions will start to appear regularely

Stacktrace:
Exception in thread "pool-2-thread-933" java.lang.NullPointerException
    at org.jsmpp.util.PDUByteBuffer.append(PDUByteBuffer.java:97)
    at org.jsmpp.util.PDUByteBuffer.append(PDUByteBuffer.java:115)
    at org.jsmpp.util.PDUByteBuffer.append(PDUByteBuffer.java:135)
    at org.jsmpp.util.PDUByteBuffer.(PDUByteBuffer.java:57)
    at org.jsmpp.util.PDUByteBuffer.(PDUByteBuffer.java:43)
    at 
org.jsmpp.util.DefaultComposer.composeHeader(DefaultComposer.java:50)
    at 
org.jsmpp.util.DefaultComposer.enquireLinkResp(DefaultComposer.java:173)
    at 
org.jsmpp.DefaultPDUSender.sendEnquireLinkResp(DefaultPDUSender.java:169)
    at 
org.jsmpp.SynchronizedPDUSender.sendEnquireLinkResp(SynchronizedPDUSender.j
ava:165)
    at 
org.jsmpp.session.SMPPSession$ResponseHandlerImpl.sendEnquireLinkResp(SMPPS
ession.java:502)
    at 
org.jsmpp.session.state.AbstractGenericSMPPSessionBound.processEnquireLink(
AbstractGenericSMPPSessionBound.java:47)
    at org.jsmpp.session.PDUProcessTask.run(PDUProcessTask.java:61)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.j
ava:886)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:
908)
    at java.lang.Thread.run(Thread.java:619)

These NullPointerExceptions keep appearing, each time from another thread.

CAUSE:
Tomcat sets all static variables to NULL on reloading a context. Because 
the background threads of JSMPP are still alive, they access the variable 
PDUByteBuffer.DEFAULT_CAPACITY_POLICY  which is then NULL.

SOLUTION:
If some method would exist that shuts down all background threadpools, the 
problem would be avoided.




Original issue reported on code.google.com by nathan.b...@gmail.com on 5 Jun 2009 at 2:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant