WebSphere Application Server - Can't get my custom userRegistry through jndi lookup

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere Application Server > April 2006 > Can't get my custom userRegistry through jndi lookup





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Can't get my custom userRegistry through jndi lookup

2006-04-27, 8:08 am

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);

?

2006-04-27, 8:08 am

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 ...
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com