BeanCreationNotAllowedException class

The error thrown when a singleton that does not exist yet is requested while the factory destroys its singletons.

The container is shutting down, so it refuses to create new beans. It usually comes from a destroy callback that looks up a bean: look the bean up earlier, or inject it so it is destroyed after the bean that uses it.

// A destroy callback that looks up a bean not created yet:
preDestroy: (bean) => factory.getBean<Audit>(), // throws

Spring (Java):

@PreDestroy void close() { beanFactory.getBean(Audit.class); } // throws
Inheritance

Constructors

BeanCreationNotAllowedException(String beanName)
Creating the singleton beanName was refused during shutdown.

Properties

beanName → String
The bean whose creation failed.
finalinherited
cause → Object?
The error that caused this one, if any: what a constructor threw, or the container error of a nested bean.
finalinherited
causeStackTrace → StackTrace
The stack trace of cause (empty without a cause).
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
message → String
A human-readable description of the problem.
finalinherited
mostSpecificCause → Object
rootCause, or this exception when it has no cause. Spring: getMostSpecificCause().
no setterinherited
rootCause → Object?
The innermost cause: cause followed through nested container errors, or null without a cause. Usually the error that really went wrong. Spring: getRootCause().
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited