org.springframework.beans.factory

Class NoSuchBeanDefinitionException

    • Constructor Detail

      • NoSuchBeanDefinitionException

        public NoSuchBeanDefinitionException(java.lang.String name)
        Create a new NoSuchBeanDefinitionException.
        Parameters:
        name - the name of the missing bean
      • NoSuchBeanDefinitionException

        public NoSuchBeanDefinitionException(java.lang.String name,
                                             java.lang.String message)
        Create a new NoSuchBeanDefinitionException.
        Parameters:
        name - the name of the missing bean
        message - detailed message describing the problem
      • NoSuchBeanDefinitionException

        public NoSuchBeanDefinitionException(java.lang.Class<?> type)
        Create a new NoSuchBeanDefinitionException.
        Parameters:
        type - required type of the missing bean
      • NoSuchBeanDefinitionException

        public NoSuchBeanDefinitionException(java.lang.Class<?> type,
                                             java.lang.String message)
        Create a new NoSuchBeanDefinitionException.
        Parameters:
        type - required type of the missing bean
        message - detailed message describing the problem
      • NoSuchBeanDefinitionException

        public NoSuchBeanDefinitionException(ResolvableType type)
        Create a new NoSuchBeanDefinitionException.
        Parameters:
        type - full type declaration of the missing bean
        Since:
        4.3.4
      • NoSuchBeanDefinitionException

        public NoSuchBeanDefinitionException(ResolvableType type,
                                             java.lang.String message)
        Create a new NoSuchBeanDefinitionException.
        Parameters:
        type - full type declaration of the missing bean
        message - detailed message describing the problem
        Since:
        4.3.4
    • Method Detail

      • getBeanName

        @Nullable
        public java.lang.String getBeanName()
        Return the name of the missing bean, if it was a lookup by name that failed.
      • getBeanType

        @Nullable
        public java.lang.Class<?> getBeanType()
        Return the required type of the missing bean, if it was a lookup by type that failed.
      • getNumberOfBeansFound

        public int getNumberOfBeansFound()
        Return the number of beans found when only one matching bean was expected. For a regular NoSuchBeanDefinitionException, this will always be 0.
        See Also:
        NoUniqueBeanDefinitionException