is it possible to invoke a method of ejb from a servlet/JSP client without a JNDI lookup? any otherway to do it?
Thanks in advance.
It's possible to keep the ejb's home stub around somewhere... perhaps on the servlet context... of course you need to get the stub through an initial jndi lookup. If you are simply tired of rewriting jndi lookup code, try making a factory class.
You have to do at least one JNDI lookup (Since that's how the server is going to authenticate who you are and create your Principal object etc.)
Once you have the home interface, if you need it, keep it. Once you have the bean, if you need it a lot, keep it.
The server will attach and detach instances from your proxy as it takes care of it's resources, that's it's job.