Skip to content
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

Resource loading of message bundles always needs classpath prefix #18368

Open
philwebb opened this issue Sep 26, 2019 · 0 comments
Open

Resource loading of message bundles always needs classpath prefix #18368

philwebb opened this issue Sep 26, 2019 · 0 comments
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@philwebb
Copy link
Member

The fix for spring-projects/spring-hateoas#1075 shows that the ResourceLoader used by devtools seems to require the classpath: prefix.

This issue was raised by @odrotbohm on Slack:

In my local test, I immediately run into DefaultResourceLoader, whereas the Boot project ends up in GenericApplicationContext, which then delegates to org.springframework.boot.devtools.restart.ClassLoaderFilesResourcePatternResolver which in turn delegates to a org.springframework.web.context.support.ServletContextResourcePatternResolver.

It's a bit tricky [to reproduce]. The original request is this one: spring-projects/spring-hateoas#1075. I managed to see the resources not being loaded when putting a breakpoint at ReloadableResourceBundleMessageSource.refreshProperties(…). The Resource lookup returns the ServletContextResource when you initiate the request like Kai describes.
My local test for this has been introduced here: spring-projects/spring-hateoas@507f7de. You can also see that I tweaked the setup to explicitly include the classpath: prefix for that. However, the test actually succeeds without that addition as well.

@philwebb philwebb added the status: waiting-for-triage An issue we've not yet triaged label Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

1 participant