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
In Spring Boot 3.0.3, component scanning does not work when application's path contains one characters that would be URL encoded and it's not being run as an archive #34379
Comments
Here you have a simple project that reproduces the issue: https://github.com/lspil/youtubechannel/tree/master/sb303_issue_rep |
Also, here's a short unlisted video with my issue: https://www.youtube.com/watch?v=5pLtEWy7ByA |
@lspil I run the sample on both Java 19 and Java 17 and cannot reproduce this issue. |
Hi @wilkinsona , As you have suspected it's a Windows-specific problem related to component scanning, Is there any way to fix it at our end? |
Thanks for trying the sample, @maciejwalkowiak. I too cannot reproduce the problem on macOS. My suspicion is that it's a Windows-specific problem as both @lspil and @dev-himanshu, the raiser of #34380, are using Windows. What OS did you try on, @maciejwalkowiak? @lspil Can you please run your application on the command line using Maven with trace level logging enabled:
Please do this with both Spring Boot 3.0.2 and Spring Boot 3.0.3 and share the complete output of both runs. It would also be interesting to know if the problem occurs with Spring Boot 3.0.3 when you downgrade to Spring Framework 6.0.4. You can do so by adding |
Hi @wilkinsona, |
@wilkinsona on MacOS. Will give a try on Windows later this weekend. |
I can reproduce the problem. Rather than being specific to Windows, it happens when the application's path contains a space, which is much more common on Windows than it is on other operating systems. The log output for #34380 shows multiple spaces in the path:
I cannot reproduce the problem, even with a space in the application's path, when using Spring Boot 3.0.3 and Framework 6.0.4 @dev-himanshu, are you certain that your downgrade to Spring Framework 6.0.4 was effective? |
It looks like it's a URL encoding problem:
Note the |
#30031 is already tracking this on the Framework side. Closing in favor of that issue. We'll pick up a new release of Framework that fixes the problem in due course. |
I am sure that downgrade to spring framework 6.0.4 was not effective in my case. |
Thanks, @dev-himanshu |
@dev-himanshu Was Framework 6.0.4 definitely on the classpath? If it was, you appear to have a different problem. It would be interesting to know if your application works when run from a location with no spaces in its path. |
I had exactly the same problem with two Spring Boot 3.0.3 projects on Windows OS, I replaced all the spaces in the path with hyphens Like lspil said, I didn't have this problem on 3.0.2. |
Thanks everyone! You're such a great team! I love this community! |
In Runner.java
Console Output:
Hello @wilkinsona |
Thanks for the confirmation, @dev-himanshu. |
you're welcome @wilkinsona |
This also happens if the path contains other chars like |
I have issue with spring boot 3.0.3 using Ubuntu, I'm not sure if it is specific to Windows. Previously I was using Spring Boot 3.0.2 and had no problems. Looks like spring is not scanning for components.
|
@kamrankamilli As described in the existing comments on this issue, the problem is not specific to Windows. It will affect an application on any OS when there are characters in its path that are encoded when included in a URL. Spaces are probably the most common. |
@wilkinsona Yeah I had space in my project folder name, now it is working thanks |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as resolved.
This comment was marked as resolved.
Any luck fixing issue on 3.0.3 ? |
@HerNidza You can downgrade the spring Framework to 6.0.4 and still use spring-boot 3.0.3 until this is fixed. |
@123Haynes Awesome! Thanks a lot! |
For anyone watching this issue, we've just done an earlier than scheduled 3.0.4 release to specifically address this regression. Please upgrade. |
Hi @philwebb, thanks for the update in that issue. I have tried with latest release of 3.0.4 and now working fine. |
Write any simple configuration class:
Any of these beans are not created. If you add a breakpoint in the methods and start with debug you can see that they are not called at all.
However, adding a @bean method in the Main class works:
This issue cannot be reproduced with 3.0.2.
The text was updated successfully, but these errors were encountered: