Class AmbiguousEJBReferenceException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
jakarta.ejb.EJBException
com.ibm.websphere.ejbcontainer.AmbiguousEJBReferenceException
All Implemented Interfaces:
Serializable

public class AmbiguousEJBReferenceException extends jakarta.ejb.EJBException
This exception is thrown when the EJB container detects that a lookup of an EJB has been attempted which does not uniquely identify an EJB or EJB interface.

This may occur for the following scenarios :

  • A 'simple name' binding has been provided for an EJB which has more than one remote or local interface, and an attempt is made to lookup the EJB using the simple name.

    Since the 'simple name' does not uniquely identify a single interface, it is considered ambiguous. Instead, the lookup String should have '#' appended, where is the desired local or remote interface.

  • Default short form bindings are being used, and multiple EJBs are configured to implement the same interface.

    Since the short form binding does not uniquely identify a specific EJB, it is considered ambiguous. Instead, the lookup should be performed using the long form binding name, or a specific binding should be provided.

  • ejb-link (xml) or beanName (annotation) has been configured, and more than one bean with the specified name exists in the application.

    Since the bean name does not uniquely identify a specific EJB, it is considered ambiguous. Instead, the module name should also be specified (module#beanName).

  • Auto-link is used, either injecting into a field/method of a specific type, or with beanInterface specified, and more than one bean in the application implements the interface.

    Since the interface does not uniquely identify a specific EJB, it is considered ambiguous. Instead, either ejb-link should be used, or a binding provided.

See Also:
  • Constructor Details

    • AmbiguousEJBReferenceException

      public AmbiguousEJBReferenceException()
      Constructs a new AmbiguousEJBReferenceException. All fields are set to null.
    • AmbiguousEJBReferenceException

      public AmbiguousEJBReferenceException(String detailMessage)
      Constructs a new AmbiguousEJBReferenceException with the specified detail message. All other fields are set to null.
    • AmbiguousEJBReferenceException

      public AmbiguousEJBReferenceException(String detailMessage, Exception cause)
      Constructs a new AmbiguousEJBReferenceException with the specified detail message and cause.