Skip to content

PathMatchingResourcePatternResolver can no longer handle paths containing spaces and special characters #30031

Closed
@whydoievenneedthis

Description

@whydoievenneedthis

Affects: spring-core : 6.0.5


When the spring application is in a directory that contains a space, it skips probably all @ComponentScan-based bean creations (I am sure it skips all @Configuration classes, and I suspect it also skips all @RestControllers as well, so it is a pretty safe bet to assume that it skips everything else as well):

2023-02-25 01:09:30.921 DEBUG [           main] o.s.c.i.s.PathMatchingResourcePatternResolver : 
Failed to complete search in directory 
[C:\My%20Projects\sample\build\classes\java\main\com\example] for files matching pattern 
[**/*.class]: java.nio.file.NoSuchFileException: 
C:\My%20Projects\sample\build\classes\java\main\com\example

Functionality was working fine with 6.0.4.

Also, log level either in the line above, or somewhere close by must be ERROR, not DEBUG.

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions