You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Daniel Kretz <Da...@quintec.de> on 2015/12/08 12:49:29 UTC

Tomcat closes a websocket connection with an error

Hi Tomcat Team,

 

for a customer we build a HTML5 websocket application with Tomcat 8.0.29.

If we start the application from our network or from our home network all
works fine. But if the customer starts the application from his network,
after a certain time the websocket stops with a error. This can happen after
5 or 20 Minutes.

We have tested it with and without SSL and on two different servers. Only in
the customer network the connection breaks with a error.

We also make a test with an websocket echo example which is included in
Tomcat. the same as with our websocket. After a certain time the websocket
stops with a error. But only if we start the application from the customer
network.

 

When the echo example stops with an error the following message will written
in  server.log

 

08-Dec-2015 10:20:37.757 SEVERE [http-apr-8081-exec-2]
org.apache.tomcat.websocket.pojo.PojoEndpointBase.onError No error handling
configured for [websocket.echo.EchoAnnotation] and the following error
occurred

java.io.IOException: Unexpected error [730,054] reading data from the
APR/native socket [1,639,490,672] with wrapper
[org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@231e01e4:1639490672
].

        at
org.apache.coyote.http11.upgrade.AprServletInputStream.doRead(AprServletInpu
tStream.java:133)

        at
org.apache.coyote.http11.upgrade.AbstractServletInputStream.read(AbstractSer
vletInputStream.java:124)

        at
org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServ
er.java:51)

        at
org.apache.tomcat.websocket.server.WsHttpUpgradeHandler$WsReadListener.onDat
aAvailable(WsHttpUpgradeHandler.java:183)

        at
org.apache.coyote.http11.upgrade.AbstractServletInputStream.onDataAvailable(
AbstractServletInputStream.java:198)

        at
org.apache.coyote.http11.upgrade.AbstractProcessor.upgradeDispatch(AbstractP
rocessor.java:96)

        at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstrac
tProtocol.java:669)

        at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.jav
a:2500)

        at
org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:
2489)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)

        at
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.ja
va:61)

        at java.lang.Thread.run(Unknown Source)

 

If we starts the test on http://www.websocket.org/echo.html in the customer
network, the connection will not stop with an error. 

 

For me it looks like a problem with Tomcat. But what can I do to make it run
properly?

 

Tomcat: 8.0.29 (also with earlier versions)

Windows 7: 64 Bit

Protocol: HTTP/1.1

 

 

Regards,

Daniel


Re: AW: Tomcat closes a websocket connection with an error

Posted by Mark Thomas <ma...@apache.org>.
On 09/12/2015 10:13, Daniel Kretz wrote:
> Thanks for your answer.
> 
> But if it is a firewall, that drops the connection, why not for the
> websocket ws://echo.websocket.org which is not hosted on a Tomcat server?
> What has this websocket what the websocket on a tomcat server not have?

Regular pings?

> I would agree with you if the connection of other websockets will also
> dropped.

The counter argument also applies. If the app works on your network,
what does the client's network do that yours doesn't?

Mark


> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Mark Thomas [mailto:markt@apache.org] 
> Gesendet: Dienstag, 8. Dezember 2015 13:35
> An: Tomcat Users List
> Betreff: Re: Tomcat closes a websocket connection with an error
> 
> On 08/12/2015 11:49, Daniel Kretz wrote:
>> We have tested it with and without SSL and on two different servers.
>> Only in the customer network the connection breaks with a error.
> 
> <snip/>
> 
>> 08-Dec-2015 10:20:37.757 SEVERE [http-apr-8081-exec-2] 
>> org.apache.tomcat.websocket.pojo.PojoEndpointBase.onError No error 
>> handling configured for [websocket.echo.EchoAnnotation] and the 
>> following error occurred
>>
>> java.io.IOException: Unexpected error [730,054] reading data from the 
>> APR/native socket [1,639,490,672] with wrapper 
>>
> [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@231e01e4:1639490672
> ].
> 
> Take that error code and subtract 720,000 to give 10054 which is the OS
> error message.
> 
> Google that and you get "Connection reset by peer"
> 
> i.e., the client dropped the connection. There is nothing Tomcat can do
> about that.
> 
> <snip/>
> 
>> If we starts the test on http://www.websocket.org/echo.html in the 
>> customer network, the connection will not stop with an error.
>>
>> For me it looks like a problem with Tomcat. But what can I do to make 
>> it run properly?
> 
> Interesting. Looks more like a network issue to me. Maybe a firewall
> dropping connections after a set period.
> 
> Mark
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


AW: Tomcat closes a websocket connection with an error

Posted by Daniel Kretz <Da...@quintec.de>.
Thanks for your answer.

But if it is a firewall, that drops the connection, why not for the
websocket ws://echo.websocket.org which is not hosted on a Tomcat server?
What has this websocket what the websocket on a tomcat server not have?

I would agree with you if the connection of other websockets will also
dropped.


-----Ursprüngliche Nachricht-----
Von: Mark Thomas [mailto:markt@apache.org] 
Gesendet: Dienstag, 8. Dezember 2015 13:35
An: Tomcat Users List
Betreff: Re: Tomcat closes a websocket connection with an error

On 08/12/2015 11:49, Daniel Kretz wrote:
> We have tested it with and without SSL and on two different servers.
> Only in the customer network the connection breaks with a error.

<snip/>

> 08-Dec-2015 10:20:37.757 SEVERE [http-apr-8081-exec-2] 
> org.apache.tomcat.websocket.pojo.PojoEndpointBase.onError No error 
> handling configured for [websocket.echo.EchoAnnotation] and the 
> following error occurred
> 
> java.io.IOException: Unexpected error [730,054] reading data from the 
> APR/native socket [1,639,490,672] with wrapper 
>
[org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@231e01e4:1639490672
].

Take that error code and subtract 720,000 to give 10054 which is the OS
error message.

Google that and you get "Connection reset by peer"

i.e., the client dropped the connection. There is nothing Tomcat can do
about that.

<snip/>

> If we starts the test on http://www.websocket.org/echo.html in the 
> customer network, the connection will not stop with an error.
> 
> For me it looks like a problem with Tomcat. But what can I do to make 
> it run properly?

Interesting. Looks more like a network issue to me. Maybe a firewall
dropping connections after a set period.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org





Re: Tomcat closes a websocket connection with an error

Posted by Mark Thomas <ma...@apache.org>.
On 08/12/2015 11:49, Daniel Kretz wrote:
> We have tested it with and without SSL and on two different servers.
> Only in the customer network the connection breaks with a error.

<snip/>

> 08-Dec-2015 10:20:37.757 SEVERE [http-apr-8081-exec-2]
> org.apache.tomcat.websocket.pojo.PojoEndpointBase.onError No error
> handling configured for [websocket.echo.EchoAnnotation] and the
> following error occurred
> 
> java.io.IOException: Unexpected error [730,054] reading data from the
> APR/native socket [1,639,490,672] with wrapper
> [org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@231e01e4:1639490672].

Take that error code and subtract 720,000 to give 10054 which is the OS
error message.

Google that and you get "Connection reset by peer"

i.e., the client dropped the connection. There is nothing Tomcat can do
about that.

<snip/>

> If we starts the test on http://www.websocket.org/echo.html in the
> customer network, the connection will not stop with an error.
> 
> For me it looks like a problem with Tomcat. But what can I do to make it
> run properly?

Interesting. Looks more like a network issue to me. Maybe a firewall
dropping connections after a set period.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org