-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
io.quarkus.hibernate.orm.runtime.boot.QuarkusEnvironment - hibernate.properties has leading "/". It causes the file can not be read. #17515
Comments
to be fair the use of 'hibernate.properties' is deprecated in Quarkus as it
bypasses our ability to warn & amend for critical configuration mistakes -
which is important to us as it's otherwise fairly complex to integrate
Hibernate ORM in Quarkus correctly and without causing lots of difficult to
diagnose issues.
Could you elaborate on why you're needing to use it?
…On Fri, 28 May 2021, 08:55 quarkus-bot[bot], ***@***.***> wrote:
/cc @Sanne <https://github.com/Sanne>, @gsmet <https://github.com/gsmet>,
@yrodiere <https://github.com/yrodiere>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#17515 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAKMTJJE44R576YX6X7KK3TP5D57ANCNFSM45V7KK2A>
.
|
I tried use it only for set hibernate.integration.envers.enabled (#17516) If hibernate.properties' is deprecated and this fragment is never executed ( classLoader.getResourceAsStream("/hibernate.properties") ALWAYS return null) I suggest remove this code. It can be confusing for users. I tried using this hibernate.properties after reading this class (with full awareness that is depracated) but It took me a while to realize that this piece of code would never execute. |
Good point, I'll get rid of it. To be clear while we had deprecated it, I didn't know that it wasn't working at all - but it's a great indicator about how widely used this was! |
The offending class was removed as part of #17538 : https://github.com/quarkusio/quarkus/pull/17538/files#diff-890a90ad2811570bef83600bec368cb7ff101c1cca5a4a975e6ea881b40f0167 Closing this issue as it is no longer relevant. Thanks for starting the discussion @maciekg89! |
Describe the bug
There is following line:
InputStream stream = classLoader.getResourceAsStream("/hibernate.properties");
the leading "/" causes the method to always return null.
https://stackoverflow.com/questions/47900677/where-does-leading-slash-in-java-class-loader-getresource-leads-to
I am aware that this is legacy fragment, but to fix it, only deleting "/" is required.
The text was updated successfully, but these errors were encountered: