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.

  • See the EJB FAQ for Glassfish
  • / Li>
  • BTW logs portable JNDI names at the time of deployment of glassfish.


  • Comments

    Popular posts from this blog

    Eclipse CDT variable colors in editor -

    AJAX doesn't send POST query -

    wpf - Custom Message Box Advice -