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

Could not find any META-INF/persistence.xml file in the classpath #5819

Closed
nimo23 opened this issue Nov 27, 2019 · 10 comments · Fixed by #7111
Closed

Could not find any META-INF/persistence.xml file in the classpath #5819

nimo23 opened this issue Nov 27, 2019 · 10 comments · Fixed by #7111
Labels
area/hibernate-orm Hibernate ORM kind/enhancement New feature or request
Milestone

Comments

@nimo23
Copy link
Contributor

nimo23 commented Nov 27, 2019

Describe the bug

I added hibernate extension in quarkus and set up database/hibernate properties by application.properties. However, the following info is shown in the log when starting the application:

...
Listening for transport dt_socket at address: 5005
00:26:52,646 INFO  [org.jbo.threads] JBoss Threads version 3.0.0.Final
00:26:53,682 INFO  [org.hib.jpa.boo.int.PersistenceXmlParser] HHH000318: 
Could not find any META-INF/persistence.xml file in the classpath
00:26:53,843 INFO  [org.hib.Version] HHH000412: Hibernate Core {5.4.9.Final}
...

Expected behavior
As persistence.xml is optional, the info Could not find any META-INF/persistence.xml file in the classpath is irritating. Should the user include this file or not? If the user includes it, then the set database properties of application.properties are ignored according to official documentation.

Environment:

  • Quarkus version or git rev: 1.0 final
@nimo23 nimo23 added the kind/bug Something isn't working label Nov 27, 2019
@gsmet
Copy link
Member

gsmet commented Nov 28, 2019

You don't need to include it. I agree we should probably get rid of it somehow.

@gsmet gsmet added good first issue Good for newcomers area/persistence OBSOLETE, DO NOT USE kind/enhancement New feature or request and removed good first issue Good for newcomers kind/bug Something isn't working labels Nov 28, 2019
@nimo23
Copy link
Contributor Author

nimo23 commented Nov 28, 2019

A solution could be to remap log level of this message from INFO to DEBUG.

@Sanne
Copy link
Member

Sanne commented Dec 2, 2019

If someone sends a PR to improve this I'll be happy to merge it.

Should the user include this file or not?

A suggestion: It shouldn't confuse you as it's not yelling at you, nor stating anything which implies this is "wrong" in any way. It's just stating a fact, and as such it's stated as INFO.

@nimo23
Copy link
Contributor Author

nimo23 commented Jan 31, 2020

It shouldn't confuse you as it's not yelling at you

The message is irritating even with INFO, because it says quarkus cannot found something, so users think that something is missing..

I think, the message should be inverted. Instead of saying

INFO: Could not find any META-INF/persistence.xml file in the classpath

it should say:

INFO: Found META-INF/persistence.xml file in the classpath.

or better:

INFO: Parse META-INF/persistence.xml file.

to indicate that quarkus uses the persistence.xml (if it was found) instead of the default jpa settings defined in application.properties.

If no persistence.xml is found, then no log should be shown because it already uses by default the jpa settings defined in application.properties. If persistence.xml is found, then log should be shown so user knows why the settings of application.properties are bypassed.

@Sanne
Copy link
Member

Sanne commented Jan 31, 2020

No need to discuss further, we already agreed that we should get rid of the message.

Any volunteer? Or I can do it, just need to know.

@Sanne
Copy link
Member

Sanne commented Jan 31, 2020

Well I'll just do it :)

@Sanne Sanne added area/hibernate-orm Hibernate ORM and removed area/persistence OBSOLETE, DO NOT USE labels Jan 31, 2020
@nimo23
Copy link
Contributor Author

nimo23 commented Jan 31, 2020

I would really to contribute but I am not such experienced with quarkus codebase and it will take some time..actually I use wildfly and learn the things around quarkus. I think, in a few month when having more free time and general quarkus knowledge, I will dig into the source code and can contribute..but actually this is not possible.

@Sanne
Copy link
Member

Sanne commented Jan 31, 2020

no problem, I normally need to ask for such issues as we're having a lot of them, but this one will only take me a few minutes as I'm already making changes to Hibernate today.

@gsmet
Copy link
Member

gsmet commented Jan 31, 2020

@Sanne this resonates a bit with #6805 .

I wonder if we should have a configuration property to ignore persistence.xml altogether which would be true by default as we wouldn't care about it most of the time.

Thought I might mention it as it's connected.

@Sanne
Copy link
Member

Sanne commented Jan 31, 2020

thanks @gsmet, right definitely connected. Not sure about having it as default but it's worth thinking.

either way, I'm going to need this: hibernate/hibernate-orm#3205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants