You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-user@jakarta.apache.org by Scott Sayles <ss...@fgm.com> on 2002/06/22 00:09:56 UTC

Re: [jetty-support] Re: Cactus and Jetty problem

Jules,

Thanks for the reply.  Comments follow.


> 
> It looks as if Jetty is not happy about Cactus having wrapped the request.
> 
> >From the spec it appears that this is illegal in 2.2, but legal in 2.3
> - what version of Jetty are you running ? Against which version of
> Tomcat are you comparing ?
>
I'm running the version of Jetty that is distributed with JBoss 3.0.0. 
I'm not exactly sure what version it is but I suspect it's 4.0.1?  The
version of Tomcat I'm using is also the one distributed with JBoss 3.0.0
which is version 4.0.3.

 
> I guess you must be running a 2.3 container, or the wrapper classes
> would not be present... unless cactus ships with it's own copy....
> 
> I haven't tried Cactus yet - are there any test samples with it that
> would tickle this problem ? - I could add them to a testsuite that I
> am building. It just tests Cocoon and Struts at the moment...
> 

There are some samples in the latest cactus release.  They have specific
versions for what j2ee api version you run against.  Currently, I'm
running jakarta-cactus-13-1.3.  One of the samples,
TestSampleServlet.java, tests a forward.

Let me know if I can be of any further assistence.

Thanks.

Scott


> 
> 
> Jules
> 
> 
> --- In jetty-support@y..., Scott Sayles <ss...@f...> wrote:
> > Hello.
> > 
> > Sorry for the cross-post, but I think this is appropriate for either
> > list.
> > 
> > I'm currently implementing a JSP web application that I intend to deploy
> > in JBoss 3.0.0.  I've been writing unit tests with Cactus and am running
> > into some problems with Jetty (or Cactus, depending upon how you look at
> > it :-p).
> > 
> > The tests send a request to a url that in turn is mapped to a Struts
> > action which ends up forwarding the request.  These tests work fine with
> > Tomcat, but when it's run against Jetty I get the following error:
> > 
> > ------- From the test report --------
> > Error: Does not wrap ServletHttpRequest
> > 
> > java.lang.IllegalArgumentException: Does not wrap ServletHttpRequest
> > at
> >
> org.mortbay.jetty.servlet.ServletHttpRequest.unwrap(ServletHttpRequest.java:859)
> > at org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:182)
> > at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:156)
> > at
> >
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:972)
> > at
> >
> org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:408)
> > at 
> > (... cut ...)
> > --------------------------------------
> > 
> > Apparently, Cactus is using some kind of ServletHttpRequest that Jetty
> > does not like when it tries to do a forward.
> > 
> > hmm....  so this just seems like a change that needs to occur with
> > Cactus or Jetty.  Is this a known issue?  I haven't been able to find a
> > lot of messages related to this, except for the following:
> > 
> > http://groups.yahoo.com/group/jetty-support/message/2987
> > 
> > 
> > Thanks.
> > 
> > Scott
> 
> 
> ------------------------ Yahoo! Groups Sponsor ---------------------~-->
> Free $5 Love Reading
> Risk Free!
> http://us.click.yahoo.com/3PCXaC/PfREAA/Ey.GAA/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/ 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [jetty-support] Re: Cactus and Jetty problem

Posted by Greg Wilkins <gr...@mortbay.com>.
But remember that who ever it is that is wrapping the request
wrong is breaking the spec....   I'm only changing Jetty to be
more accepting!

cheers


Scott Sayles wrote:
> Vincent,
> 
> Thanks for your reply.  Actually, I'm just testing my application which
> is using Struts 1.1.  I see what you are saying, but the strange thing
> is that I can run the application just fine.  If this were a Struts
> specific thing, I would expect the application to bomb.  It's the unit
> tests that are failing on things that require a forward from a Struts
> action (which give the before stated error).
> 
> In any case, it looks like Greg has modified Jetty so that this is
> hopefully no longer an issue.  I plan on giving it a try.
> 
> Thanks.
> 
> Scott
> 
> On Wed, 2002-06-26 at 18:00, Vincent Massol wrote:
> 
>>Hi Scott,
>>
>>Sorry for the late reply. If I understand correctly, you're testing the
>>following (which is in the Cactus sample) :
>>
>>        RequestDispatcher rd = theConfig.getServletContext().
>>            getRequestDispatcher("/test/test.jsp");
>>        rd.forward(theRequest, theResponse);
>>
>>
>>Cactus does indeed wraps theRequest (but not theResponse). The wrapped
>>version is of type org.apache.cactus.server.HttpServletRequestWrapper.
>>However when performing the forward, it is passing the original request
>>:
>>
>>    public void forward(ServletRequest theRequest, ServletResponse
>>theResponse)
>>        throws IOException, ServletException
>>    {
>>        HttpServletRequestWrapper request =
>>            (HttpServletRequestWrapper) theRequest;
>>        this.originalDispatcher.forward(request.getOriginalRequest(),
>>            theResponse);
>>    }
>>
>>(Note: the request.getOriginalRequest()).
>>
>>Thus, I am puzzled ! However, you stack trace shows that Struts is doing
>>a forward so maybe struts is wrapping the request ?
>>
>>Cheers,
>>-Vincent
>>
>>
>>>-----Original Message-----
>>>From: Scott Sayles [mailto:ssayles@fgm.com]
>>>Sent: 21 June 2002 23:10
>>>To: jetty-support@yahoogroups.com
>>>Cc: cactus-user@jakarta.apache.org
>>>Subject: Re: [jetty-support] Re: Cactus and Jetty problem
>>>
>>>Jules,
>>>
>>>Thanks for the reply.  Comments follow.
>>>
>>>
>>>
>>>>It looks as if Jetty is not happy about Cactus having wrapped the
>>>
>>>request.
>>>
>>>>>>From the spec it appears that this is illegal in 2.2, but legal in
>>>
>>2.3
>>
>>>>- what version of Jetty are you running ? Against which version of
>>>>Tomcat are you comparing ?
>>>>
>>>
>>>I'm running the version of Jetty that is distributed with JBoss 3.0.0.
>>>I'm not exactly sure what version it is but I suspect it's 4.0.1?  The
>>>version of Tomcat I'm using is also the one distributed with JBoss
>>
>>3.0.0
>>
>>>which is version 4.0.3.
>>>
>>>
>>>
>>>>I guess you must be running a 2.3 container, or the wrapper classes
>>>>would not be present... unless cactus ships with it's own copy....
>>>>
>>>>I haven't tried Cactus yet - are there any test samples with it that
>>>>would tickle this problem ? - I could add them to a testsuite that I
>>>>am building. It just tests Cocoon and Struts at the moment...
>>>>
>>>
>>>There are some samples in the latest cactus release.  They have
>>
>>specific
>>
>>>versions for what j2ee api version you run against.  Currently, I'm
>>>running jakarta-cactus-13-1.3.  One of the samples,
>>>TestSampleServlet.java, tests a forward.
>>>
>>>Let me know if I can be of any further assistence.
>>>
>>>Thanks.
>>>
>>>Scott
>>>
>>>
>>>
>>>>
>>>>Jules
>>>>
>>>>
>>>>--- In jetty-support@y..., Scott Sayles <ss...@f...> wrote:
>>>>
>>>>>Hello.
>>>>>
>>>>>Sorry for the cross-post, but I think this is appropriate for
>>>>
>>either
>>
>>>>>list.
>>>>>
>>>>>I'm currently implementing a JSP web application that I intend to
>>>>
>>>deploy
>>>
>>>>>in JBoss 3.0.0.  I've been writing unit tests with Cactus and am
>>>>
>>>running
>>>
>>>>>into some problems with Jetty (or Cactus, depending upon how you
>>>>
>>look
>>
>>>at
>>>
>>>>>it :-p).
>>>>>
>>>>>The tests send a request to a url that in turn is mapped to a
>>>>
>>Struts
>>
>>>>>action which ends up forwarding the request.  These tests work
>>>>
>>fine
>>
>>>with
>>>
>>>>>Tomcat, but when it's run against Jetty I get the following error:
>>>>>
>>>>>------- From the test report --------
>>>>>Error: Does not wrap ServletHttpRequest
>>>>>
>>>>>java.lang.IllegalArgumentException: Does not wrap
>>>>
>>ServletHttpRequest
>>
>>>>>at
>>>>>
>>>>
>>org.mortbay.jetty.servlet.ServletHttpRequest.unwrap(ServletHttpRequest.j
>>av
>>
>>>a:859)
>>>
>>>>>at
>>>>
>>org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:182)
>>
>>>>>at
>>>>
>>org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:156)
>>
>>>>>at
>>>>>
>>>>
>>org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
>>a:
>>
>>>972)
>>>
>>>>>at
>>>>>
>>>>
>>org.apache.struts.action.RequestProcessor.processActionForward(RequestPr
>>oc
>>
>>>essor.java:408)
>>>
>>>>>at
>>>>>(... cut ...)
>>>>>--------------------------------------
>>>>>
>>>>>Apparently, Cactus is using some kind of ServletHttpRequest that
>>>>
>>Jetty
>>
>>>>>does not like when it tries to do a forward.
>>>>>
>>>>>hmm....  so this just seems like a change that needs to occur with
>>>>>Cactus or Jetty.  Is this a known issue?  I haven't been able to
>>>>
>>find
>>
>>>a
>>>
>>>>>lot of messages related to this, except for the following:
>>>>>
>>>>>http://groups.yahoo.com/group/jetty-support/message/2987
>>>>>
>>>>>
>>>>>Thanks.
>>>>>
>>>>>Scott
>>>>
>>>>
>>>>------------------------ Yahoo! Groups Sponsor
>>>>
>>>>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/
>>>
>>>>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:   <mailto:cactus-user-
>>>unsubscribe@jakarta.apache.org>
>>>For additional commands, e-mail: <mailto:cactus-user-
>>>help@jakarta.apache.org>
>>
>>
>>
>>
>>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/ 
>>
>>
> 
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor ---------------------~-->
> Free $5 Love Reading
> Risk Free!
> http://us.click.yahoo.com/3PCXaC/PfREAA/Ey.GAA/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<gr...@mortbay.com>                http://www.mortbay.com
Mort Bay Consulting Pty. Ltd. AU.                    +61(0)29977 2395
Mort Bay Consulting Limited. England UK.             +44(0)7092063462


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [jetty-support] Re: Cactus and Jetty problem

Posted by Scott Sayles <ss...@fgm.com>.
Vincent,

Thanks for your reply.  Actually, I'm just testing my application which
is using Struts 1.1.  I see what you are saying, but the strange thing
is that I can run the application just fine.  If this were a Struts
specific thing, I would expect the application to bomb.  It's the unit
tests that are failing on things that require a forward from a Struts
action (which give the before stated error).

In any case, it looks like Greg has modified Jetty so that this is
hopefully no longer an issue.  I plan on giving it a try.

Thanks.

Scott

On Wed, 2002-06-26 at 18:00, Vincent Massol wrote:
> Hi Scott,
> 
> Sorry for the late reply. If I understand correctly, you're testing the
> following (which is in the Cactus sample) :
> 
>         RequestDispatcher rd = theConfig.getServletContext().
>             getRequestDispatcher("/test/test.jsp");
>         rd.forward(theRequest, theResponse);
> 
> 
> Cactus does indeed wraps theRequest (but not theResponse). The wrapped
> version is of type org.apache.cactus.server.HttpServletRequestWrapper.
> However when performing the forward, it is passing the original request
> :
> 
>     public void forward(ServletRequest theRequest, ServletResponse
> theResponse)
>         throws IOException, ServletException
>     {
>         HttpServletRequestWrapper request =
>             (HttpServletRequestWrapper) theRequest;
>         this.originalDispatcher.forward(request.getOriginalRequest(),
>             theResponse);
>     }
> 
> (Note: the request.getOriginalRequest()).
> 
> Thus, I am puzzled ! However, you stack trace shows that Struts is doing
> a forward so maybe struts is wrapping the request ?
> 
> Cheers,
> -Vincent
> 
> > -----Original Message-----
> > From: Scott Sayles [mailto:ssayles@fgm.com]
> > Sent: 21 June 2002 23:10
> > To: jetty-support@yahoogroups.com
> > Cc: cactus-user@jakarta.apache.org
> > Subject: Re: [jetty-support] Re: Cactus and Jetty problem
> > 
> > Jules,
> > 
> > Thanks for the reply.  Comments follow.
> > 
> > 
> > >
> > > It looks as if Jetty is not happy about Cactus having wrapped the
> > request.
> > >
> > > >From the spec it appears that this is illegal in 2.2, but legal in
> 2.3
> > > - what version of Jetty are you running ? Against which version of
> > > Tomcat are you comparing ?
> > >
> > I'm running the version of Jetty that is distributed with JBoss 3.0.0.
> > I'm not exactly sure what version it is but I suspect it's 4.0.1?  The
> > version of Tomcat I'm using is also the one distributed with JBoss
> 3.0.0
> > which is version 4.0.3.
> > 
> > 
> > > I guess you must be running a 2.3 container, or the wrapper classes
> > > would not be present... unless cactus ships with it's own copy....
> > >
> > > I haven't tried Cactus yet - are there any test samples with it that
> > > would tickle this problem ? - I could add them to a testsuite that I
> > > am building. It just tests Cocoon and Struts at the moment...
> > >
> > 
> > There are some samples in the latest cactus release.  They have
> specific
> > versions for what j2ee api version you run against.  Currently, I'm
> > running jakarta-cactus-13-1.3.  One of the samples,
> > TestSampleServlet.java, tests a forward.
> > 
> > Let me know if I can be of any further assistence.
> > 
> > Thanks.
> > 
> > Scott
> > 
> > 
> > >
> > >
> > > Jules
> > >
> > >
> > > --- In jetty-support@y..., Scott Sayles <ss...@f...> wrote:
> > > > Hello.
> > > >
> > > > Sorry for the cross-post, but I think this is appropriate for
> either
> > > > list.
> > > >
> > > > I'm currently implementing a JSP web application that I intend to
> > deploy
> > > > in JBoss 3.0.0.  I've been writing unit tests with Cactus and am
> > running
> > > > into some problems with Jetty (or Cactus, depending upon how you
> look
> > at
> > > > it :-p).
> > > >
> > > > The tests send a request to a url that in turn is mapped to a
> Struts
> > > > action which ends up forwarding the request.  These tests work
> fine
> > with
> > > > Tomcat, but when it's run against Jetty I get the following error:
> > > >
> > > > ------- From the test report --------
> > > > Error: Does not wrap ServletHttpRequest
> > > >
> > > > java.lang.IllegalArgumentException: Does not wrap
> ServletHttpRequest
> > > > at
> > > >
> > >
> >
> org.mortbay.jetty.servlet.ServletHttpRequest.unwrap(ServletHttpRequest.j
> av
> > a:859)
> > > > at
> org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:182)
> > > > at
> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:156)
> > > > at
> > > >
> > >
> >
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
> a:
> > 972)
> > > > at
> > > >
> > >
> >
> org.apache.struts.action.RequestProcessor.processActionForward(RequestPr
> oc
> > essor.java:408)
> > > > at
> > > > (... cut ...)
> > > > --------------------------------------
> > > >
> > > > Apparently, Cactus is using some kind of ServletHttpRequest that
> Jetty
> > > > does not like when it tries to do a forward.
> > > >
> > > > hmm....  so this just seems like a change that needs to occur with
> > > > Cactus or Jetty.  Is this a known issue?  I haven't been able to
> find
> > a
> > > > lot of messages related to this, except for the following:
> > > >
> > > > http://groups.yahoo.com/group/jetty-support/message/2987
> > > >
> > > >
> > > > Thanks.
> > > >
> > > > Scott
> > >
> > >
> > > ------------------------ Yahoo! Groups Sponsor
> > >
> > > 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/
> > >
> > >
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   <mailto:cactus-user-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:cactus-user-
> > help@jakarta.apache.org>
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor ---------------------~-->
> Free $5 Love Reading
> Risk Free!
> http://us.click.yahoo.com/3PCXaC/PfREAA/Ey.GAA/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/ 
> 
> 



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [jetty-support] Re: Cactus and Jetty problem

Posted by Greg Wilkins <gr...@mortbay.com>.
Scott,

I have changed Jetty so that it does not enforce this
part of the specification.  No other container does and it appears
to cause problems.

4.1.D2 has this fix (plus a stupid authentication bug), but CVS head
should be good for this also.

I've downloaded cactus and will be running through their demos and
tests shortly....

cheers



Vincent Massol wrote:
> Hi Scott,
> 
> Sorry for the late reply. If I understand correctly, you're testing the
> following (which is in the Cactus sample) :
> 
>         RequestDispatcher rd = theConfig.getServletContext().
>             getRequestDispatcher("/test/test.jsp");
>         rd.forward(theRequest, theResponse);
> 
> 
> Cactus does indeed wraps theRequest (but not theResponse). The wrapped
> version is of type org.apache.cactus.server.HttpServletRequestWrapper.
> However when performing the forward, it is passing the original request
> :
> 
>     public void forward(ServletRequest theRequest, ServletResponse
> theResponse)
>         throws IOException, ServletException
>     {
>         HttpServletRequestWrapper request =
>             (HttpServletRequestWrapper) theRequest;
>         this.originalDispatcher.forward(request.getOriginalRequest(),
>             theResponse);
>     }
> 
> (Note: the request.getOriginalRequest()).
> 
> Thus, I am puzzled ! However, you stack trace shows that Struts is doing
> a forward so maybe struts is wrapping the request ?
> 
> Cheers,
> -Vincent
> 
> 
>>-----Original Message-----
>>From: Scott Sayles [mailto:ssayles@fgm.com]
>>Sent: 21 June 2002 23:10
>>To: jetty-support@yahoogroups.com
>>Cc: cactus-user@jakarta.apache.org
>>Subject: Re: [jetty-support] Re: Cactus and Jetty problem
>>
>>Jules,
>>
>>Thanks for the reply.  Comments follow.
>>
>>
>>
>>>It looks as if Jetty is not happy about Cactus having wrapped the
>>
>>request.
>>
>>>>>From the spec it appears that this is illegal in 2.2, but legal in
>>
> 2.3
> 
>>>- what version of Jetty are you running ? Against which version of
>>>Tomcat are you comparing ?
>>>
>>
>>I'm running the version of Jetty that is distributed with JBoss 3.0.0.
>>I'm not exactly sure what version it is but I suspect it's 4.0.1?  The
>>version of Tomcat I'm using is also the one distributed with JBoss
> 
> 3.0.0
> 
>>which is version 4.0.3.
>>
>>
>>
>>>I guess you must be running a 2.3 container, or the wrapper classes
>>>would not be present... unless cactus ships with it's own copy....
>>>
>>>I haven't tried Cactus yet - are there any test samples with it that
>>>would tickle this problem ? - I could add them to a testsuite that I
>>>am building. It just tests Cocoon and Struts at the moment...
>>>
>>
>>There are some samples in the latest cactus release.  They have
> 
> specific
> 
>>versions for what j2ee api version you run against.  Currently, I'm
>>running jakarta-cactus-13-1.3.  One of the samples,
>>TestSampleServlet.java, tests a forward.
>>
>>Let me know if I can be of any further assistence.
>>
>>Thanks.
>>
>>Scott
>>
>>
>>
>>>
>>>Jules
>>>
>>>
>>>--- In jetty-support@y..., Scott Sayles <ss...@f...> wrote:
>>>
>>>>Hello.
>>>>
>>>>Sorry for the cross-post, but I think this is appropriate for
>>>
> either
> 
>>>>list.
>>>>
>>>>I'm currently implementing a JSP web application that I intend to
>>>
>>deploy
>>
>>>>in JBoss 3.0.0.  I've been writing unit tests with Cactus and am
>>>
>>running
>>
>>>>into some problems with Jetty (or Cactus, depending upon how you
>>>
> look
> 
>>at
>>
>>>>it :-p).
>>>>
>>>>The tests send a request to a url that in turn is mapped to a
>>>
> Struts
> 
>>>>action which ends up forwarding the request.  These tests work
>>>
> fine
> 
>>with
>>
>>>>Tomcat, but when it's run against Jetty I get the following error:
>>>>
>>>>------- From the test report --------
>>>>Error: Does not wrap ServletHttpRequest
>>>>
>>>>java.lang.IllegalArgumentException: Does not wrap
>>>
> ServletHttpRequest
> 
>>>>at
>>>>
>>>
> org.mortbay.jetty.servlet.ServletHttpRequest.unwrap(ServletHttpRequest.j
> av
> 
>>a:859)
>>
>>>>at
>>>
> org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:182)
> 
>>>>at
>>>
> org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:156)
> 
>>>>at
>>>>
>>>
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
> a:
> 
>>972)
>>
>>>>at
>>>>
>>>
> org.apache.struts.action.RequestProcessor.processActionForward(RequestPr
> oc
> 
>>essor.java:408)
>>
>>>>at
>>>>(... cut ...)
>>>>--------------------------------------
>>>>
>>>>Apparently, Cactus is using some kind of ServletHttpRequest that
>>>
> Jetty
> 
>>>>does not like when it tries to do a forward.
>>>>
>>>>hmm....  so this just seems like a change that needs to occur with
>>>>Cactus or Jetty.  Is this a known issue?  I haven't been able to
>>>
> find
> 
>>a
>>
>>>>lot of messages related to this, except for the following:
>>>>
>>>>http://groups.yahoo.com/group/jetty-support/message/2987
>>>>
>>>>
>>>>Thanks.
>>>>
>>>>Scott
>>>
>>>
>>>------------------------ Yahoo! Groups Sponsor
>>>
>>>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/
>>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:cactus-user-
>>unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:cactus-user-
>>help@jakarta.apache.org>
> 
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor ---------------------~-->
> Free $5 Love Reading
> Risk Free!
> http://us.click.yahoo.com/3PCXaC/PfREAA/Ey.GAA/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<gr...@mortbay.com>                http://www.mortbay.com
Mort Bay Consulting Pty. Ltd. AU.                    +61(0)29977 2395
Mort Bay Consulting Limited. England UK.             +44(0)7092063462


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: [jetty-support] Re: Cactus and Jetty problem

Posted by Vincent Massol <vm...@octo.com>.
Hi Scott,

Sorry for the late reply. If I understand correctly, you're testing the
following (which is in the Cactus sample) :

        RequestDispatcher rd = theConfig.getServletContext().
            getRequestDispatcher("/test/test.jsp");
        rd.forward(theRequest, theResponse);


Cactus does indeed wraps theRequest (but not theResponse). The wrapped
version is of type org.apache.cactus.server.HttpServletRequestWrapper.
However when performing the forward, it is passing the original request
:

    public void forward(ServletRequest theRequest, ServletResponse
theResponse)
        throws IOException, ServletException
    {
        HttpServletRequestWrapper request =
            (HttpServletRequestWrapper) theRequest;
        this.originalDispatcher.forward(request.getOriginalRequest(),
            theResponse);
    }

(Note: the request.getOriginalRequest()).

Thus, I am puzzled ! However, you stack trace shows that Struts is doing
a forward so maybe struts is wrapping the request ?

Cheers,
-Vincent

> -----Original Message-----
> From: Scott Sayles [mailto:ssayles@fgm.com]
> Sent: 21 June 2002 23:10
> To: jetty-support@yahoogroups.com
> Cc: cactus-user@jakarta.apache.org
> Subject: Re: [jetty-support] Re: Cactus and Jetty problem
> 
> Jules,
> 
> Thanks for the reply.  Comments follow.
> 
> 
> >
> > It looks as if Jetty is not happy about Cactus having wrapped the
> request.
> >
> > >From the spec it appears that this is illegal in 2.2, but legal in
2.3
> > - what version of Jetty are you running ? Against which version of
> > Tomcat are you comparing ?
> >
> I'm running the version of Jetty that is distributed with JBoss 3.0.0.
> I'm not exactly sure what version it is but I suspect it's 4.0.1?  The
> version of Tomcat I'm using is also the one distributed with JBoss
3.0.0
> which is version 4.0.3.
> 
> 
> > I guess you must be running a 2.3 container, or the wrapper classes
> > would not be present... unless cactus ships with it's own copy....
> >
> > I haven't tried Cactus yet - are there any test samples with it that
> > would tickle this problem ? - I could add them to a testsuite that I
> > am building. It just tests Cocoon and Struts at the moment...
> >
> 
> There are some samples in the latest cactus release.  They have
specific
> versions for what j2ee api version you run against.  Currently, I'm
> running jakarta-cactus-13-1.3.  One of the samples,
> TestSampleServlet.java, tests a forward.
> 
> Let me know if I can be of any further assistence.
> 
> Thanks.
> 
> Scott
> 
> 
> >
> >
> > Jules
> >
> >
> > --- In jetty-support@y..., Scott Sayles <ss...@f...> wrote:
> > > Hello.
> > >
> > > Sorry for the cross-post, but I think this is appropriate for
either
> > > list.
> > >
> > > I'm currently implementing a JSP web application that I intend to
> deploy
> > > in JBoss 3.0.0.  I've been writing unit tests with Cactus and am
> running
> > > into some problems with Jetty (or Cactus, depending upon how you
look
> at
> > > it :-p).
> > >
> > > The tests send a request to a url that in turn is mapped to a
Struts
> > > action which ends up forwarding the request.  These tests work
fine
> with
> > > Tomcat, but when it's run against Jetty I get the following error:
> > >
> > > ------- From the test report --------
> > > Error: Does not wrap ServletHttpRequest
> > >
> > > java.lang.IllegalArgumentException: Does not wrap
ServletHttpRequest
> > > at
> > >
> >
>
org.mortbay.jetty.servlet.ServletHttpRequest.unwrap(ServletHttpRequest.j
av
> a:859)
> > > at
org.mortbay.jetty.servlet.Dispatcher.dispatch(Dispatcher.java:182)
> > > at
org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:156)
> > > at
> > >
> >
>
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.jav
a:
> 972)
> > > at
> > >
> >
>
org.apache.struts.action.RequestProcessor.processActionForward(RequestPr
oc
> essor.java:408)
> > > at
> > > (... cut ...)
> > > --------------------------------------
> > >
> > > Apparently, Cactus is using some kind of ServletHttpRequest that
Jetty
> > > does not like when it tries to do a forward.
> > >
> > > hmm....  so this just seems like a change that needs to occur with
> > > Cactus or Jetty.  Is this a known issue?  I haven't been able to
find
> a
> > > lot of messages related to this, except for the following:
> > >
> > > http://groups.yahoo.com/group/jetty-support/message/2987
> > >
> > >
> > > Thanks.
> > >
> > > Scott
> >
> >
> > ------------------------ Yahoo! Groups Sponsor
---------------------~-->
> > Free $5 Love Reading
> > Risk Free!
> > http://us.click.yahoo.com/3PCXaC/PfREAA/Ey.GAA/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/
> >
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:cactus-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:cactus-user-
> help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>