[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
org.eclnt.client.comm.http.DataTransferException: java.net.SocketException: Unexpected end of file f  XML
Forum Index -> Development
Author Message
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

Hi,

we are using longpolling in our project to get frontend reaction on data changes. This works fine, but occasionally the client logs something like this.

Code:
2012:08:16 16:04:10:489 | 14     | WARNING  | Error occurred when communicating to server: <a href="http://localhost:9100/smaragd.tcm.server/cclongpolling/cclongpolling_1345114264302_3.cclongpolling;jsessionid=B2922BEB481F8C544DAD8C59CB4185B4" target="_blank" rel="nofollow">http://localhost:9100/smaragd.tcm.server/cclongpolling/cclongpolling_1345114264302_3.cclongpolling;jsessionid=B2922BEB481F8C544DAD8C59CB4185B4</a> .......... org.eclnt.client.comm.http.DataTransfer>readBytesFromURL
 2012:08:16 16:04:10:489 | 14     | WARNING  | Problem occurred during communication. Continuing to poll .......... org.eclnt.client.elements.impl.LONGPOLLINGElement$PollingThread>run
 .......... Stacktrace Info ..........
 org.eclnt.client.comm.http.DataTransferException: java.net.SocketException: Unexpected end of file from server
 	at org.eclnt.client.comm.http.DataTransfer.readBytesFromURL(DataTransfer.java:408)
 	at org.eclnt.client.comm.http.DataTransfer.readBytesFromURL(DataTransfer.java:366)
 	at org.eclnt.client.elements.impl.LONGPOLLINGElement$PollingThread.run(LONGPOLLINGElement.java:72)
 Caused by: java.net.SocketException: Unexpected end of file from server
 	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:774)
 	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
 	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:771)
 	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
 	at org.eclnt.client.comm.http.DataTransfer.readBytesFromURL(DataTransfer.java:524)
 	at org.eclnt.client.comm.http.DataTransfer.readBytesFromURL(DataTransfer.java:386)
 	... 2 more
 2012:08:16 16:04:10:991 | 14     | INFO     | Starting communication: /cclongpolling/cclongpolling_1345114264302_3.cclongpolling;jsessionid=B2922BEB481F8C544DAD8C59CB4185B4 .......... org.eclnt.client.elements.impl.LONGPOLLINGElement$PollingThread>run
 2012:08:16 16:04:10:991 | 14     | INFO     | Reading remote file <a href="http://localhost:9100/smaragd.tcm.server/cclongpolling/cclongpolling_1345114264302_3.cclongpolling;jsessionid=B2922BEB481F8C544DAD8C59CB4185B4" target="_blank" rel="nofollow">http://localhost:9100/smaragd.tcm.server/cclongpolling/cclongpolling_1345114264302_3.cclongpolling;jsessionid=B2922BEB481F8C544DAD8C59CB4185B4</a> .......... org.eclnt.client.comm.http.DataTransfer>readBytesFromURL
 2012:08:16 16:04:23:460 | 12     | WARNING  | Error occurred when communicating to server: <a href="http://localhost:9100/smaragd.tcm.server/cclongpolling/cclongpolling_1345110254544_1.cclongpolling;jsessionid=AC16712609CE7AC98B0AD753195EE275" target="_blank" rel="nofollow">http://localhost:9100/smaragd.tcm.server/cclongpolling/cclongpolling_1345110254544_1.cclongpolling;jsessionid=AC16712609CE7AC98B0AD753195EE275</a> .......... org.eclnt.client.comm.http.DataTransfer>readBytesFromURL
 2012:08:16 16:04:23:460 | 12     | WARNING  | Problem occurred during communication. Continuing to poll .......... org.eclnt.client.elements.impl.LONGPOLLINGElement$PollingThread>run
 .......... Stacktrace Info ..........
 org.eclnt.client.comm.http.DataTransferException: java.net.SocketException: Unexpected end of file from server
 	at org.eclnt.client.comm.http.DataTransfer.readBytesFromURL(DataTransfer.java:408)
 	at org.eclnt.client.comm.http.DataTransfer.readBytesFromURL(DataTransfer.java:366)
 	at org.eclnt.client.elements.impl.LONGPOLLINGElement$PollingThread.run(LONGPOLLINGElement.java:72)
 Caused by: java.net.SocketException: Unexpected end of file from server
 	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:774)
 	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
 	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:771)
 	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:633)
 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
 	at org.eclnt.client.comm.http.DataTransfer.readBytesFromURL(DataTransfer.java:524)
 	at org.eclnt.client.comm.http.DataTransfer.readBytesFromURL(DataTransfer.java:386)
 	... 2 more
 2012:08:16 16:04:23:961 | 12     | INFO     | Starting communication: /cclongpolling/cclongpolling_1345110254544_1.cclongpolling;jsessionid=AC16712609CE7AC98B0AD753195EE275 .......... org.eclnt.client.elements.impl.LONGPOLLINGElement$PollingThread>run
 2012:08:16 16:04:23:961 | 12     | INFO     | Reading remote file <a href="http://localhost:9100/smaragd.tcm.server/cclongpolling/cclongpolling_1345110254544_1.cclongpolling;jsessionid=AC16712609CE7AC98B0AD753195EE275" target="_blank" rel="nofollow">http://localhost:9100/smaragd.tcm.server/cclongpolling/cclongpolling_1345110254544_1.cclongpolling;jsessionid=AC16712609CE7AC98B0AD753195EE275</a> .......... org.eclnt.client.comm.http.DataTransfer>readBytesFromURL
 


The server log says nothing but:
Code:
2012:08:16 16:04:10:997 | 77     | INFO     | LONGPOLLING: current number of threads is 31, (true)
 2012:08:16 16:04:10:997 | 77     | INFO     | LongPollingServlet called via http-request
 2012:08:16 16:04:10:998 | 77     | INFO     | Now waiting for event to wakeup this long polling thread
 2012:08:16 16:04:23:965 | 78     | INFO     | LONGPOLLING: current number of threads is 32, (true)
 2012:08:16 16:04:23:966 | 78     | INFO     | LongPollingServlet called via http-request


Thats all what was logged by the client at this point of time.

In the server log I also found the following at a point of time when nothing is going on in the client log:
Code:
2012:08:16 15:54:10:631 | 74     | INFO     | LONGPOLLING: current number of threads is 30, (true)
 2012:08:16 15:54:10:631 | 74     | INFO     | LongPollingServlet called via http-request
 2012:08:16 15:54:10:631 | 74     | INFO     | Finish thread with error
 2012:08:16 15:54:10:631 | 74     | INFO     | Now waiting for event to wakeup this long polling thread
 2012:08:16 15:54:10:631 | 41     | INFO     | Event woke up this thread
 2012:08:16 15:54:10:631 | 41     | INFO     | Error occurred when falling to sleep.
 .......... Stacktrace Info ..........
 java.lang.Error: Thread was aborted via abort-method
 	at org.eclnt.jsfserver.polling.DefaultLongPolling.waitForEvent(DefaultLongPolling.java:101)
 	at org.eclnt.jsfserver.polling.LongPollingServlet.doGet(LongPollingServlet.java:164)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
 	at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:123)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 	at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:168)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
 	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 2012:08:16 15:54:10:632 | 41     | INFO     | LONGPOLLING: current number of threads is 29, (false)
 2012:08:16 15:54:23:608 | 75     | INFO     | LONGPOLLING: current number of threads is 30, (true)
 2012:08:16 15:54:23:608 | 75     | INFO     | LongPollingServlet called via http-request
 2012:08:16 15:54:23:608 | 75     | INFO     | Finish thread with error
 2012:08:16 15:54:23:608 | 75     | INFO     | Now waiting for event to wakeup this long polling thread
 2012:08:16 15:54:23:608 | 30     | INFO     | Event woke up this thread
 2012:08:16 15:54:23:608 | 30     | INFO     | Error occurred when falling to sleep.
 .......... Stacktrace Info ..........
 java.lang.Error: Thread was aborted via abort-method
 	at org.eclnt.jsfserver.polling.DefaultLongPolling.waitForEvent(DefaultLongPolling.java:101)
 	at org.eclnt.jsfserver.polling.LongPollingServlet.doGet(LongPollingServlet.java:164)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
 	at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:123)
 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
 	at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:168)
 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
 	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 	at java.lang.Thread.run(Thread.java:662)
 2012:08:16 15:54:23:609 | 30     | INFO     | LONGPOLLING: current number of threads is 29, (false)


Does anybody have any idea what is going on in these scenarios?

Are the two Frontend and server log excerpts related to or independent from each other?

Thanks,

Björn
bthalheim

Power User

Joined: 05/04/2012 11:45:24
Messages: 72
Offline

Hi,

ok, maybe I rephrase my Question: If _you_ use longpollig, please let me know: have you ever seen this kind of log errors?

Thanks,

Björn
CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5555
Offline

Hi,

hmm, I personally have not seen this log output personally. ...but:

The long polling mechanism is programmed very fault tolerant - i.e. when the client calls the long polling URL it really "expects" that something may go wrong, knowing that calling a URL and waiting for the response quite a long time may bring up any type of communication error.

We log these errors as WARNINGs only - so if something weird happens on application side or if the log is completely full with these messages, there is something to take a look at...

In other words: if the application is fine and the system is fine on server side (e.g. number of threads does not increase constantly), then I would not worry about these message.

Regards, Björn

Björn Müller, CaptainCasa GmbH
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team