users@grizzly.java.net

Re: FilterChainImpl.getPos() ClassCastException

From: Ryan Lubke <ryan.lubke_at_oracle.com>
Date: Thu, 12 Aug 2010 12:35:10 -0700

  On 8/12/10 12:10 PM, Alex Li wrote:
>
> Hi,
>
> I am upgrading to Grizzly 1.9.19-beta7 and got this error when using a
> servlet filter:
>
> java.lang.ClassCastException:
> com.planetj.servlet.filter.compression.CompressedHttpServletRequest
> cannot be cast to com.sun.grizzly.http.servlet.HttpServletRequestImpl
> at
> com.sun.grizzly.http.servlet.FilterChainImpl.getPos(FilterChainImpl.java:246)
>
>
> The same code worked perfectly fine in 1.9.18-k. Is this a bug, or
> should I change the way I am adding servlet filter?
>
> The reason for my upgrade is mainly for fixing this bug. I couldn't
> find exactly which Grizzly release has the bug fix but don't break my
> filter.
> http://old.nabble.com/GrizzlyServiceListener%3A-Interrupting-idle-Thread%3A-http-thread-pool-8001-%281%29-td28379368.html
>
>
> Please help.
> Thank you
> alex
>
Thanks for the report.

This looks like a regression due to the fix for [1]. We'll look into
this asap.

[1] https://grizzly.dev.java.net/issues/show_bug.cgi?id=819
      "Implementation of FilterChain is not threadsafe"