Skip to content

NullPointerException in RepositoryFactoryBeanSupport.getObject(…) [DATACMNS-1642] #2068

Closed
@spring-projects-issues

Description

@spring-projects-issues

Mark Paluch opened DATACMNS-1642 and commented

Trying to bootstrap a repository can lead to a NullPointerException in RepositoryFactoryBeanSupport.getObject(…).

 

What happens:

  • RepositoryFactoryBean gets initialized in afterPropertiesSet()
  • Initialization requests the type from the MappingContext
  • MappingContext publishes an application event
  • ApplicationEventMulticaster looks up event listeners from the context
  • Bean lookup calls getObject(…) method on the RepositoryFactoryBean that is currently initialized. The repository field was not yet set therefore the call fails with an NPE

 

Stack trace and reproducer are attached


Affects: 2.2.3 (Moore SR3)

Attachments:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions