Brett Sealey | 1 Dec 2002 01:49

Re: ContentEncodingHandler problem Jetty 4.2.2

Morten, sorry for the delay... Today I had a look at this and found that 
the ContentEncodingHandler is broken at present for HTTP/1.1

The technical details are that the the Handler is setting up a compression 
stream before the chunking output stream is established. Its OutputStream 
is then rudely replaced by the chunking OutputStream.

This happens because the order of notifications to Observers is in the 
reverse of their addition. The HttpConnection was registered first and 
hence gets called last to set up the chunking, this in effect discards the 
contents of the original stream, and even if it was careful to preserve the 
stream it would still have probably lost the gzip headers.

Brett

On Tue, 26 Nov 2002, moa_arosii wrote:

> Hi
> 
> I have a problem with setting up the ContentEncodingHandler in the
> newest Jetty (4.2.2). And after having fought with my own settings for
> some time, I found a place in the demo-settings where the
> ContentEncodingHandler is used (/demo/images/powered.png). If I try to
> access this URL I will get the stacktrace at the bottom of this text,
> on the server (the error happens both if I am using Mozilla 1.2b and
> IE5.5) and an empty picture in my browser.
> 
> I then tried to install an older Jetty (4.1.1) and in this the demo
> works fine for the powered.png file. So I think that either something
> broke between these two releases or that the syntax for setting up the
(Continue reading)

Greg Matthews | 1 Dec 2002 10:54
Picon
Picon

HttpSessionListener

All,
 
Is there a way to get access to a session just before it gets removed?
 
I was previously using Orion and it seems it may have been treating the session slightly different to Jetty.
 
In Orion, I could still access the HttpSession when the sessionDestroyed() method was called on a HttpSessionListener.
 
Under Jetty, I seem to be getting an IllegalStateException if I call any methods on the HttpSession once the sessionDestroyed() method has been fired.
 
Thanks,
Greg.


For the latest information about Jetty, please see http://jetty.mortbay.org



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Jules Gosnell | 1 Dec 2002 12:09

Re: HttpSessionListener

Greg Matthews wrote:
> All,
>  
> Is there a way to get access to a session just before it gets removed?
>  
> I was previously using Orion and it seems it may have been treating the 
> session slightly different to Jetty.
>  
> In Orion, I could still access the HttpSession when the 
> sessionDestroyed() method was called on a HttpSessionListener.
>  
> Under Jetty, I seem to be getting an IllegalStateException if I call any 
> methods on the HttpSession once the sessionDestroyed() method has been 
> fired.

This is correct behaviour - the 2.4 spec says :

sessionDestroyed(HttpSessionEvent)
public void sessionDestroyed(HttpSessionEvent se)
Notification that a session was invalidated.

Note the use of the past tense.

You can get notification of an attribute being unbound (if what you are 
actually trying to do is manage the lifecycle of a resource bound into 
the session) using an HttpSessionBindingListener.

Jules

>  
> Thanks,
> Greg.
> 
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> <http://rd.yahoo.com/M=237459.2675695.4055211.2225243/D=egroupweb/S=1705375618:HM/A=1267611/R=0/*http://ad.doubleclick.net/jump/N2524.Yahoo/B1071650;sz=300x250;ord=1038736464633037?>
> 
> 
> For the latest information about Jetty, please see http://jetty.mortbay.org
> 
> 
> 
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
> <http://docs.yahoo.com/info/terms/>.

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM
---------------------------------------------------------------------~->

For the latest information about Jetty, please see http://jetty.mortbay.org

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Greg Wilkins | 2 Dec 2002 01:16
Gravatar

Re: HttpSessionListener


JSR154 are talking about changing this so that it is called before
the session is destroyed - as some major containers don't implement the
spec.

Unless there is popular outrage.... I plan to implement the 2.3 spec in
the version that supports 2.3.   Eventually we'll make this an option for
the notification to be before or after and the default will change in the
version that supports 2.4

cheers

Jules Gosnell wrote:> Greg Matthews wrote:
> 
>>All,
>> 
>>Is there a way to get access to a session just before it gets removed?
>> 
>>I was previously using Orion and it seems it may have been treating the 
>>session slightly different to Jetty.
>> 
>>In Orion, I could still access the HttpSession when the 
>>sessionDestroyed() method was called on a HttpSessionListener.
>> 
>>Under Jetty, I seem to be getting an IllegalStateException if I call any 
>>methods on the HttpSession once the sessionDestroyed() method has been 
>>fired.
> 
> 
> This is correct behaviour - the 2.4 spec says :
> 
> sessionDestroyed(HttpSessionEvent)
> public void sessionDestroyed(HttpSessionEvent se)
> Notification that a session was invalidated.
> 
> Note the use of the past tense.
> 
> You can get notification of an attribute being unbound (if what you are 
> actually trying to do is manage the lifecycle of a resource bound into 
> the session) using an HttpSessionBindingListener.
> 
> Jules
> 
> 
> 
>> 
>>Thanks,
>>Greg.
>>
>>*Yahoo! Groups Sponsor*
>>ADVERTISEMENT
>><http://rd.yahoo.com/M=237459.2675695.4055211.2225243/D=egroupweb/S=1705375618:HM/A=1267611/R=0/*http://ad.doubleclick.net/jump/N2524.Yahoo/B1071650;sz=300x250;ord=1038736464633037?>
>>
>>
>>For the latest information about Jetty, please see http://jetty.mortbay.org
>>
>>
>>
>>Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
>><http://docs.yahoo.com/info/terms/>.
> 
> 
> 
> 
> 
> 
> For the latest information about Jetty, please see http://jetty.mortbay.org
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 

--

-- 
Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
Mort Bay Consulting Australia and UK.          http://www.mortbay.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM
---------------------------------------------------------------------~->

For the latest information about Jetty, please see http://jetty.mortbay.org

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Greg Wilkins | 2 Dec 2002 01:19
Gravatar

Re: Looking for servlet container for a "limited" machine


Best way to find out is to try it!

But Jetty should be pretty OK on that spec machine.  Until recently
the jetty.mortbay.org machine was running on a 486 with only 32MB of memory
and it was a mail and ftp server as well - it handled several listings on
slashdot OK!

cheers

PS.  JSP and lightweight are not good things to mention together!
But you can try jasper1 (from older jetty's ) where precompilation worked OK.

plax1200 wrote:> I have a limited laptop that I want to use for as a servlet container
> for small Java servlet projects. A 486 with 24 MB RAM and 500 MB hard 
> drive running Debian 3.0. I have tried Catalina 4.x and it was way to 
> slow. Tomcat 3.3.2 was much better, but still very slow. 
> 
> I have three questions - 
> 
> 1. Will Jetty provide better performance than tomcat 3.x on such a 
> limited machine?
> 
> 2. Can you recommend a small, lightweight servlet container that I 
> can use for servlets and JSP for my "resource challenged" machine?
> 
> 3. Does Jetty run with OpenBSD or FreeBSD?
> 
> Thanks!
> 
> Mark Phillips
> 
> 
> 
> For the latest information about Jetty, please see http://jetty.mortbay.org
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 

--

-- 
Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
Mort Bay Consulting Australia and UK.          http://www.mortbay.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM
---------------------------------------------------------------------~->

For the latest information about Jetty, please see http://jetty.mortbay.org

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Greg Wilkins | 2 Dec 2002 01:31
Gravatar

Re: WAR file warnings at startup


This rather cryptic message is just saying that jetty cannot determine a
file based classpath - so anything that needs it (ie JSP) will not work.

It can be safely ignored if you have no other problems.

I'll try to improve the message (and may it not a warning).

cheers

placson wrote:> Does anybody know why the following message is being displayed?
> 
>  WARNING: No File Classpath from URL path
> "jar:file:/nfs/home/patrick/src/bes/j2ee/webapps/bes.war!/WEB-INF/classes/"
> 
> I'm deploying my web applicaion as a .WAR file, but when I deploy it
> in expanded form this message does not appear.  Does it have to do
> with setting a classpath in the MANIFEST.mf?
> 
> -Patrick
> 
> 
> 
> For the latest information about Jetty, please see http://jetty.mortbay.org
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 

--

-- 
Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
Mort Bay Consulting Australia and UK.          http://www.mortbay.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM
---------------------------------------------------------------------~->

For the latest information about Jetty, please see http://jetty.mortbay.org

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Greg Wilkins | 2 Dec 2002 01:44
Gravatar

Re: pool's threads in org.mortbay.http.SocketChannelListener


Piotr,

because of the servlet spec, no servlet container can really use
NIO.  The best you can do is to try to use nio for unfiltered static
content or to move idle connections to a select set.

The Jetty SocketChannelListener puts idle connections in a select
set - but the overhead of changing the select set all the time is
greater than any NIO savings.   So the result is slower than a
normal SocketListener... but it uses fewer threads for the same
handled load.

cheers

Piotr D. Kaczorowski wrote:> Hello,
> 
>   Is there any reason to set MinThreads and MaxThreads in
> SocketChannelListenner? I don't know much about SocketChannelListenner
> architecture, but I think that this is one-thread solution for http
> server.
> 
> To remind you, in default jetty.xml you can find:
> 
>  <Call name="addListener">
>     <Arg>
>       <New class="org.mortbay.http.SocketChannelListener">
> 	<Set name="Port"><SystemProperty name="jetty.port" default="8888"/></Set>
> 	<Set name="MinThreads">5</Set>
> 	<Set name="MaxThreads">500</Set>
> 	<Set name="MaxIdleTimeMs">30000</Set>
> 	</New>
>     </Arg>
>   </Call>
> 
> 
> 
> Best regards,
> 
> Piotr Kaczorowski
> 
> 
> 
> 
> For the latest information about Jetty, please see http://jetty.mortbay.org
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 

--

-- 
Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
Mort Bay Consulting Australia and UK.          http://www.mortbay.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM
---------------------------------------------------------------------~->

For the latest information about Jetty, please see http://jetty.mortbay.org

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Greg Wilkins | 2 Dec 2002 01:53
Gravatar

Re: How to set up CGI servlet in code?


And that ServletException is????? (stack trace etc.)

cheers

Chris Bailey wrote:> Delayed reaction :)  I turned on -DDEBUG and what I see is that the response
> is a ServletException.  The GET looks ok, and the CGI is in place.  I must
> have the configuration of the servlet wrong somehow?
> 
> 
>>-----Original Message-----
>>From: Greg Wilkins [mailto:gregw <at> mortbay.com]
>>Sent: Tuesday, November 19, 2002 12:48 AM
>>To: jetty-support <at> yahoogroups.com; chris <at> codeintensity.com
>>Subject: Re: [jetty-support] How to set up CGI servlet in code?
>>
>>
>>
>>Is there an exception that comes with that 503?
>>Can you turn debug on and see one?
>>
>>cheers
>>
>>
>>Chris Bailey wrote:> I seem to not understand how to set up the
>>CGI servlet in code (as opposed
>>
>>>to an XML config file).  I have a "cgi-bin" directory off my
>>
>>web app's root
>>
>>>directory.  In that I have a few .cgi files (mostly Perl
>>
>>scripts, but some
>>
>>>shell scripts).  This is on Linux, Jetty 4.2.1.
>>>
>>>I essentially have:
>>>
>>>server.addContext("/cgi-bin/*");
>>>context.addServlet("CGI", "*.cgi", "org.mortbay.servlet.CGI");
>>>
>>>I try to use URL's like: http://mydomain/cgi-bin/cgifilename.cgi
>>>
>>>I get a 503.  I've tried other context and pathspec settings, but having
>>>found a successful combo yet.  Can someone show me the correct
>>
>>way to code
>>
>>>this?
>>>
>>>__
>>>Chris Bailey       mailto:chris <at> codeintensity.com
>>>Code Intensity     http://www.codeintensity.com
>>>
>>>
>>>
>>>For the latest information about Jetty, please see
>>
> http://jetty.mortbay.org
> 
>>
>>
>>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>>
> 
> 
> 
> 
> --
> Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
> Mort Bay Consulting Australia and UK.          http://www.mortbay.com
> 

--

-- 
Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
Mort Bay Consulting Australia and UK.          http://www.mortbay.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM
---------------------------------------------------------------------~->

For the latest information about Jetty, please see http://jetty.mortbay.org

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Chris Bailey | 2 Dec 2002 05:59

RE: How to set up CGI servlet in code?

Oh, sorry, there is no stacktrace.

I guess I'll have to see if I can get it working with an XML config file
since I've seen examples of that, and then try to see how that differs.

> -----Original Message-----
> From: Greg Wilkins [mailto:gregw <at> mortbay.com]
> Sent: Sunday, December 01, 2002 4:53 PM
> To: Chris Bailey
> Cc: jetty-support <at> yahoogroups.com
> Subject: Re: [jetty-support] How to set up CGI servlet in code?
>
>
>
> And that ServletException is????? (stack trace etc.)
>
> cheers
>
>
> Chris Bailey wrote:> Delayed reaction :)  I turned on -DDEBUG and
> what I see is that the response
> > is a ServletException.  The GET looks ok, and the CGI is in
> place.  I must
> > have the configuration of the servlet wrong somehow?
> >
> >
> >>-----Original Message-----
> >>From: Greg Wilkins [mailto:gregw <at> mortbay.com]
> >>Sent: Tuesday, November 19, 2002 12:48 AM
> >>To: jetty-support <at> yahoogroups.com; chris <at> codeintensity.com
> >>Subject: Re: [jetty-support] How to set up CGI servlet in code?
> >>
> >>
> >>
> >>Is there an exception that comes with that 503?
> >>Can you turn debug on and see one?
> >>
> >>cheers
> >>
> >>
> >>Chris Bailey wrote:> I seem to not understand how to set up the
> >>CGI servlet in code (as opposed
> >>
> >>>to an XML config file).  I have a "cgi-bin" directory off my
> >>
> >>web app's root
> >>
> >>>directory.  In that I have a few .cgi files (mostly Perl
> >>
> >>scripts, but some
> >>
> >>>shell scripts).  This is on Linux, Jetty 4.2.1.
> >>>
> >>>I essentially have:
> >>>
> >>>server.addContext("/cgi-bin/*");
> >>>context.addServlet("CGI", "*.cgi", "org.mortbay.servlet.CGI");
> >>>
> >>>I try to use URL's like: http://mydomain/cgi-bin/cgifilename.cgi
> >>>
> >>>I get a 503.  I've tried other context and pathspec settings,
> but having
> >>>found a successful combo yet.  Can someone show me the correct
> >>
> >>way to code
> >>
> >>>this?
> >>>
> >>>__
> >>>Chris Bailey       mailto:chris <at> codeintensity.com
> >>>Code Intensity     http://www.codeintensity.com
> >>>
> >>>
> >>>------------------------ Yahoo! Groups Sponsor
> ---------------------~-->
> >>>Get 128 Bit SSL Encryption!
> >>>http://us.click.yahoo.com/JjlUgA/vN2EAA/xGHJAA/CefplB/TM
> >>>---------------------------------------------------------------
> ------~->
> >>>
> >>>For the latest information about Jetty, please see
> >>
> > http://jetty.mortbay.org
> >
> >>
> >>
> >>Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
>>
>
>
>
>
> --
> Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
> Mort Bay Consulting Australia and UK.          http://www.mortbay.com
>

--
Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
Mort Bay Consulting Australia and UK.          http://www.mortbay.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM
---------------------------------------------------------------------~->

For the latest information about Jetty, please see http://jetty.mortbay.org

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 

Greg Wilkins | 2 Dec 2002 11:20
Gravatar

Re: Using HTTP 1.0 or turn off chunking.


You can avoid chunking in a response if you find some other
way of indicating the content length.

You can do this simply by setting a content length - if you know it
or if you don't- then set "Connection: close" as a header, which will
close the connection to indicate the end of the response.

cheers

cmyersnbt wrote:> We are currently running into an issue where we need to either
> (1) turn off the chunked output streams or (2) revert to HTTP 1.0.
> 
> After looking through the docs on mortbay's web site, I attempted to 
> configure chunkingForced to false in jboss-service.xml in the jetty-
> plugin.sar   
> 
> However, if jetty received a HTTP 1.1 request it would still chunk it.
> 
> So, can I turn off chunking entirely or can I force all the responses 
> to occur in HTTP 1.0
> 
> Currently, I am running Jetty with JBoss 3.0.0 on Win2k using jdk 
> 1.3.1_03.
> 
> Any assistance would be greatly appreciated.
> 
> Thanks,
> Chris
> 
> 
> 
> For the latest information about Jetty, please see http://jetty.mortbay.org
> 
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 

--

-- 
Greg Wilkins<gregw <at> mortbay.com>             Phone/fax: +44 7092063462
Mort Bay Consulting Australia and UK.          http://www.mortbay.com

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/CefplB/TM
---------------------------------------------------------------------~->

For the latest information about Jetty, please see http://jetty.mortbay.org

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 


Gmane