cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: javaflow connection
Date Wed, 16 Nov 2005 14:58:21 GMT
> Hi.
> I'm using cocoon 2.1.7. In a  javaflow class. I have this code:
> if
>
> ( getComponent(DataSourceComponent.ROLE + "Selector")instanceof  
> ComponentSelector);
> {
>
>
> ComponentSelector selector = (ComponentSelector) getComponent 
> (DataSourceComponent.ROLE + "Selector");
> }
>
> But I obtain:
>
> ERROR   (2005-11-16) 09:38.57:718   [sitemap.handled-errors] (/ 
> mysis/login.do) http-8080-Processor25/ErrorHandlerHelper:
> java.lang.ClassCastException

Hm... try something like this (from the top of my head)

Object o = getComponent(DataSourceComponent.ROLE + "Selector");

System.out.println(o.getClass() + "@" + o.getClass().getClassLoader());
System.out.println(ComponentSelector.class + "@" +  
ComponentSelector.class.getClassLoader());

That way you should see the exact class being returned as well
as the classloader that has loaded it.

> But I don't know how to do this in a java flow.

Just like you would do in an action.

HTH

cheers
--
Torsten



Mime
View raw message