commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: Javaflow - cannot be cast
Date Tue, 15 Jul 2008 08:21:34 GMT
>
> I am getting:
> java.lang.ClassCastException: my.test.MyRunnable cannot be cast to
> my.test.IRunnable
> 	at my.test.MyRunnable.main(MyRunnable.java:29)


> I guess it has something to do with class rewriting and thus
> my.test.IRunnable is not possible to cast to rewriten  
> my.test.IRunnable.
> Has anyone any suggestion how to deal with it?

I guess it's more likely to be a class loading problem.

Print out the classloaders involved. That should give you more insights.

Who loaded IRunnable? Who loaded the instance?

  Object o = clz.newInstance();
  System.out.println(o.getClass().getClassLoader());
  IRunnable r = (IRunnable) o;
  System.out.println(r.getClass().getClassLoader());


cheers
--
Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message