You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stuart Roebuck <st...@adolos.co.uk> on 2000/11/30 22:56:12 UTC

[C2] [TC 4.0m4+] ClassCastException

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.

I can get Tomcat up and working fine.  I try dropping in the full Cocoon webapp and try and launch the context main page, and up comes the following exception:

java.lang.ClassCastException: org.apache.cocoon.environment.http.HttpRequest
	at _Users._stuart._OpenSource._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.wildcardMatch(_sitemap_xmap.java:65)
	at _Users._stuart._OpenSource._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.process(_sitemap_xmap.java:710)
	at org.apache.cocoon.sitemap.Handler.process(Handler.java:132)
	at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:87)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:239)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:235)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:177)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2014)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
	at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:414)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:808)
	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:887)
	at java.lang.Thread.run(Thread.java:479)

I had previously tried the "remove crimson" trick to no avail.

Does anyone have any suggestions - it would be really good to get up to speed on a more recent build of Cocoon 2 than the one I've been using for the last n months.

Cheers,

Stuart.


** We are currently experiencing prolonged difficulties with our email **
** provider DIGIWEB and INTERLIANT.  To guarantee that your response   **
** is received, please replace "adolos.com" with "adolos.co.uk"        **
** in your response.                                                   **

-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Lead Developer                                  Mac OS X, Java, XML, etc.
ADOLOS                                             http://www.adolos.com/

Re: [C2] [TC 4.0m4+] ClassCastException

Posted by Paul Russell <pa...@luminas.co.uk>.
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(_sitemap_xmap.java:65)
> 	at _Users._stuart._OpenSource._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.process(_sitemap_xmap.java:710)
> [...]


Paul.

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: [C2] [TC 4.0m4+] ClassCastException

Posted by Paul Russell <pa...@luminas.co.uk>.
Need your generated sitemap code to track that. Can you mail
it to me (privately -- these things can be kinda large) and we'll
try and track it down...


Paul.

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.
> 
> I can get Tomcat up and working fine.  I try dropping in the full Cocoon webapp and try and launch the context main page, and up comes the following exception:
> 
> java.lang.ClassCastException: org.apache.cocoon.environment.http.HttpRequest
> 	at _Users._stuart._OpenSource._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.wildcardMatch(_sitemap_xmap.java:65)
> 	at _Users._stuart._OpenSource._build._tomcat_4_0._webapps._cocoon._sitemap_xmap.process(_sitemap_xmap.java:710)
> 	at org.apache.cocoon.sitemap.Handler.process(Handler.java:132)
> 	at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:87)
> 	at org.apache.cocoon.Cocoon.process(Cocoon.java:239)
> 	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:235)
> 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
> 	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:251)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
> 	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:177)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
> 	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2014)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:161)
> 	at org.apache.catalina.valves.ValveBase.invokeNext(ValveBase.java:242)
> 	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:414)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:975)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:159)
> 	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:977)
> 	at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:808)
> 	at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:887)
> 	at java.lang.Thread.run(Thread.java:479)
> 
> I had previously tried the "remove crimson" trick to no avail.
> 
> Does anyone have any suggestions - it would be really good to get up to speed on a more recent build of Cocoon 2 than the one I've been using for the last n months.
> 
> Cheers,
> 
> Stuart.
> 
> 
> ** We are currently experiencing prolonged difficulties with our email **
> ** provider DIGIWEB and INTERLIANT.  To guarantee that your response   **
> ** is received, please replace "adolos.com" with "adolos.co.uk"        **
> ** in your response.                                                   **
> 
> -------------------------------------------------------------------------
> Stuart Roebuck                                  stuart.roebuck@adolos.com
> Lead Developer                                  Mac OS X, Java, XML, etc.
> ADOLOS                                             http://www.adolos.com/
> 

-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.