| Author |
Can't get my custom userRegistry through jndi lookup
|
|
|
| ya that's my problem..
when I try to get my custom user registry using
initialContext.lookup("UserRegistry")
the return is a com.ibm.websphere.security._UserRegistry_Stub object.
what is missing??
| |
| Paul Ilechko 2006-04-27, 8:08 am |
| thiago@softplan.com.br wrote:
> ya that's my problem..
> when I try to get my custom user registry using
> initialContext.lookup("UserRegistry")
> the return is a com.ibm.websphere.security._UserRegistry_Stub object.
>
> what is missing??
Did you try doing a
UserRegistry userReg = (UserRegistry)PortableRemoteObject.narrow(
objRef, UserRegistry.class);
?
| |
|
| yes, I did. This doesn't work:
Object ref = ic.lookup("UserRegistry");
DatabaseUserRegistry registry = (DatabaseUserRegistry)
PortableRemoteObject.narrow(ref, DatabaseUserRegistry.class);
And this:
Object ref = ic.lookup("UserRegistry");
UserRegistry registry = (UserRegistry) PortableRemoteObject.narrow(ref,
UserRegistry.class);
I get a class cast exception when trying to cast the registry to my custom user registry class.
If I ask for the class of the registry I get com.ibm.websphere.security._UserRegistry_Stub.
| |
| Paul Ilechko 2006-04-27, 8:08 am |
| thiago@softplan.com.br wrote:
> yes, I did. This doesn't work:
>
> Object ref = ic.lookup("UserRegistry");
> DatabaseUserRegistry registry = (DatabaseUserRegistry)
> PortableRemoteObject.narrow(ref, DatabaseUserRegistry.class);
>
> And this:
>
> Object ref = ic.lookup("UserRegistry");
> UserRegistry registry = (UserRegistry) PortableRemoteObject.narrow(ref,
> UserRegistry.class);
>
> I get a class cast exception when trying to cast the registry to my custom user registry class.
>
> If I ask for the class of the registry I get com.ibm.websphere.security._UserRegistry_Stub.
>
>
>
The latter should work.
Where are you running this code? It should be inside the J2EE container ...
|
|
|
|