我开发 smpp 客户端,当我一次又一次收到 InvalidResponseException 时,我的堆栈跟踪增加:
org.jsmpp.extra.NegativeResponseException: Negative response 0000000f found
at org.jsmpp.session.AbstractSession.validateResponse(AbstractSession.java:162)
at org.jsmpp.session.AbstractSession.executeSendCommand(AbstractSession.java:203)
at org.jsmpp.session.SMPPSession.sendBind(SMPPSession.java:143)
at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:86)
at com.sms.client.gw.Gateway.newSession(Gateway.java:107)
at com.sms.client.gw.Gateway.getSession(Gateway.java:81)
at com.sms.client.gw.Gateway.access$300(Gateway.java:33)
at com.sms.client.gw.Gateway$SessionStateListenerImpl.onStateChange(Gateway.java:196)
at org.jsmpp.session.AbstractSessionContext.fireStateChanged(AbstractSessionContext.java:69)
at org.jsmpp.session.SMPPSessionContext.changeState(SMPPSessionContext.java:44)
at org.jsmpp.session.AbstractSessionContext.close(AbstractSessionContext.java:58)
at org.jsmpp.session.SMPPSessionContext.close(SMPPSessionContext.java:10)
at org.jsmpp.session.AbstractSession.close(AbstractSession.java:141)
然后增加了堆栈跟踪:
org.jsmpp.extra.NegativeResponseException: Negative response 0000000f found
at org.jsmpp.session.AbstractSession.validateResponse(AbstractSession.java:162)
at org.jsmpp.session.AbstractSession.executeSendCommand(AbstractSession.java:203)
at org.jsmpp.session.SMPPSession.sendBind(SMPPSession.java:143)
at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:86)
at com.sms.client.gw.Gateway.newSession(Gateway.java:107)
at com.sms.client.gw.Gateway.getSession(Gateway.java:81)
at com.sms.client.gw.Gateway.access$300(Gateway.java:33)
at com.sms.client.gw.Gateway$SessionStateListenerImpl.onStateChange(Gateway.java:196)
at org.jsmpp.session.AbstractSessionContext.fireStateChanged(AbstractSessionContext.java:69)
at org.jsmpp.session.SMPPSessionContext.changeState(SMPPSessionContext.java:44)
at org.jsmpp.session.AbstractSessionContext.close(AbstractSessionContext.java:58)
at org.jsmpp.session.SMPPSessionContext.close(SMPPSessionContext.java:10)
at org.jsmpp.session.AbstractSession.close(AbstractSession.java:141)
at org.jsmpp.session.SMPPSession.connectAndBind(SMPPSession.java:100)
at com.sms.client.gw.Gateway.newSession(Gateway.java:107)
at com.sms.client.gw.Gateway.getSession(Gateway.java:81)
at com.sms.client.gw.Gateway.access$300(Gateway.java:33)
at com.sms.client.gw.Gateway$SessionStateListenerImpl.onStateChange(Gateway.java:196)
at org.jsmpp.session.AbstractSessionContext.fireStateChanged(AbstractSessionContext.java:69)
at org.jsmpp.session.SMPPSessionContext.changeState(SMPPSessionContext.java:44)
at org.jsmpp.session.AbstractSessionContext.close(AbstractSessionContext.java:58)
at org.jsmpp.session.SMPPSessionContext.close(SMPPSessionContext.java:10)
at org.jsmpp.session.AbstractSession.close(AbstractSession.java:141)
at org.jsmpp.session.SMPPSession$EnquireLinkSender.run(SMPPSession.java:394)
而且越来越大。怎么可能?为什么堆栈跟踪会累积?在响应之间,我将 SMPPSessionContext 变量设置为 null,并将 SMPPSession 设置为 null