Skip to content

Bean creation lazily ignores annotations like @EventListener #34057

@nmirzadeh

Description

@nmirzadeh

I have a scenario to create a bean lazily. The class annotation with @eventlistener. The object was created, but it didn't listen to any event. I had to change the class to implement EventListener.

I have created one small project to demonstrate the issue. There are two tests where one eagerly creates a bean, and the other one creates lazily. The failing one shows the bean doesn't have the point cut of @eventlistener annotation. I used other types of annotation (e.g. @Cacheable)
bean-with-annotation.zip
, but the effect was the same.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions