»

Spring Beans errors

The objects that form the backbone of your application and that are managed by the Spring IoC container

https://github.com/spring-projects/spring-framework
Solution coverage:
Summary coverage:

Top patterns

  1. Bean not found in application context

    There are quite a few possible solutions for this:

    • Mostly likely this is because you are scanning the wrong package: check the package name you provided to @ComponentScan annotation or, if you used package scan, then to bean.setPackagesToScan() method.
    • Incorrectly configuring the bean in your bean definitions xml file: make sure the target class name is correct and properties/constructor args have correct names and value types.
    • Check that you have defined the bean as a Component using appropriate annotation(@Controller, @Service, @Resource, etc.)
  2. Missing dependencies in deployment environment

    Check Servers Launch Configuration in Eclipse. See the details below.

    Check the source of this solution for more info

  3. Unable to create Singleton object
    No solution
Error patternsPackagesClassesMethodsExceptions
DescriptionException TypeEntry MethodWeb pages

Bean not found in application context

org.springframework.beans.factory.NoSuchBeanDefinitionException
3 frames hidden
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject
435Web pages
1Solution
NoSuchBeanDefinitionExceptionAutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject435

Missing dependencies in deployment environment

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues
420Web pages
1Solution
BeanCreationExceptionAutowiredAnnotationBeanPostProcessor.postProcessPropertyValues420

Unable to create Singleton object

org.springframework.beans.factory.BeanCreationException
4 frames hidden
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
310Web pages
BeanCreationExceptionDefaultSingletonBeanRegistry.getSingleton310

Incorrect XML attribute name or value used in bean definitions xml file

org.springframework.beans.factory.parsing.BeanDefinitionParsingException
org.springframework.beans.factory.parsing.FailFastProblemReporter.error
236Web pages
BeanDefinitionParsingExceptionFailFastProblemReporter.error236

Missing or incorrect dependencies in build file(maven/gradle/ant)

org.springframework.beans.factory.UnsatisfiedDependencyException
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray
176Web pages
UnsatisfiedDependencyExceptionConstructorResolver.createArgumentArray176

Missing or incorrect XML Namespaces in the bean definitions xml file

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions
153Web pages
1Solution
XmlBeanDefinitionStoreExceptionXmlBeanDefinitionReader.doLoadBeanDefinitions153

Incorrectly configured bean passed as factory-method in bean definition

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod
126Web pages
BeanCreationExceptionConstructorResolver.instantiateUsingFactoryMethod126

Missing or incorrect Stereotype annotation

org.springframework.beans.factory.NoSuchBeanDefinitionException
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean
122Web pages
NoSuchBeanDefinitionExceptionDefaultListableBeanFactory.getBean122

Incompatible objects passed as property references during bean creation.

java.lang.IllegalStateException
org.springframework.beans.TypeConverterDelegate.convertIfNecessary
122Web pages
IllegalStateExceptionTypeConverterDelegate.convertIfNecessary122

Incompatible library/jar versions detected while parsing bean definitions file.

org.springframework.beans.factory.BeanDefinitionStoreException
1 frames hidden
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
114Web pages
1Solution
BeanDefinitionStoreExceptionXmlBeanDefinitionReader.loadBeanDefinitions114

Unable to instantiate object due to corrupt autowired constructor arguments

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor
102Web pages
BeanCreationExceptionConstructorResolver.autowireConstructor102

Missing implementation of autowired interface

org.springframework.beans.factory.NoSuchBeanDefinitionException
4 frames hidden
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray
100Web pages
NoSuchBeanDefinitionExceptionConstructorResolver.createArgumentArray100

Missing or incompatible dependency declaration

org.springframework.beans.factory.CannotLoadBeanClassException
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass
100Web pages
1Solution
CannotLoadBeanClassExceptionAbstractBeanFactory.resolveBeanClass100

Referenced bean is not defined in bean definitions xml file

org.springframework.beans.factory.NoSuchBeanDefinitionException
4 frames hidden
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference
98Web pages
NoSuchBeanDefinitionExceptionBeanDefinitionValueResolver.resolveReference98

Bean out of scope while trying to inject as autowired attribute

org.springframework.beans.factory.UnsatisfiedDependencyException
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject
87Web pages
UnsatisfiedDependencyExceptionAutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject87

Missing or incorrectly named bean passed as property reference

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean
84Web pages
1Solution
BeanCreationExceptionBeanDefinitionValueResolver.resolveInnerBean84

ServletContext unable to find bean definitions/configuration file

org.springframework.beans.factory.BeanDefinitionStoreException
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
84Web pages
BeanDefinitionStoreExceptionXmlBeanDefinitionReader.loadBeanDefinitions84

Trying to instantiate an interface or a class without a default constructor

org.springframework.beans.BeanInstantiationException
org.springframework.beans.BeanUtils.instantiateClass
81Web pages
BeanInstantiationExceptionBeanUtils.instantiateClass81

Bean creation is not allowed in destroy method

org.springframework.beans.factory.BeanCreationNotAllowedException
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
78Web pages
1Solution
BeanCreationNotAllowedExceptionDefaultSingletonBeanRegistry.getSingleton78

Missing properties file or incorrectly named property placeholder

org.springframework.beans.factory.BeanDefinitionStoreException
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties
77Web pages
1Solution
BeanDefinitionStoreExceptionPropertyPlaceholderConfigurer.processProperties77

Incompatible version or missing library containing class passed as property reference

org.springframework.beans.MethodInvocationException
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues
67Web pages
MethodInvocationExceptionAbstractAutowireCapableBeanFactory.applyPropertyValues67

Unable to autowire class attribute/field due to incorrect bean configuration

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject
64Web pages
BeanCreationExceptionAutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject64

Incorrectly calling getter method for a property on object that do not have such method.

org.springframework.beans.NotReadablePropertyException
org.springframework.beans.BeanWrapperImpl.getPropertyValue
63Web pages
NotReadablePropertyExceptionBeanWrapperImpl.getPropertyValue63

Unable to instantiate bean due to missing or incompatible dependency

org.springframework.beans.factory.BeanCreationException
3 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
60Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.createBean60

Missing library jar in deployment environment

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
57Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.createBean57

Trying to autowire concrete class(not a proxy) as oppose to an interface.

org.springframework.beans.factory.BeanNotOfRequiredTypeException
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
56Web pages
BeanNotOfRequiredTypeExceptionAbstractBeanFactory.doGetBean56

Unable to instantiate bean due to exception in init() method

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization
52Web pages
BeanCreationExceptionInitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization52

AbstractBeanFactory.doGetBean() has thrown a BeanCurrentlyInCreationException

org.springframework.beans.factory.BeanCurrentlyInCreationException
2 frames hidden
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
49Web pages
BeanCurrentlyInCreationExceptionAbstractBeanFactory.doGetBean49

Required bean defined multiple times

org.springframework.beans.factory.NoUniqueBeanDefinitionException
1 frames hidden
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency
40Web pages
1Solution
NoUniqueBeanDefinitionExceptionDefaultListableBeanFactory.resolveDependency40

Incorrect file name or classpath configuration

org.springframework.beans.factory.BeanDefinitionStoreException
org.springframework.beans.factory.parsing.FailFastProblemReporter.error
39Web pages
BeanDefinitionStoreExceptionFailFastProblemReporter.error39

Unable to set bean as property reference due to missing or incompatible dependency

org.springframework.beans.MethodInvocationException
1 frames hidden
org.springframework.beans.AbstractPropertyAccessor.setPropertyValues
39Web pages
1Solution
MethodInvocationExceptionAbstractPropertyAccessor.setPropertyValues39

AbstractAutowireCapableBeanFactory.populateBean() has thrown a BeanCreationException

org.springframework.beans.factory.BeanCreationException
1 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean
38Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.populateBean38

Incompatible dependency version resulting in incorrect return types

java.lang.IllegalArgumentException
org.springframework.beans.TypeConverterDelegate.convertIfNecessary
38Web pages
IllegalArgumentExceptionTypeConverterDelegate.convertIfNecessary38

Attempt to instantiate an interface

org.springframework.beans.BeanInstantiationException
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate
37Web pages
BeanInstantiationExceptionSimpleInstantiationStrategy.instantiate37

Unable to resolve dependency due to missing or duplicate bean definition

org.springframework.beans.factory.NoSuchBeanDefinitionException
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency
36Web pages
NoSuchBeanDefinitionExceptionDefaultListableBeanFactory.resolveDependency36

Unable to create bean due to property load error

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues
34Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.applyPropertyValues34

Unable to parse configuration file due to incorrect XML schema use

org.springframework.beans.factory.parsing.BeanDefinitionParsingException
org.springframework.beans.factory.parsing.FailFastProblemReporter.fatal
31Web pages
BeanDefinitionParsingExceptionFailFastProblemReporter.fatal31

Missing jar in deployment environment

org.springframework.beans.MethodInvocationException
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference
29Web pages
MethodInvocationExceptionBeanDefinitionValueResolver.resolveReference29

Found multiple bean definitions where unique bean is expected

org.springframework.beans.factory.NoUniqueBeanDefinitionException
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean
28Web pages
NoUniqueBeanDefinitionExceptionDefaultListableBeanFactory.getBean28

Error due to using an inactive session

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean
27Web pages
1Solution
BeanCreationExceptionAbstractBeanFactory.doGetBean27

DisposableBeanAdapter.destroy() has thrown a BeanDefinitionStoreException

org.springframework.beans.factory.BeanDefinitionStoreException
2 frames hidden
org.springframework.beans.factory.support.DisposableBeanAdapter.destroy
27Web pages
BeanDefinitionStoreExceptionDisposableBeanAdapter.destroy27

Unable to find properties file

org.springframework.beans.factory.BeanInitializationException
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory
26Web pages
1Solution
BeanInitializationExceptionPropertyResourceConfigurer.postProcessBeanFactory26

No bean class specified in bean definition

java.lang.IllegalStateException
org.springframework.beans.factory.support.AbstractBeanDefinition.getBeanClass
23Web pages
IllegalStateExceptionAbstractBeanDefinition.getBeanClass23

Class specified in bean definition missing from dependencies list

java.lang.NoClassDefFoundError
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean
22Web pages
1Solution
NoClassDefFoundErrorAbstractAutowireCapableBeanFactory.instantiateBean22

Version conflict between dependencies

java.lang.NoClassDefFoundError
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
21Web pages
NoClassDefFoundErrorAbstractAutowireCapableBeanFactory.doCreateBean21

Incompatible version or missing library containing class, passed as property reference or constructor arguments

org.springframework.beans.BeanInstantiationException
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean
21Web pages
BeanInstantiationExceptionAbstractAutowireCapableBeanFactory.instantiateBean21

Unable to instantiate object using factory bean or factory-method

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean
19Web pages
BeanCreationExceptionFactoryBeanRegistrySupport.doGetObjectFromFactoryBean19

Missing or incompatible dependency related to Namespace elements in XML configuration file

org.springframework.beans.FatalBeanException
org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver.resolve
19Web pages
1Solution
FatalBeanExceptionDefaultNamespaceHandlerResolver.resolve19

Using an older JVM version for compilation or an old incompatible library dependency

java.lang.IllegalStateException
7 frames hidden
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions
18Web pages
IllegalStateExceptionXmlBeanDefinitionReader.doLoadBeanDefinitions18

Required type is not the same as provided type

org.springframework.beans.TypeMismatchException
org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary
18Web pages
TypeMismatchExceptionBeanWrapperImpl.doTypeConversionIfNecessary18
Nothing to list here.
Nothing to list here.
Nothing to list here.
Nothing to list here.