JBoss Community

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

created by Veerapu Nagarjun in EJB3 Development - View the full discussion

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

Start a new discussion in EJB3 Development at Community