java - Looking up an EJB dynamically -
I am developing an application on Glassfish 3. I have an EJB that looks like this:
@LocalBean @Stateless Public Class MyBean {public void doSomething () {}}
My client Code (running inside the same application) looks like this:
MayBean InitialContext.doLookup (MyBean.class.getName ());
According to some sources, this should be a valid lookup method, but it throws a NameNotFoundException What am I doing?
What sources according to? I personally will use the portable JNDI names specified in EJB 3.1.
BTW logs portable JNDI names at the time of deployment of glassfish.
Comments
Post a Comment