Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Setting "asyncSupported" in ServletHolder.java

Hi Greg,

I don't think this is the full story. If I execute the following with
jetty-9.2.0.v20140526 it works just fine:

        WebAppContext webapp = new WebAppContext();
        webapp.setContextPath("/");
        webapp.setResourceBase("/tmp/foo");
        ServletHolder sh = new ServletHolder();
        sh.setClassName("org.eclipse.jetty.servlets.CGI");
        sh.setAsyncSupported(true);
        webapp.addServlet(sh, "/cgi-bin/*");


Where /tmp/foo contains:

    cgi-bin/hello.sh


Perhaps you have some filters specified in your web.xml that do not
have asyncSupported=true?

Can you post your full web.xml and any other setup that you might have
(eg jetty or context xml files?).

thanks
Jan

On 9 June 2014 14:44, Greg Johnson <greg.johnson@xxxxxxxxxxxxxxx> wrote:
> hi, in ServletHolder.java.handel() @ around line 744 there is:
>
>  if (!isAsyncSupported())
>                baseRequest.setAsyncSupported(false);
>
> should this be just "baseRequest.setAsyncSupported(isAsyncSupported);” ?
>
> otherwise it seems it's not possible to set aysncSupported to true for a servlet in ServeltHolder via xml,
>
> e.g.  when deploying horde.org on jetty 9.2.0.v20140526 with:
> <Configure id="hordeContext" class="org.eclipse.jetty.webapp.WebAppContext">
>  <Set name="contextPath">/horde</Set>
>  <Set name="resourceBase">/usr/local/share/horde</Set>
>  <Call name="addServlet">
>    <Arg>
>      <New class="org.eclipse.jetty.servlet.ServletHolder">
>        <Arg><New class="org.eclipse.jetty.servlets.CGI"/></Arg>
>        <Set name="asyncSupported">true</Set>
>      </New>
>    </Arg>
>    <Arg>*.php:/rpc.php/*:/services/ajax.php/*</Arg>
>  </Call>
> </Configure>
>
> horde fails with:
> java.lang.IllegalStateException: !asyncSupported
>         at org.eclipse.jetty.server.Request.startAsync(Request.java:2063)
>         at org.eclipse.jetty.servlets.CGI.exec(CGI.java:349)
>
> after making the above “baseRequest.setAsyncSupported(isAsyncSupported);” change to “ServletHolder.java”,  horde.org runs without error.
>
> if my analysis is correct, i’m happy to add a bug and provide a patch.
>
> regards, greg johnson
>
>
>
> _______________________________________________
> jetty-dev mailing list
> jetty-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/jetty-dev



-- 
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
'Expert Jetty/CometD developer,production,operations advice'


Back to the top