Skip to main content

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

oops sorry, accidently click "send".

i did some experiments with different configurations:

1. sslconnector, WebAppContext:
 a. let WebAppContext handle request (POST multipart, just like bellow) directly: works fine
 b. put a handlerwrapper before WebAppContext, simple like this:

public class UploadHandler extends HandlerWrapper {
    private static final String tmpDir = System.getProperty("");
    private static DiskFileItemFactory ff = new DiskFileItemFactory(20*1024*1024, new File(tmpDir));

    public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String type = baseRequest.getContentType();
        String method = baseRequest.getMethod();
        System.out.println("type:" + type + ", method:" + method);
        if (type != null && type.toLowerCase().contains("multipart/form-data") && method.equals("POST")) {
                ServletFileUpload servlet = new ServletFileUpload(ff);
                servlet.setProgressListener(new ProgressListener() {
                    public void update(long pBytesRead, long pContentLength, int pItems) {
                        System.out.println("parsed:" + pBytesRead);
            try {
                List<FileItem> items = servlet.parseRequest(request);
                 System.out.println("parse done");
            } catch (Exception ex) {
        super.handle(target, baseRequest, request, response);

servlet.parseRequest(request) got stuck at arround 700k before throwing above exception.

2. sslconnector , connecthandler, webappcontext.
sslconnector works as proxyport, connecthandler tunnel CONNECT to sslconnector (so its kinda 2x hanshake/ssl.), request arrives at webappcontext, same problem with servlet.parseRequest(HttpServletRequest), the limit of around 700K seems strange to me.

anyway, is there a better way to handle this situation (tunnel to itself without openning new socket , like wrapping sslendpoint with another sslendpoint, which does the handshake the 2nd time...) ? 

thanx alot

On Wed, Jan 4, 2012 at 1:06 PM, kim young ill <khiemu@xxxxxxxxxxxxxx> wrote:
thanx for your help

i tried the 7.6.0.RC2 but it doesnt help,
    at org.eclipse.jetty.http.HttpParser.blockForContent(

    at org.apache.commons.fileupload.MultipartStream$ItemInputStream.makeAvailable(
    at org.apache.commons.fileupload.MultipartStream$
    at at

    at javax.servlet.http.HttpServlet.service(
    at javax.servlet.http.HttpServlet.service(
    at org.eclipse.jetty.servlet.ServletHolder.handle(
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(

    at org.eclipse.jetty.server.handler.ScopedHandler.handle(
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
    at org.eclipse.jetty.servlet.ServletHandler.doScope(
    at org.eclipse.jetty.server.session.SessionHandler.doScope(
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(

    at org.eclipse.jetty.server.handler.ScopedHandler.handle(
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(
    at org.eclipse.jetty.server.handler.HandlerList.handle(
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
    at org.eclipse.jetty.server.Server.handle(
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(
    at org.eclipse.jetty.http.HttpParser.parseNext(
    at org.eclipse.jetty.http.HttpParser.parseAvailable(
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(

    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
    at org.eclipse.jetty.util.thread.QueuedThreadPool$

i did some expriments with some other configuration:

ssl-connector, webapphandler:

On Tue, Jan 3, 2012 at 11:00 AM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:

On Fri, Dec 30, 2011 at 16:46, kim young ill <khiemu@xxxxxxxxxxxxxx> wrote:
> Hi,
> first of all: happy new year !!!
> i use embedded jetty 7.5.3 as a servlet container

Please update to 7.5.4, as 7.5.3 had a bug where connections where
closed after a while, which seems exactly what you're experiencing.

Finally, no matter how good the architecture and design are,
to deliver bug-free software with optimal performance and reliability,
the implementation technique must be flawless.   Victoria Livschitz
jetty-users mailing list

Back to the top