code: private Object lookupHomeInstance() throws NamingException {
  
          javax.naming.Context ctx = getInitialContext();
  
          try {
              return ctx.lookup(_jndiName);
          }
          catch (NameNotFoundException nnfe) {
              // attempt again without application scoping
              if (!_jndiName.startsWith(JNDI_APPSCOPED_PREFIX)) {
                  throw nnfe;
              }
          }
          return ctx.lookup(_jndiName.substring(JNDI_APPSCOPED_PREFIX.length()));
      }
docs: Do a JNDI lookup for the home instance of the ejb.  Attempt the lookup
  first using an app scoped jndi prefix, if not successful, attempt without
  the prefix.
  
  @return HomeInstance object.
  @throws NamingException If HomeInstance cannot be found in JNDI registry.