Describe the bug
When executing quarkus in dev mode, if a resource bundle is added to the resources folder, e.g., to src/main/resources/i18n/i18n.properties, calling the method ResourceBundle.getBundle("i18n/i18n") will throw MissingResouce exception. This is happening on quarkus 1.3.0.
Expected behavior
ResourceBundle successfully loads the bundle.
Actual behavior
ResourceBundle throws MissingResource exception.
To Reproduce
Steps to reproduce the behavior:
Hi,
Just for our information, is this something that was working in a previous version of Quarkus?
It would be nice if you provided a reproducer for this, because I was not able to reproduce the problem in a test project.
The reproducer is here https://github.com/AmsterdamFilho/quarkus-poc
But actually, the problem only happens when the instruction ResouceBundle.getBundle("i18n/i18n") is on a library, which unfortunately is my case.
To use the reproducer, just execute the project in dev mode and open swagger-ui. The only endpoint will throw the MissingResource exception. If you package the application, though, it will not.
I had many issues similar to this one before version 1.3.0, when things would work after package, but not in dev mode. They were all solved by the new ClassLoader.
I would try with ResourceBundle.getBundle("i18n/i18n", Locale.getDefault(), Thread.currentThread().getContextClassLoader()).
It worked. Should the ticket be closed?
I think it should.
In general, all resources should be loaded like @gsmet mentions, since it's the only guaranteed way to have it work in dev mode.
Most helpful comment
I would try with
ResourceBundle.getBundle("i18n/i18n", Locale.getDefault(), Thread.currentThread().getContextClassLoader()).