I think I figured it out. My debugging led me to believe something that wasn't the case. :) I found the problem with the way I was creating the transport...
Sorry for the noise.
Thanks!
Jon Brisbin
http//jbrisbin.com
----- Original Message -----
> From: "Oleksiy Stashok" <oleksiy.stashok_at_oracle.com>
> To: users_at_grizzly.java.net
> Sent: Wednesday, August 17, 2011 4:34:10 AM
> Subject: Re: problems with thread locals?
> Hi Jon,
> > Not sure what's going on here, but I have an HTTP server set up
> > using
> > Grizzly's HTTP server abstractions (I'm subclassing HttpHandler).
> > While servicing a request, I'm trying to make an asynchronous REST
> > connection to another service using the HttpClientFilter and a raw
> > TCPNIOTransport, which I configure on demand.
>
> > But weird things happen if I have a ByteBufferMemoryManager in my
> > server transport. I get odd ClassCastExceptions when I try and do a
> > "new HttpClientFilter()" while servicing the request that lead me
> > to
> > believe there's some ThreadLocal magic going on that is making this
> > difficult.
>
> > Can I create an outbound HTTP connection in Grizzly while servicing
> > an incoming HTTP request from the client using two different
> > transports/filter chains?
>
> Absolutely.
> As usual some testcase would help ;)
> Thanks.
> WBR,
> Alexey.