code: private J2EEName findApplicationBean(AppLinkData linkData, String application, String beanName)
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "findApplicationBean : " + application + ", " + beanName);
  
          J2EEName j2eeName;
  
          Set<J2EEName> beans = linkData.ivBeansByName.get(beanName);
          if (beans != null && !beans.isEmpty())
          {
              if (beans.size() != 1)
              {
                  AmbiguousEJBReferenceException ex = new AmbiguousEJBReferenceException
                                  ("The reference to bean " + beanName +
                                   " is ambiguous. Application " + application +
                                   " contains multiple beans with same name.");
                  if (isTraceOn && tc.isEntryEnabled())
                      Tr.exit(tc, "findApplicationBean : " + ex);
                  throw ex;
              }
  
              j2eeName = beans.iterator().next();
          }
          else
          {
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.debug(tc, "No beans found");
  
              j2eeName = null;
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "findApplicationBean : " + j2eeName);
          return j2eeName;
      }
docs: Returns the J2EEName for the specified bean name defined within the
  specified application. The bean may be defined within any of the
  application modules. <p>
  
  An EJBNotFoundException will be thrown if either a bean does not
  exist by the requested name, or more than one bean exists by
  the requested name. <p>
  
  The caller must be holding the monitor lock on <tt>linkData</tt>. <p>
  
  @param linkData the application link data.
  @param application the name of the application.
  @param beanName the name of the EJB, from xml or annotation.
  @return the bean name, or null if the application or bean does not exist
  @throws AmbiguousEJBReferenceException if the bean name is not unique
  within the application