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

NullPointer in ServerRunnable #270

Closed
aaqibkhan opened this issue Jan 1, 2016 · 6 comments
Closed

NullPointer in ServerRunnable #270

aaqibkhan opened this issue Jan 1, 2016 · 6 comments

Comments

@aaqibkhan
Copy link

I am on NanoHttpd v2.2.0.
It was working nicely for couple of weeks until recently I started getting this error suddenly.

java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.FileDescriptor.setInt$(int)' on a null object reference at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:93) at java.net.ServerSocket.implAccept(ServerSocket.java:216) at java.net.ServerSocket.accept(ServerSocket.java:140) at fi.iki.elonen.NanoHTTPD$ServerRunnable.run(NanoHTTPD.java:1570) at java.lang.Thread.run(Thread.java:818)

@ritchieGitHub ritchieGitHub added this to the 2.3.0 milestone Jan 29, 2016
@ritchieGitHub
Copy link
Member

This is a timing issue, should be fixed in the SNAPSHOT, could you try that?

@ritchieGitHub
Copy link
Member

assumed working, if not please reopen

@shaobin0604
Copy link

shaobin0604 commented Jul 10, 2016

@ritchieGitHub

I'm using 2.3.0, still have this issue sometimes

07-10 11:30:16.744 23004-23659/com.xxx.client E/AndroidRuntime: FATAL EXCEPTION: NanoHttpd Main Listener
                                                                    Process: com.xxx.client, PID: 23004
                                                                    java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.FileDescriptor.setInt$(int)' on a null object reference
                                                                        at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:93)
                                                                        at java.net.ServerSocket.implAccept(ServerSocket.java:217)
                                                                        at java.net.ServerSocket.accept(ServerSocket.java:141)
                                                                        at fi.iki.elonen.NanoHTTPD$ServerRunnable.run(NanoHTTPD.java:1695)
                                                                        at java.lang.Thread.run(Thread.java:818)

@MrStanaland
Copy link

@shaobin0604

I just ran into this issue and fixed it, so maybe this will help. The problem (for me) was Splunk Mint, whose documentation states the following: "Currently, there are known compatibility issues with network monitoring and certain external libraries such as OkHttp, resulting in crashes. Splunk is currently working on this issue, but until it is resolved, disable network monitoring entirely if you experience this issue"

The full documentation is here:
http://docs.splunk.com/Documentation/MintAndroidSDK/5.1.x/DevGuide/Disablenetworkmonitoring

To fix the problem, I had to disable Splunk Mint network monitoring:
Mint.disableNetworkMonitoring();
Mint.initAndStartSession(MyActivity.this, "YOUR_API_KEY");

@dmsherazi
Copy link

I confirm that the above solution by @MrStanaland works ...

Thanks @MrStanaland for sharing this...

@bhumikash-tech
Copy link

@MrStanaland can you please tell me where to add :
Mint.disableNetworkMonitoring();
Mint.initAndStartSession(MyActivity.this, "YOUR_API_KEY");

I didn't get this. I will be really grateful if you help.
Thanks

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

6 participants