[jboss-dev-forums] [EJB3 Development] - How to Build a Generic Lookup which accepts the lookup bean dynamically in a method.

Veerapu Nagarjun do-not-reply at jboss.com
Wed Dec 5 00:02:59 EST 2012


Veerapu Nagarjun [https://community.jboss.org/people/arjun445] created the discussion

"How to Build a Generic Lookup which accepts the lookup bean dynamically in a method."

To view the discussion, visit: https://community.jboss.org/message/780014#780014

--------------------------------------------------------------
Hi All,
I have an issue such that in normal way we directly type cast the lookup class like this

    TestClass t = (TestClass)context.lookup(some jndi name);

but this type cast should be of generic one like 

T t = (T) context.lookup(some jndi name);

this T should be the remote class which we are looking for. I have instead saved it to an object like this

Object x = context.lookup(some jndi name);

but after this if i wanted to convert it to a specific remote bean class then it is giving me the javax.naming.reference cannot be casted to this particular class. So can you guys please help me regarding this. 


Thank you,
Arjun.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/780014#780014]

Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20121205/3b6e3ca1/attachment.html 


More information about the jboss-dev-forums mailing list