Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] ConnectHandler issue

Hi,
first of all: happy new year !!!


i use embedded jetty 7.5.3 as a servlet container (with webapphandler) & proxy (which tunnel http via CONNECT to itself)
i'm using customized ConnectHandler to tunnel https-traffic (via CONNECT  from client which use jetty as proxy server). the customized connecthandler just add some custom-checking to decide if it should connect to 127.0.0.1:[ssl_port_of_jetty] or to outside world, the rest is copy-paste.

everything works fine until i try to do some file-uploads which is > ~ 1.5MB to the webapp (smaller files work fine, which is strange), 
switch between nio & io connector doesnt change

trace :

java.nio.channels.ClosedChannelException
    at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:135)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)
    at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:239)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:323)
    at de.app.proxy.handlers.ConnectHandlerNIO.write(ConnectHandlerNIO.java:601)
    at de.app.proxy.handlers.ConnectHandlerNIO$ClientToProxyConnection.handle(ConnectHandlerNIO.java:929)
    at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:245)
    at org.eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.java:663)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
    at java.lang.Thread.run(Thread.java:680)
de.app.proxy.handlers.ConnectHandlerNIO$ClientToProxyConnection@3ad6a0e0: end reading from client
handle failed?
java.nio.channels.ClosedChannelException
    at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(SocketChannelImpl.java:135)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:324)
    at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:239)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:323)
    at de.app.proxy.handlers.ConnectHandlerNIO.write(ConnectHandlerNIO.java:601)
    at de.app.proxy.handlers.ConnectHandlerNIO$ClientToProxyConnection.handle(ConnectHandlerNIO.java:929)
    at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:245)
    at org.eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.java:663)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
    at java.lang.Thread.run(Thread.java:680)


what could be the reason for this broken-connection ?
as long as i remember with jetty 7.3.x i didn't have this problem

thanx for the hints

and i got a lot of this exception log:

java.net.SocketException: Socket is closed
        at java.net.Socket.shutdownOutput(Unknown Source)
        at org.eclipse.jetty.io.bio.SocketEndPoint.shutdownOutput(SocketEndPoint.java:103)
        at de.app.proxy.handlers.ConnectHandlerNIO$ClientToProxyConnection.shutdownOutput(ConnectHandlerNIO.java:1019)
        at de.app.proxy.handlers.ConnectHandlerNIO$ProxyToServerConnection.handle(ConnectHandlerNIO.java:689)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
        at java.lang.Thread.run(Unknown Source)



kimi

Back to the top