1. Explore
  2. »
  3. Spring Beans

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. AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject() has thrown a BeanCreationException
    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
437Web pages
1Solution
NoSuchBeanDefinitionExceptionAutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject()437

Missing dependencies in deployment environment

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues
426Web pages
1Solution
BeanCreationExceptionAutowiredAnnotationBeanPostProcessor.postProcessPropertyValues()426

AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject() has thrown a BeanCreationException

org.springframework.beans.factory.NoSuchBeanDefinitionException
4 frames hidden
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject
380Web pages
BeanCreationExceptionAutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject()380

Cannot resolve reference to bean/object passed as property in bean definition

org.springframework.beans.factory.BeanCreationException
1 frames hidden
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary
327Web pages
1Solution
BeanCreationExceptionBeanDefinitionValueResolver.resolveValueIfNecessary()327

Missing or incorrect property values set in bean definition

org.springframework.beans.factory.BeanCreationException
2 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
322Web pages
1Solution
BeanCreationExceptionAbstractAutowireCapableBeanFactory.doCreateBean()322

Unable to create Singleton object

org.springframework.beans.factory.BeanCreationException
4 frames hidden
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
313Web pages
BeanCreationExceptionDefaultSingletonBeanRegistry.getSingleton()313

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
235Web pages
BeanDefinitionParsingExceptionFailFastProblemReporter.error()235

Application Context unable to instantiate bean

org.springframework.beans.factory.BeanCreationException
3 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean
190Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.populateBean()190

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

org.springframework.beans.factory.UnsatisfiedDependencyException
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray
178Web pages
UnsatisfiedDependencyExceptionConstructorResolver.createArgumentArray()178

Missing or incorrect XML Namespaces in the bean definitions xml file

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions
158Web pages
1Solution
XmlBeanDefinitionStoreExceptionXmlBeanDefinitionReader.doLoadBeanDefinitions()158

Unable to load spring beans

java.io.FileNotFoundException
2 frames hidden
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
157Web pages
1Solution
BeanDefinitionStoreExceptionXmlBeanDefinitionReader.loadBeanDefinitions()157

Missing jar file in deployment server library resulting in ClassNotFoundException

java.lang.ClassNotFoundException
3 frames hidden
org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass
135Web pages
1Solution
ClassNotFoundExceptionAbstractBeanDefinition.resolveBeanClass()135

Incompatible library version added as dependency causing IllegalStateException

java.lang.IllegalStateException
4 frames hidden
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton
128Web pages
1Solution
IllegalStateExceptionDefaultSingletonBeanRegistry.destroySingleton()128

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.instantiateUsingFactoryMethod()126

Missing or incorrect Stereotype annotation

org.springframework.beans.factory.NoSuchBeanDefinitionException
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean
124Web pages
NoSuchBeanDefinitionExceptionDefaultListableBeanFactory.getBean()124

Incompatible objects passed as property references during bean creation.

java.lang.IllegalStateException
org.springframework.beans.TypeConverterDelegate.convertIfNecessary
121Web pages
IllegalStateExceptionTypeConverterDelegate.convertIfNecessary()121

Missing XML namespace in bean definitions xml file

org.springframework.beans.factory.parsing.BeanDefinitionParsingException
4 frames hidden
org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement
117Web pages
BeanDefinitionParsingExceptionBeanDefinitionParserDelegate.parseCustomElement()117

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
115Web pages
1Solution
BeanDefinitionStoreExceptionXmlBeanDefinitionReader.loadBeanDefinitions()115

Missing or incompatible dependency declaration

org.springframework.beans.factory.CannotLoadBeanClassException
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass
104Web pages
1Solution
CannotLoadBeanClassExceptionAbstractBeanFactory.resolveBeanClass()104

Unable to instantiate object due to corrupt autowired constructor arguments

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor
104Web pages
BeanCreationExceptionConstructorResolver.autowireConstructor()104

XmlBeanDefinitionReader.loadBeanDefinitions() has thrown a BeanDefinitionStoreException

java.io.FileNotFoundException
3 frames hidden
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
104Web pages
BeanDefinitionStoreExceptionXmlBeanDefinitionReader.loadBeanDefinitions()104

Missing implementation of autowired interface

org.springframework.beans.factory.NoSuchBeanDefinitionException
4 frames hidden
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray
102Web pages
NoSuchBeanDefinitionExceptionConstructorResolver.createArgumentArray()102

AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject() has thrown an UnsatisfiedDependencyException

org.springframework.beans.factory.NoSuchBeanDefinitionException
4 frames hidden
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject
102Web pages
UnsatisfiedDependencyExceptionAutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject()102

Incorrect resource mapping resulting in FileNotFoundException

java.io.FileNotFoundException
1 frames hidden
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
101Web pages
1Solution
FileNotFoundExceptionXmlBeanDefinitionReader.loadBeanDefinitions()101

AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues() has thrown a BeanCreationException

org.springframework.beans.factory.NoSuchBeanDefinitionException
6 frames hidden
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues
101Web pages
BeanCreationExceptionAutowiredAnnotationBeanPostProcessor.postProcessPropertyValues()101

Unable to satisfy dependency while autowiring constructor arguments

org.springframework.beans.factory.UnsatisfiedDependencyException
3 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance
100Web pages
UnsatisfiedDependencyExceptionAbstractAutowireCapableBeanFactory.createBeanInstance()100

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
99Web pages
NoSuchBeanDefinitionExceptionBeanDefinitionValueResolver.resolveReference()99

ServletContext unable to load Spring Beans

java.io.FileNotFoundException
2 frames hidden
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
93Web pages
1Solution
BeanDefinitionStoreExceptionXmlBeanDefinitionReader.loadBeanDefinitions()93

AbstractAutowireCapableBeanFactory.applyPropertyValues() has thrown a BeanCreationException

org.springframework.beans.NotWritablePropertyException
5 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues
92Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.applyPropertyValues()92

AbstractBeanFactory.getBean() has thrown a BeanCreationException

org.springframework.beans.factory.BeanCreationException
9 frames hidden
org.springframework.beans.factory.support.AbstractBeanFactory.getBean
89Web pages
BeanCreationExceptionAbstractBeanFactory.getBean()89

AbstractBeanDefinitionReader.loadBeanDefinitions() has thrown a BeanDefinitionStoreException

java.io.FileNotFoundException
6 frames hidden
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
88Web pages
BeanDefinitionStoreExceptionAbstractBeanDefinitionReader.loadBeanDefinitions()88

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.inject()87

AbstractBeanDefinitionReader.loadBeanDefinitions() has thrown a BeanDefinitionStoreException

java.io.FileNotFoundException
6 frames hidden
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
87Web pages
BeanDefinitionStoreExceptionAbstractBeanDefinitionReader.loadBeanDefinitions()87

AbstractBeanDefinitionReader.loadBeanDefinitions() has thrown a XmlBeanDefinitionStoreException

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
3 frames hidden
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
87Web pages
XmlBeanDefinitionStoreExceptionAbstractBeanDefinitionReader.loadBeanDefinitions()87

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

org.springframework.beans.BeanInstantiationException
org.springframework.beans.BeanUtils.instantiateClass
87Web pages
BeanInstantiationExceptionBeanUtils.instantiateClass()87

ConstructorResolver.createArgumentArray() has thrown an UnsatisfiedDependencyException

org.springframework.beans.factory.NoSuchBeanDefinitionException
5 frames hidden
org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray
87Web pages
UnsatisfiedDependencyExceptionConstructorResolver.createArgumentArray()87

ServletContext unable to find bean definitions/configuration file

org.springframework.beans.factory.BeanDefinitionStoreException
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions
86Web pages
BeanDefinitionStoreExceptionXmlBeanDefinitionReader.loadBeanDefinitions()86

Missing or incorrectly named bean passed as property reference

org.springframework.beans.factory.BeanCreationException
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean
85Web pages
1Solution
BeanCreationExceptionBeanDefinitionValueResolver.resolveInnerBean()85

AbstractBeanDefinitionReader.loadBeanDefinitions() has thrown a BeanDefinitionStoreException

org.springframework.beans.factory.BeanDefinitionStoreException
3 frames hidden
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
84Web pages
BeanDefinitionStoreExceptionAbstractBeanDefinitionReader.loadBeanDefinitions()84

AbstractAutowireCapableBeanFactory.createBean() has thrown a BeanCreationException

org.springframework.beans.factory.BeanCreationException
4 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
82Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.createBean()82

AbstractAutowireCapableBeanFactory.createBean() has thrown a BeanCreationException

org.springframework.beans.factory.BeanCreationException
4 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean
82Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.createBean()82

AbstractAutowireCapableBeanFactory.doCreateBean() has thrown a BeanCreationException

org.springframework.beans.factory.BeanCreationException
3 frames hidden
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean
81Web pages
BeanCreationExceptionAbstractAutowireCapableBeanFactory.doCreateBean()81

BeanDefinitionValueResolver.resolveValueIfNecessary() has thrown a BeanCreationException

org.springframework.beans.factory.BeanCreationException
1 frames hidden
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary
80Web pages
BeanCreationExceptionBeanDefinitionValueResolver.resolveValueIfNecessary()80

AbstractBeanDefinitionReader.loadBeanDefinitions() has thrown a XmlBeanDefinitionStoreException

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException
4 frames hidden
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
80Web pages
XmlBeanDefinitionStoreExceptionAbstractBeanDefinitionReader.loadBeanDefinitions()80

Missing properties file or incorrectly named property placeholder

org.springframework.beans.factory.BeanDefinitionStoreException
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties
78Web pages
1Solution
BeanDefinitionStoreExceptionPropertyPlaceholderConfigurer.processProperties()78

Bean creation is not allowed in destroy method

org.springframework.beans.factory.BeanCreationNotAllowedException
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton
76Web pages
1Solution
BeanCreationNotAllowedExceptionDefaultSingletonBeanRegistry.getSingleton()76

AbstractBeanDefinitionReader.loadBeanDefinitions() has thrown a BeanDefinitionStoreException

org.springframework.beans.factory.BeanDefinitionStoreException
4 frames hidden
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions
75Web pages
BeanDefinitionStoreExceptionAbstractBeanDefinitionReader.loadBeanDefinitions()75

PropertyResourceConfigurer.postProcessBeanFactory() has thrown a BeanDefinitionStoreException

org.springframework.beans.factory.BeanDefinitionStoreException
1 frames hidden
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory
74Web pages
BeanDefinitionStoreExceptionPropertyResourceConfigurer.postProcessBeanFactory()74

BeanDefinitionValueResolver.resolveReference() has thrown a BeanCreationException

org.springframework.beans.factory.NoSuchBeanDefinitionException
5 frames hidden
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference
72Web pages
BeanCreationExceptionBeanDefinitionValueResolver.resolveReference()72

Incompatible version or missing library containing class passed as property reference

org.springframework.beans.MethodInvocationException
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues
72Web pages
MethodInvocationExceptionAbstractAutowireCapableBeanFactory.applyPropertyValues()72
Nothing to list here.
Nothing to list here.
Nothing to list here.
Nothing to list here.