-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Description
I’m encountering an issue with component scanning after upgrading from Spring 6.1.16 to 6.2.11.
The problem occurs only on Windows, while the same codebase works correctly on Linux.
After the upgrade, beans that should be automatically detected and registered in the Spring context through component scanning are no longer visible. As a result, the application fails to start with the following error:
No qualifying bean of type [...]
When I explicitly define the affected beans in a @Configuration class, they are successfully loaded on Windows as well. This suggests that the issue is limited to the component scanning mechanism.
The issue persists in version 6.12.2 as well
Additional Context
From the 6.2 release notes:
Classpath scanning comes with internal JAR caching now, which is beneficial for repeated component scan attempts. However, this can cause regressions if such caching is unexpected.
As of 6.2.6, you may revert to the previous behavior through
setUseCaches(false) on PathMatchingResourcePatternResolver.
Applying this setting in my project resolves the issue — component scanning starts working again on Windows.