Skip to content

After upgrade from 6.1.16 to 6.2.12 beans defined by component-scan are not visible on Windows enviroment #35682

@ansokpl

Description

@ansokpl

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.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issuestatus: feedback-providedFeedback has been provided

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions