java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.beans.BeansException
org.springframework.beans.FatalBeanException
org.springframework.beans.factory.BeanDefinitionStoreException
org.springframework.beans.factory.support.BeanDefinitionOverrideException
public class BeanDefinitionOverrideException extends BeanDefinitionStoreException
Subclass of BeanDefinitionStoreException indicating an invalid override attempt: typically registering a new definition for the same bean name while DefaultListableBeanFactory.isAllowBeanDefinitionOverriding() is false .
Since:
Author:
Juergen Hoeller
See Also:
  • DefaultListableBeanFactory.setAllowBeanDefinitionOverriding(boolean)
  • DefaultListableBeanFactory.registerBeanDefinition(java.lang.String, org.springframework.beans.factory.config.BeanDefinition)
  • Serialized Form
  • Description
    Create a new BeanDefinitionOverrideException for the given new and existing definition.

    Methods inherited from class org.springframework.core. NestedRuntimeException

    contains , getMostSpecificCause , getRootCause

    Methods inherited from class java.lang. Throwable

    addSuppressed , fillInStackTrace , getCause , getLocalizedMessage , getMessage , getStackTrace , getSuppressed , initCause , printStackTrace , printStackTrace , printStackTrace , setStackTrace , toString

    Methods inherited from class java.lang. Object

    clone , equals , finalize , getClass , hashCode , notify , notifyAll , wait , wait , wait

    BeanDefinitionOverrideException

    public BeanDefinitionOverrideException ( String beanName, BeanDefinition beanDefinition, BeanDefinition existingDefinition)
    Create a new BeanDefinitionOverrideException for the given new and existing definition.
    Parameters:
    beanName - the name of the bean
    beanDefinition - the newly registered bean definition
    existingDefinition - the existing bean definition for the same name
    @NonNull public String getResourceDescription ()
    Return the description of the resource that the bean definition came from.
    Overrides:
    getResourceDescription in class BeanDefinitionStoreException

    getBeanDefinition

    public BeanDefinition getBeanDefinition ()
    Return the newly registered bean definition.
    See Also:
  • getBeanName()
  • getExistingDefinition

    public BeanDefinition getExistingDefinition ()
    Return the existing bean definition for the same name.
    See Also:
  • getBeanName()
  •