-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Component scan fails to find jar entries in WEB-INF/classes with embedded Tomcat #34348
Comments
@osnsergey this looks like a highly custom launcher which makes it hard to reason about on my end. There is nothing wrong with such a custom setup, I would just appreciate some debugging on your end: specifically, what kind of resources
|
@jhoeller the debugging shows the following:
the resource URL for the base path resource in the
this URL where the Component Scan should get annotated bean candidates.
the
The code on lines 817 - 820 skips bean candidates from the |
Thanks for the thorough analysis! I'll try to cover this scenario for 6.2.3. |
It seems that we simply need to clean the path before matching it against jar entries in the cache. I haven't seen any other encounters of that difference in the common code paths there, so I'm going with the simplest possible change. This will be available in the upcoming 6.2.3 snapshot; it makes your repro setup pass for me locally. |
@osnsergey it'd be great if you could give a 6.2.3 snapshot a try with your full application as well (in advance of the 6.2.3 release on Feb 13), just to make sure we're not missing anything that keeps breaking your setup. |
@jhoeller , I've tried to run full application on 6.2.3-SNAPSHOT build and the issue with component scan looks resolved. Thank you for the quick fix! |
Description
Component Scan can't find annotated beans in the Web application.
Reproducer
A small sample application for the issue has been created: GitHub Repository (Java 17, Gradle).
Exception Stack Trace:
How to reproduce
Clone https://github.com/osnsergey/Spring62TestWebApp, use README.md commands to run the sample.
The text was updated successfully, but these errors were encountered: