I've been struggling for the last 2 days trying to find out how to invoke a remote method of an EJB without having the remote interface on the client.
For example, is it possible to do something like this?:
Object obj = ctx.lookup("myEjb");
Thanks a lot.
My understanding is no. You never directly call a particular EJB instance but rather get access to a Proxy interface (local or remote) which allows the container to manage the invocation.
Why do you want do this? Why not just define a remote interface?
Of course the idea is to access the EJB through it's proxy but without having to know at compile time which EJB remote Interface I am going to use.
The problem is that I don´t know at compile time the EJB that's gonna be remotely accessed. The program will know the EJB JNDI name and method name to be executed at runtime