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:
You don't need to include it. I agree we should probably get rid of it somehow.
A solution could be to remap log level of this message from INFO to DEBUG.
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.
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.propertiesare bypassed.
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.
Well I'll just do it :)
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.
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.
@Sanne this resonates a bit with https://github.com/quarkusio/quarkus/issues/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.
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: https://github.com/hibernate/hibernate-orm/pull/3205
Most helpful comment
@Sanne this resonates a bit with https://github.com/quarkusio/quarkus/issues/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.