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

io.quarkus.hibernate.orm.runtime.boot.QuarkusEnvironment - hibernate.properties has leading "/". It causes the file can not be read. #17515

Closed
maciekg89 opened this issue May 28, 2021 · 5 comments
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant

Comments

@maciekg89
Copy link

maciekg89 commented May 28, 2021

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.

@maciekg89 maciekg89 added the kind/bug Something isn't working label May 28, 2021
@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE labels May 28, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented May 28, 2021

/cc @Sanne, @gsmet, @yrodiere

@maciekg89 maciekg89 changed the title io.quarkus.hibernate.orm.runtime.boot.QuarkusEnvironment - hibernate.properties io.quarkus.hibernate.orm.runtime.boot.QuarkusEnvironment - hibernate.properties has leading "/". It causes the file can not be read. May 28, 2021
@Sanne
Copy link
Member

Sanne commented May 28, 2021 via email

@maciekg89
Copy link
Author

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.

@Sanne
Copy link
Member

Sanne commented May 28, 2021

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!

@yrodiere
Copy link
Member

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!

@yrodiere yrodiere added the triage/out-of-date This issue/PR is no longer valid or relevant label Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE kind/bug Something isn't working triage/out-of-date This issue/PR is no longer valid or relevant
Projects
None yet
Development

No branches or pull requests

3 participants