Class AmbiguousEJBReferenceException

  • All Implemented Interfaces:
    java.io.Serializable

    public class AmbiguousEJBReferenceException
    extends javax.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:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AmbiguousEJBReferenceException()
      Constructs a new AmbiguousEJBReferenceException.
      AmbiguousEJBReferenceException​(java.lang.String detailMessage)
      Constructs a new AmbiguousEJBReferenceException with the specified detail message.
      AmbiguousEJBReferenceException​(java.lang.String detailMessage, java.lang.Exception cause)
      Constructs a new AmbiguousEJBReferenceException with the specified detail message and cause.
    • Method Summary

      • Methods inherited from class javax.ejb.EJBException

        getCause, getCausedByException, getMessage, printStackTrace, printStackTrace, printStackTrace
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AmbiguousEJBReferenceException

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

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

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