cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <>
Subject Re: Solution!! Re: [C2] [TC 4.0m4+] ClassCastException
Date Mon, 04 Dec 2000 18:49:34 GMT
Must be a ClassLoader problem - that would explain the bad cast. This should 
not happen though. I'm X-posting to Sorry if 
this is a FAQ.

Stuart Roebuck <> wrote:
>For all those who have been frustratedly putting up with my posts about not 
>getting Cocoon 2 working under the latest Tomcat release, I am hughly 
>relieved to say that it now works.  But I now lay the challenge of trying 
>to work out why the following patch solves the problem!
>Index: ./src/org/apache/cocoon/matching/
>RCS file: 
>retrieving revision
>diff -u -r1.1.2.21
>./src/org/apache/cocoon/matching/	2000/11/30 
>./src/org/apache/cocoon/matching/	2000/12/04 
>@@ -52,7 +52,7 @@
>      public String generateMethodSource (NodeIterator conf)
>      throws ConfigurationException {
>          return "ArrayList list = new ArrayList();" +
>-               "String uri = ((HttpServletRequest) 
>objectModel.get(Cocoon.REQUEST_OBJECT)).getRequestURI();" +
>+               "String uri = 
>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;" +
>As you can see, I have simply replaced the casting of 
>objectModel.get(Cocoon.REQUEST_OBJECT) to a HttpServletRequest with a cast 
>to a org.apache.cocoon.environment.http.HttpRequest.  My debugging seemed 
>to prove that the original object was an 
>org.apache.cocoon.environment.http.HttpRequest, but such an HttpRequest 
>should inherit from HttpServletRequest, as at least one person on the group 
>has already said, so the original cast should be completely valid.
>However, this has done the trick.  Everything now works!
>Why? ... answers on a postcard.

Get more from the Web.  FREE MSN Explorer download :

View raw message