Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

DefaultSmppClient#destroy NPE in netty4 branch #88

Open
krasa opened this issue Apr 13, 2015 · 1 comment
Open

DefaultSmppClient#destroy NPE in netty4 branch #88

krasa opened this issue Apr 13, 2015 · 1 comment

Comments

@krasa
Copy link
Contributor

krasa commented Apr 13, 2015

Run com.cloudhopper.smpp.demo.ClientMain without a server:

2015-04-13 17:04:21,110 [nioEventLoopGroup-2-1] TRACE c.c.s.c.SmppClientConnector - channelRegistered
2015-04-13 17:04:21,110 [main] DEBUG c.c.smpp.impl.DefaultSmppClient - Waiting for client connection to /127.0.0.1:2776
2015-04-13 17:04:22,116 [nioEventLoopGroup-2-1] TRACE c.c.s.c.SmppClientConnector - channelUnregistered
2015-04-13 17:04:22,119 [main] WARN  c.c.smpp.impl.DefaultSmppClient - Client did not connect.
java.net.ConnectException: Connection refused: no further information: /127.0.0.1:2776
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.7.0_72]
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739) ~[na:1.7.0_72]
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:208) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:281) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at java.lang.Thread.run(Thread.java:745) ~[na:1.7.0_72]
2015-04-13 17:04:22,120 [main] ERROR c.c.smpp.demo.ClientMain - 
com.cloudhopper.smpp.type.SmppChannelConnectException: Unable to connect to host [127.0.0.1] and port [2776]: Connection refused: no further information: /127.0.0.1:2776
    at com.cloudhopper.smpp.impl.DefaultSmppClient.createConnectedChannel(DefaultSmppClient.java:321) ~[classes/:na]
    at com.cloudhopper.smpp.impl.DefaultSmppClient.doOpen(DefaultSmppClient.java:232) ~[classes/:na]
    at com.cloudhopper.smpp.impl.DefaultSmppClient.bind(DefaultSmppClient.java:201) ~[classes/:na]
    at com.cloudhopper.smpp.demo.ClientMain.main(ClientMain.java:110) ~[test-classes/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_72]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_72]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_72]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_72]
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140) [idea_rt.jar:na]
Caused by: java.net.ConnectException: Connection refused: no further information: /127.0.0.1:2776
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.7.0_72]
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739) ~[na:1.7.0_72]
    at io.netty.channel.socket.nio.NioSocketChannel.doFinishConnect(NioSocketChannel.java:208) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:281) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:528) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) ~[netty-all-4.0.25.Final.jar:4.0.25.Final]
    at java.lang.Thread.run(Thread.java:745) ~[na:1.7.0_72]
2015-04-13 17:04:22,121 [main] INFO  c.c.smpp.demo.ClientMain - Shutting down client bootstrap and executors...
Exception in thread "main" java.lang.NullPointerException
    at com.cloudhopper.smpp.impl.DefaultSmppClient.destroy(DefaultSmppClient.java:153)
    at com.cloudhopper.smpp.demo.ClientMain.main(ClientMain.java:183)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
@jjlauer
Copy link
Contributor

jjlauer commented Apr 17, 2015

That's a nice find. Do you think you would have time to submit a fix and PR?

krasa added a commit to krasa/cloudhopper-smpp that referenced this issue Apr 17, 2015
jjlauer added a commit that referenced this issue Apr 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants