cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Russell <>
Subject Re: [C2] [TC 4.0m4+] ClassCastException
Date Fri, 01 Dec 2000 18:17:49 GMT
On Thu, Nov 30, 2000 at 09:56:12PM +0000, Stuart Roebuck wrote:
> I posted a note on this a while back, but didn't get a response.  Now, I thought I try
again with the lastest CVS versions of Cocoon and Tomcat and see if things had magically started
working again.

Hi Stuart.

Sorry about the delay. There definately *shouldn't* be a class cast
exception in the location that stack trace points to. It's trying to
cast an org.apache.cocoon.environment.http.HttpRequest to a
javax.servlet.http.HttpServletRequest, which given the former implements
the latter, should be fine.

The only thing I can think is that you're compiling against a
different version of the servlet api to the one you are running
against, although even this *shouldn't* cause this exception.

Very odd indeed. The chunk of sitemap involved is:

  private List wildcardMatch (int [] pattern, Map objectModel) {
    ArrayList list = new ArrayList();
    String uri = ((HttpServletRequest) objectModel.get(         <<
                    Cocoon.REQUEST_OBJECT)).getRequestURI();    <<
    if (uri.startsWith("/"))
      uri = uri.substring(1);
    if (org.apache.cocoon.matching.helpers.WildcardURIMatcher.match (
          list, uri, pattern)) {
      return list;
    } else {
      return null;

and the problem is happening on the highlighted lines.
Anyone got any ideas what's causing it? Once again, that exception:

> java.lang.ClassCastException: org.apache.cocoon.environment.http.HttpRequest
> 	at _Users._stuart._OpenSource._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.wildcardMatch(
> 	at _Users._stuart._OpenSource._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.process(
> [...]


Paul Russell                               <>
Technical Director,         
Luminas Ltd.

View raw message