Wow! Jetty 2.5.1 !? None of the Jetty devs even have access to that old version of Jetty. Its essentially a mythical version of Jetty, lost in the sands of time.
Have you considered upgrading? We're at Jetty 9.1 now ya know. Well over 200 releases since Jetty 2.5.1 -- Joakim Erdfelt <[email protected]> webtide.com <http://www.webtide.com/> - intalio.com/jetty Expert advice, services and support from from the Jetty & CometD experts eclipse.org/jetty - cometd.org On Mon, Jan 20, 2014 at 11:35 PM, Terada Michitaka <[email protected]>wrote: > Hi, > > We use Jetty 2.5.1 in our service. > Our application create some information(ex request id, flag, etc) at a > pre-matching filter. > This information is read by a filter, resource, interceptor, exception > mapper and entity reader/writer. > > So, I set this info to ContainerRequestContext that I think it is suitable > for. > > First, I wrote @Context annotation at field variable of a interceptor. > But error writing below happened. > > |1. java.lang.IllegalStateException: Not inside a request scope. > > So, I use @Context to inject ResourceContext and get > ContainerRequestContext from it. > In version 2.3,1, this implement is work well, but in 2.5.1 is not. > Too frequently Full GC is happened(is it bug??). > > Our understanding is the request scope is begin at first filter and end > with last filter. > WriterInterceptor,RederInterceptor,MessageBodyReader, ExceptionMapper and > MessageBodyWriter is in a request scope. > > I think below code should be work well, without throwing exception by > jersey. > (But now, occur exception. Other class in mail title is as well.) > > @Provider > public class Interceptor implements WriterInterceptor { > > @Context > ContainerRequestContext requestContext; > > @Override > public void aroundWriteTo(WriterInterceptorContext context) throws > IOException, WebApplicationException { > > } > } > > If this code is bad.. that is, not match JAX-RS spec or jersey design > policy, > I hope that someone would give me other idea. > > Thanks. > > //Michitaka > > > > > > _______________________________________________ > jetty-users mailing list > [email protected] > https://dev.eclipse.org/mailman/listinfo/jetty-users > >
_______________________________________________ jetty-users mailing list [email protected] https://dev.eclipse.org/mailman/listinfo/jetty-users
