|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
[Fwd: Re: [Winstone-devel] Winstone and DWR]DWR folks,
I got the mail below from a user of DWR who was trying to deploy to the Winstone Servlet Container and hit some problems. In researching why it failed, I've found out that the DWR framework (the version they were using anyway) is actually violating JSR-154 Servlet Spec section SVR8.2 which says: "SRV.8.2 Using a Request Dispatcher To use a request dispatcher, a servlet calls either the include method or forward method of the RequestDispatcher interface. The parameters to these methods can be either the request and response arguments that were passed in via the service method of the javax.servlet interface, or instances of subclasses of the request and response wrapper classes that were introduced for version 2.3 of the specification. In the latter case, the wrapper instances must wrap the request or response objects that the container passed into the service method." Notice the last sentence ... the reason Winstone fails is because DWR passes in a response to the request dispatcher forward() that *doesn't* wrap the winstone response it was supplied with. Winstone tries to unwrap the response until it gets back to its initial response, but stops at the SwallowingHttpServletResponse class because it doesn't extend ServletResponseWrapper. Winstone assumes that when it runs out of wrappers, it must be the original response (as the spec requires). DWR is violating the spec here by passing in a response of its own. Interestingly though, on checking the DWR CVS repository, it looks like this class has been removed. Should I be advising the user to upgrade DWR ? Thanks in advance for your help, Rick Knowles -------- Original Message -------- keda jones wrote: > Hello All, > > I am starting to use winstone in a > small project that I am working on and so far it has been very clean to work with. I ran in to some trouble, though, when I started using winstone in association with DWR ajax library (http://getahead.ltd.uk/dwr/). Specifically, I have encountered the class cast error below. It seems that DWR manufactures a ServletResponse that is not based on a WinstoneResponse. > > > WARN uk.ltd.getahead.dwr.impl.ExecuteQuery: warn() - Method execution failed: > java.lang.ClassCastException: uk.ltd.getahead.dwr.util.SwallowingHttpServletResponse > at winstone.RequestDispatcher.getUnwrappedResponse(RequestDispatcher.java:444) > at winstone.RequestDispatcher.forward(RequestDispatcher.java:268) > at uk.ltd.getahead.dwr.impl.DefaultWebContext.forwardToString(DefaultWebContext.java:124) > at com.XXX.webform.util.AjaxUtil.buildPrecacheMap(AjaxUtil.java:57) > at com.XXX.webform.util.AjaxUtil.ajaxTrToggle(AjaxUtil.java:43) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:239) > at uk.ltd.getahead.dwr.impl.DefaultExecProcessor.handle(DefaultExecProcessor.java:48) > at uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:81) > at uk.ltd.getahead.dwr.AbstractDWRServlet.doPost(AbstractDWRServlet.java:162) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:121) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) > at winstone.ServletConfiguration.execute(ServletConfiguration.java:249) > at winstone.RequestDispatcher.forward(RequestDispatcher.java:334) > at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244) > at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150) > at java.lang.Thread.run(Unknown Source) > > > I have not looked at detail in to the code yet, but if anybody could give me any ideas of how this might be fixed, I would appreciate it. > > > Thanks, > Nathan > > > > > > ____________________________________________________________________________________ > Want to start your own business? > Learn how on Yahoo! Small Business. > http://smallbusiness.yahoo.com/r-index > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Winstone-devel mailing list > Winstone-devel@... > https://lists.sourceforge.net/lists/listinfo/winstone-devel > -- Servlet v2.5 container in a single 166KB jar file ? Try Winstone (http://winstone.sourceforge.net/) -- Servlet v2.5 container in a single 166KB jar file ? Try Winstone (http://winstone.sourceforge.net/) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
|
|
Re: [Fwd: Re: [Winstone-devel] Winstone and DWR]OK I see the class now, it still exists but appears to have been fixed,
although it contains the following clearly wrong comment in the header. /** * Used by ExecutionContext to forward results back via javascript. * <p>We could like to implement {@link HttpServletResponse}, but there is a bug * in WebLogic where it casts to a {@link HttpServletResponseWrapper} so we * need to extend that. * @author Joe Walker [joe at getahead dot ltd dot uk] */ Weblogic is in fact correct in requiring it to extend the wrapper class, as the spec comment in the previous mail illustrates. It has to do with the requirements on the container for handling dispatcher includes - these make the SRV8.2 requirements necessary. Not worth getting into detail, suffice to say it's not a bug in any case. In any case, I'll advise the user to upgrade to v1.1.4, since that's what your CVS release tag says on this change. Thanks. Rick Knowles Rick Knowles wrote: > DWR folks, > > I got the mail below from a user of DWR who was trying to deploy to > the Winstone Servlet Container and hit some problems. In researching > why it failed, I've found out that the DWR framework (the version they > were using anyway) is actually violating JSR-154 Servlet Spec section > SVR8.2 which says: > > "SRV.8.2 Using a Request Dispatcher > To use a request dispatcher, a servlet calls either the include method > or forward method of the RequestDispatcher interface. The parameters > to these > methods can be either the request and response arguments that were > passed in via the > service method of the javax.servlet interface, or instances of > subclasses of the > request and response wrapper classes that were introduced for version > 2.3 of the > specification. In the latter case, the wrapper instances must wrap the > request or response > objects that the container passed into the service method." > > Notice the last sentence ... the reason Winstone fails is because DWR > passes in a response to the request dispatcher forward() that *doesn't* > wrap the winstone response it was supplied with. Winstone tries to > unwrap the response until it gets back to its initial response, but > stops at the SwallowingHttpServletResponse class because it doesn't > extend ServletResponseWrapper. Winstone assumes that when it runs out of > wrappers, it must be the original response (as the spec requires). DWR > is violating the spec here by passing in a response of its own. > > Interestingly though, on checking the DWR CVS repository, it looks > like this class has been removed. Should I be advising the user to > upgrade DWR ? > > Thanks in advance for your help, > > Rick Knowles > > -------- Original Message -------- > > keda jones wrote: >> Hello All, >> >> I am starting to use winstone in a >> small project that I am working on and so far it has been very clean >> to work with. I ran in to some trouble, though, when I started using >> winstone in association with DWR ajax library >> (http://getahead.ltd.uk/dwr/). Specifically, I have encountered the >> class cast error below. It seems that DWR manufactures a >> ServletResponse that is not based on a WinstoneResponse. >> >> >> WARN uk.ltd.getahead.dwr.impl.ExecuteQuery: warn() - Method >> execution failed: >> java.lang.ClassCastException: >> uk.ltd.getahead.dwr.util.SwallowingHttpServletResponse >> at >> winstone.RequestDispatcher.getUnwrappedResponse(RequestDispatcher.java:444) >> >> at >> winstone.RequestDispatcher.forward(RequestDispatcher.java:268) >> at >> uk.ltd.getahead.dwr.impl.DefaultWebContext.forwardToString(DefaultWebContext.java:124) >> >> at >> com.XXX.webform.util.AjaxUtil.buildPrecacheMap(AjaxUtil.java:57) >> at com.XXX.webform.util.AjaxUtil.ajaxTrToggle(AjaxUtil.java:43) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown >> Source) >> at java.lang.reflect.Method.invoke(Unknown Source) >> at >> uk.ltd.getahead.dwr.impl.ExecuteQuery.execute(ExecuteQuery.java:239) >> at >> uk.ltd.getahead.dwr.impl.DefaultExecProcessor.handle(DefaultExecProcessor.java:48) >> >> at >> uk.ltd.getahead.dwr.impl.DefaultProcessor.handle(DefaultProcessor.java:81) >> >> at >> uk.ltd.getahead.dwr.AbstractDWRServlet.doPost(AbstractDWRServlet.java:162) >> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:121) >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:45) >> at >> winstone.ServletConfiguration.execute(ServletConfiguration.java:249) >> at >> winstone.RequestDispatcher.forward(RequestDispatcher.java:334) >> at >> winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244) >> >> at >> winstone.RequestHandlerThread.run(RequestHandlerThread.java:150) >> at java.lang.Thread.run(Unknown Source) >> >> >> I have not looked at detail in to the code yet, but if anybody >> could give me any ideas of how this might be fixed, I would >> appreciate it. >> >> >> Thanks, >> Nathan >> >> >> >> >> >> ____________________________________________________________________________________ >> >> Want to start your own business? >> Learn how on Yahoo! Small Business. >> http://smallbusiness.yahoo.com/r-index >> >> ------------------------------------------------------------------------- >> >> Take Surveys. Earn Cash. Influence the Future of IT >> Join SourceForge.net's Techsay panel and you'll get the chance to >> share your >> opinions on IT & business topics through brief surveys-and earn cash >> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV >> >> _______________________________________________ >> Winstone-devel mailing list >> Winstone-devel@... >> https://lists.sourceforge.net/lists/listinfo/winstone-devel >> > -- Servlet v2.5 container in a single 166KB jar file ? Try Winstone (http://winstone.sourceforge.net/) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@... For additional commands, e-mail: dev-help@... |
| Free Forum Powered by Nabble | Forum Help |