Hi there.
Using Sun-JDK-1.4.1_03(WinNT4SP6a), Phoenix-4.0.3, ServiceManager.lookup(MyComponent.ROLE):
The ServiceManager always returns a $Proxy<number> type object, which causes a ClassCastException when I try to cast to my components service interface: MyComponent mytest = (MyComponent) ServiceManager.lookup(MyComponent.ROLE);
When getting a needed component with ServiceManager, am I supposed to use
reflection to get at my services interface/impl(?!), or should the returned
object be castable as I tried above? Actually, reflection even tells me that MyComponent-interface is implemented by
the returned mytest.
?! I'm somehow lost here. Does anyone see or can anyone guess the mistake?
What happens if you do the following in your test:
Object test = serviceManagerInst.lookup( MyComponent.ROLE );
loggerInst.debug(
"here : " + System.identityHashCode( MyComponent.class ) );
loggerInst.debug(
"there: " + System.identityHashCode( test.getClass() ) );Steve.
--
|------------------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org/merlin | | http://dpml.net/merlin/distributions/latest | |------------------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
