cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@hns.com>
Subject RE: [C2|bug] weirdest bug ever
Date Mon, 11 Sep 2000 18:00:39 GMT
Try add following lines to your code:

System.out.println("Code =
"+System.identityHashCode(s.getClass().getSuperclass()));
System.out.println("Code = "+System.identityHashCode(cs[i]));
System.out.println("Code =
"+System.identityHashCode(org.apache.cocoon.sitemap.AbstractSitemap.class));
System.out.println("Code =
"+System.identityHashCode(org.apache.cocoon.sitemap.Sitemap.class));

These codes should be different (in your case) - and this should indicate,
IMHO, that you have several
class objects of the same class loaded - may be by different classloaders.

Vadim

> -----Original Message-----
> From: Stefano Mazzocchi [mailto:stefano@apache.org]
> Sent: Monday, September 11, 2000 1:10 PM
> To: Cocoon
> Cc: Craig R. McClanahan
> Subject: [C2|bug] weirdest bug ever
>
>
> With latest C2 and latest Catalina from CVS, with all jars in the
> classpath (otherwise it doesn't even compile the sitemap) I get
>
> java.lang.ClassCastException
> 	at
> org.apache.cocoon.sitemap.SitemapHandler.run(SitemapHandler.java:147)
> 	at java.lang.Thread.run(Thread.java:479)
>
> After accessing the /cocoon/welcome page.
>
> The strange thing that sitemap IS compiled and javap tells me that it is
> an instance of Sitemap, but at runtime it doesn't.
>
> This is both the same on JDK 1.2.2 and JDK 1.3 (on win2k)
>
> and this code added to SitemapHandler right before the class cast is
> performed
>
> Class c = s.getClass().getSuperclass();
> System.out.println("superclass: " + c.getName());
> Class[] cs = c.getInterfaces();
> for (int i = 0; i < cs.length ; i++) {
>     System.out.println(cs[i]);
> }
> System.out.println("instance of Sitemap: " + (s instanceof
> org.apache.cocoon.sitemap.Sitemap));
>
> returns
>
> superclass: org.apache.cocoon.sitemap.AbstractSitemap
> interface org.apache.cocoon.sitemap.Sitemap
> instance of Sitemap: false
>
> what the hell is going on?
>
> --
> Stefano Mazzocchi      One must still have chaos in oneself to be
>                           able to give birth to a dancing star.
> <stefano@apache.org>                             Friedrich Nietzsche
> --------------------------------------------------------------------
>  Missed us in Orlando? Make it up with ApacheCON Europe in London!
> ------------------------- http://ApacheCon.Com ---------------------
>
>


Mime
View raw message