Apparently responding in Nabble did not carry over all of my content in <raw> tags. So here's another attempt:
This is a very late response - among other delays there was some work in the SiteMesh community to make SiteMesh3 asynchronous, which will get around some of the issues. Unfortunately I'm still finding a similar problem now when working through this situation.
I've updated to Jetty 9.2.3.v20140905
The project is a Jetty Proxy with a SiteMesh filter. Trying to decorate proxied content.
When I use AsyncProxyServlet$Transparent as the servlet in web.xml I receive the following error:
2014-10-08 13:43:28.593:WARN:oejh.HttpParser:qtp2070935783-20: badMessage: java.lang.IllegalStateException: too much data after closed for HttpReceiverOverHTTP@55b31984 on HttpConnectionOverHTTP@61505510(l:/127.0.0.1:60231 <-> r:localhost/127.0.0.1:8060)
When I use ProxyServlet$Transparent as the servlet I receive the following stack trace:
2014-10-08 13:46:44.033:WARN:oejs.HttpChannelState:qtp1489294793-22:
java.lang.NullPointerException
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:130)
at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:72)
at org.sitemesh.webapp.WebAppContext.dispatch(WebAppContext.java:168)
at org.sitemesh.webapp.WebAppContext.decorate(WebAppContext.java:143)
at org.sitemesh.BaseSiteMeshContext.decorate(BaseSiteMeshContext.java:39)
at org.sitemesh.webapp.SiteMeshFilter.postProcess(SiteMeshFilter.java:83)
at org.sitemesh.webapp.contentfilter.ContentBufferingFilter.processInternally(ContentBufferingFilter.java:217)
at org.sitemesh.webapp.contentfilter.ContentBufferingFilter$2.onComplete(ContentBufferingFilter.java:175)
at org.eclipse.jetty.server.HttpChannelState.completed(HttpChannelState.java:506)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:421)
at org.eclipse.jetty.server.HttpChannel.run(HttpChannel.java:262)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1173)
at org.eclipse.jetty.server.HttpChannelState.complete(HttpChannelState.java:452)
at org.eclipse.jetty.server.AsyncContextState.complete(AsyncContextState.java:92)
at org.eclipse.jetty.proxy.ProxyServlet.onResponseSuccess(ProxyServlet.java:560)
at org.eclipse.jetty.proxy.ProxyServlet$ProxyResponseListener.onComplete(ProxyServlet.java:815)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:484)
at org.eclipse.jetty.client.HttpReceiver.responseSuccess(HttpReceiver.java:393)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.messageComplete(HttpReceiverOverHTTP.java:255)
at org.eclipse.jetty.http.HttpParser.parseContent(HttpParser.java:1465)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1275)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.parse(HttpReceiverOverHTTP.java:142)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.readAndParse(HttpReceiverOverHTTP.java:107)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.process(HttpReceiverOverHTTP.java:70)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:65)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:75)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:100)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
at java.lang.Thread.run(Thread.java:722)
The NullPointerException now appears to be the same root problem that started this thread, that HttpChannel.getCurrentHttpChannel() returns null in Dispatcher.forward().
protected void forward(ServletRequest request, ServletResponse response, DispatcherType dispatch) throws ServletException, IOException
{
Request baseRequest=(request instanceof Request)?((Request)request):HttpChannel.getCurrentHttpChannel().getRequest();
In both cases I can verify that the proxy request is being made, since it's another application I control, and it's receiving a proper request.
Any suggestions on how to get around either of these problems? Thanks.