Skip to content

getBean(Object.class) fails when introspecting Environment bean [SPR-10542] #15172

Closed
@spring-projects-issues

Description

@spring-projects-issues

James Shaw opened SPR-10542 and commented

Trying to access a bean of type Object gives the backtrace:

Exception in thread "main" org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'environment' is defined
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:568)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:264)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1125)
	at Test.main(Test.java:7)

See attached test case to reproduce.


Affects: 3.2.2

Attachments:

Issue Links:

Referenced from: commits 9d3d6d5, e89f18b, 21d0ce5

Backported to: 4.0.7, 3.2.11

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions