Discussion:
A bug? Unexpected end of file from server
ChengQian
2012-12-10 08:22:08 UTC
Permalink
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
2012-12-10 08:46:23 UTC
Permalink
Can you provide details how you access the remote API?
Can you share the code that you use?
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?
Do you have a full stacktrace here? Do you set X-Stream:true, what kind of query are you running?
--
--
ChengQian
2012-12-10 09:05:37 UTC
Permalink
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写道
Post by Michael Hunger
Can you provide details how you access the remote API?
Can you share the code that you use?
Post by ChengQian
Exception in thread "main"
Unexpected end of file from server
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)
Post by ChengQian
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at
com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
Post by ChengQian
at
com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
Post by ChengQian
at
com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
Post by ChengQian
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)
Post by ChengQian
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:766)
Post by ChengQian
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1064)
Post by ChengQian
at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:249)
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
Post by ChengQian
... 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;
Post by ChengQian
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
Post by ChengQian
OutOfMemory: Java Heap Space.
Anyone knows the solutions?
Do you have a full stacktrace here? Do you set X-Stream:true, what kind of
query are you running?
Post by ChengQian
--
--
Michael Hunger
2012-12-10 10:08:47 UTC
Permalink
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
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写道
Can you provide details how you access the remote API?
Can you share the code that you use?
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?
Do you have a full stacktrace here? Do you set X-Stream:true, what kind of query are you running?
--
--
--
ChengQian
2012-12-11 01:33:03 UTC
Permalink
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写道
Post by Michael Hunger
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
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写道
Post by Michael Hunger
Can you provide details how you access the remote API?
Can you share the code that you use?
Post by ChengQian
Exception in thread "main"
Unexpected end of file from server
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)
Post by ChengQian
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at
com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
Post by ChengQian
at
com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
Post by ChengQian
at
com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
Post by ChengQian
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)
Post by ChengQian
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:766)
Post by ChengQian
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1064)
Post by ChengQian
at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:249)
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
Post by ChengQian
... 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;
Post by ChengQian
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
Post by ChengQian
OutOfMemory: Java Heap Space.
Anyone knows the solutions?
Do you have a full stacktrace here? Do you set X-Stream:true, what kind
of query are you running?
Post by ChengQian
--
--
--
Michael Hunger
2012-12-11 02:29:51 UTC
Permalink
Can you try to start the server with bin/neo4j console ?

To see any issues.

Michael
Post by ChengQian
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写道
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
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写道
Can you provide details how you access the remote API?
Can you share the code that you use?
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?
Do you have a full stacktrace here? Do you set X-Stream:true, what kind of query are you running?
--
--
--
--
ChengQian
2012-12-11 04:20:59 UTC
Permalink
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ÐŽµÀ£º
Post by Michael Hunger
Can you try to start the server with bin/neo4j console ?
To see any issues.
Michael
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ÐŽµÀ£º
Post by Michael Hunger
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
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ÐŽµÀ£º
Post by Michael Hunger
Can you provide details how you access the remote API?
Can you share the code that you use?
Post by ChengQian
Exception in thread "main"
Unexpected end of file from server
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:151)
Post by ChengQian
at com.sun.jersey.api.client.Client.handle(Client.java:648)
at
com.sun.jersey.api.client.WebResource.handle(WebResource.java:680)
Post by ChengQian
at
com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74)
Post by ChengQian
at
com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:507)
Post by ChengQian
at NeoRemoteTest.main(NeoRemoteTest.java:27)
Caused by: java.net.SocketException: Unexpected end of file from
server
Post by ChengQian
at
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:769)
Post by ChengQian
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at
sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:766)
Post by ChengQian
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632)
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1064)
Post by ChengQian
at
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:373)
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:249)
Post by ChengQian
at
com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:149)
Post by ChengQian
... 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;
Post by ChengQian
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
Post by ChengQian
OutOfMemory: Java Heap Space.
Anyone knows the solutions?
Do you have a full stacktrace here? Do you set X-Stream:true, what kind
of query are you running?
Post by ChengQian
--
--
--
--
ChengQian
2012-12-10 09:46:57 UTC
Permalink
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.

--
ChengQian
2012-12-11 07:29:37 UTC
Permalink
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?

--

Loading...