Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeanNotOfRequiredTypeException after upgrading from version: 6.1.14 to 6.2.1 #34187

Open
zesman21 opened this issue Jan 2, 2025 · 3 comments · May be fixed by #34191
Open

BeanNotOfRequiredTypeException after upgrading from version: 6.1.14 to 6.2.1 #34187

zesman21 opened this issue Jan 2, 2025 · 3 comments · May be fixed by #34191
Labels
status: waiting-for-triage An issue we've not yet triaged or decided on

Comments

@zesman21
Copy link

zesman21 commented Jan 2, 2025

Hi,

i am getting this exception from spring after upgrading versions from 6.1.14 to 6.2.1

Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'CTIChild' is expected to be of type 'org.springframework.transaction.TransactionManager' but was actually of type 'org.springbug.txbug.CTIChild$$SpringCGLIB$$0'

i created an example project where the issue can be reproduced.

https://github.com/zesman21/springbug/tree/main

This commit intruduced this spring framework issue:
#24291

can you please have a look at that issue and confirm that this is a real bug?

thanks

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jan 2, 2025
@quaff
Copy link
Contributor

quaff commented Jan 3, 2025

You can fix it by using @Component("CTIChild") instead of @Component @Qualifier("CTIChild"), please refer to Javadoc of Qualifier.

This annotation may be used on a field or parameter as a qualifier for candidate beans when autowiring. It may also be used to annotate other custom annotations that can then in turn be used as qualifiers.

@zesman21
Copy link
Author

zesman21 commented Jan 3, 2025

thx for the info

@quaff
Copy link
Contributor

quaff commented Jan 3, 2025

I think it's a regression, fixed by #34191.

quaff added a commit to quaff/spring-framework that referenced this issue Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged or decided on
Projects
None yet
3 participants