Class NoSuchBeanException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
NoSuchBeanTypeException

public class NoSuchBeanException extends RuntimeCamelException
Thrown when a bean cannot be found in the Camel Registry by name or by type.

Raised by registry lookup methods such as CamelContext.getRegistry().lookupByName(String), CamelContext.getRegistry().lookupByNameAndType(String, Class), the bean component, and the bean language when a referenced bean is absent or when more than one bean matches a given name (ambiguous match). Route authors encountering this exception should verify that the required module is on the classpath and that the bean name in the DSL matches exactly the name under which the bean was registered. The constructor variants cover: name only, name with ambiguous count, name with expected type, and name with root cause.

See Also:
  • Constructor Details

    • NoSuchBeanException

      public NoSuchBeanException(String name)
      Parameters:
      name - the bean name that could not be found
    • NoSuchBeanException

      public NoSuchBeanException(String name, int size)
      Parameters:
      name - the bean name that was looked up
      size - the number of matching beans found (0 means none, >1 means ambiguous)
    • NoSuchBeanException

      public NoSuchBeanException(@Nullable String name, String type)
      Parameters:
      name - the bean name that could not be found, or null if only the type matters
      type - the required bean type
    • NoSuchBeanException

      public NoSuchBeanException(String name, Throwable cause)
      Parameters:
      name - the bean name that could not be found
      cause - the cause of the failure
    • NoSuchBeanException

      public NoSuchBeanException(String name, String message, Throwable cause)
      Parameters:
      name - the bean name that could not be found
      message - the detail message
      cause - the cause of the failure
  • Method Details

    • getName

      public @Nullable String getName()