A bug? Unexpected end of file from server

2,910 views
Skip to first unread message

ChengQian

unread,
Dec 10, 2012, 3:22:08 AM12/10/12
to ne...@googlegroups.com
When I use  REST api, I met a problem as following is the bug report:
Exception in thread "main" com.sun.jersey.api.client.ClientHandlerException: java.net.SocketException: Unexpected end of file from server
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
at NeoRemoteTest.main(NeoRemoteTest.java:27)
Caused by: java.net.SocketException: Unexpected end of file from server
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:766)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1064)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:249)
at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
... 5 more

It's a simple connection problem. Sometimes I can connect to localhost:7474/db/data but sometimes I can't. then the exception is above;
Is it a bug? can't keep connection in long time? 

Another problem is that how can I accept long data? The case is that when i query a larger graph with REST api, I always can't get returned data. the exception is 
OutOfMemory: Java Heap Space.
Anyone knows the solutions?

Michael Hunger

unread,
Dec 10, 2012, 3:46:23 AM12/10/12
to ne...@googlegroups.com
Can you provide details how you access the remote API?

Am 10.12.2012 um 09:22 schrieb ChengQian:

> When I use REST api, I met a problem as following is the bug report:
Can you share the code that you use?
Do you have a full stacktrace here? Do you set X-Stream:true, what kind of query are you running?
> --
>
>

ChengQian

unread,
Dec 10, 2012, 4:05:37 AM12/10/12
to ne...@googlegroups.com
A simple connection code:

        private static final String ROOT_URI="http://localhost:7474/db/data/";
public static void main(String[] args){
WebResource resource=Client.create()
.resource(ROOT_URI);
ClientResponse response=resource.get(ClientResponse.class);
System.out.println(String.format("Get ON [%s],status code [%d]",ROOT_URI,response.getStatus()));
}
    
       It runs a long time and then report the exception I mentioned
在 2012年12月10日星期一UTC+8下午4时46分23秒,Michael Hunger写道:

ChengQian

unread,
Dec 10, 2012, 4:46:57 AM12/10/12
to ne...@googlegroups.com

Maybe the port 7474 is already in use? But when I change the port in neo4j-server properties file and restart server. it still doesn't work.

Michael Hunger

unread,
Dec 10, 2012, 5:08:47 AM12/10/12
to ne...@googlegroups.com
Can you try to set the accept header to application/json ?

Can you check your servers logfiles in data/log and data/graph.db/messages.log for any exceptions on the server side?

Thanks,

Michael

--
 
 

ChengQian

unread,
Dec 10, 2012, 8:33:03 PM12/10/12
to ne...@googlegroups.com
Yeah,I've tried that but it didn't work.
I check the log file and it only says:  Failed to start Neo Server on port [7474], reason [null]

在 2012年12月10日星期一UTC+8下午6时08分47秒,Michael Hunger写道:

Michael Hunger

unread,
Dec 10, 2012, 9:29:51 PM12/10/12
to ne...@googlegroups.com
Can you try to start the server with bin/neo4j console ?

To see any issues.

Michael

--
 
 

ChengQian

unread,
Dec 10, 2012, 11:20:59 PM12/10/12
to ne...@googlegroups.com
no, in my computer, the bin/neo4j console command doesn't work but the server works well before. recently it occurs that problem.
 If I restart the computer, it then works well again. That's very strange.

在 2012年12月11日星期二UTC+8上午10时29分51秒,Michael Hunger写道:

ChengQian

unread,
Dec 11, 2012, 2:29:37 AM12/11/12
to ne...@googlegroups.com
I may know the reason. When I use some queries which may take much space in memory or even result in outofmemory exception. Then the server down.
Does anyone  meet the same problem? Or how can I solve it?

Reihane Boghrati

unread,
Mar 19, 2014, 4:15:32 PM3/19/14
to ne...@googlegroups.com
Hi Cheng, 

I think I may have the same problem, I'm wondering if you found any solution for that?
Reply all
Reply to author
Forward
0 new messages