Skip to content

Spring Boot 2.2.0: ClassPathScanningCandidateComponentProvider findCandidateComponents method #18684

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

Closed
graiffr opened this issue Oct 22, 2019 · 6 comments

Comments

@graiffr
Copy link

graiffr commented Oct 22, 2019

After upgrading to version 2.2.0 the method findCandidateComponents of class ClassPathScanningCandidateComponentProvider, seems not found the classes with the specified user package name.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 22, 2019
@wilkinsona
Copy link
Member

Thanks for the report, but I can't tell what the problem might be from the information that you have provided thus far. ClassPathScanningCandidateComponentProvider is part of Spring Framework so it could be that the problem lies there rather than in Spring Boot. Its ability to find entries on the classpath is also affected by things like Spring Boot's LauchedURLClassLoader and fat jar support so the problem could be in Spring Boot.

In short, if you'd like us to spend some time trying to diagnose the problem that you are having, please take some time to describe it in detail and to provide a small sample that reproduces it, in the form of a project that has been zipped up and attached to this issue.

@wilkinsona wilkinsona added the status: waiting-for-feedback We need additional information before we can continue label Oct 22, 2019
@spring-projects-issues
Copy link
Collaborator

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

@spring-projects-issues spring-projects-issues added the status: feedback-reminder We've sent a reminder that we need additional information before we can continue label Oct 29, 2019
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Nov 5, 2019
@graiffr
Copy link
Author

graiffr commented Feb 4, 2020

Hello, I have attached
BootTest.zip
a little test code so you can investigate about the issue.

@wilkinsona
Copy link
Member

wilkinsona commented Feb 4, 2020

Thanks for the sample. There is no retention policy on your custom annotations so it defaults to RetentionPolicy.CLASS. If you configure runtime retention (@Retention(RetentionPolicy.RUNTIME)) you will see that BeanTwo is found as expected.

It was a bug in Spring Framework 5.1 that led to annotations without runtime retention being discovered. That was corrected in spring-projects/spring-framework#22886.

@graiffr
Copy link
Author

graiffr commented Feb 4, 2020

You are right. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants