You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
quarkus.hibernate-orm.query.* properties exist in the Hibernate ORM extension; there is a config group called query.
quarkus.hibernate-orm is also a configuration map, so quarkus.hibernate.orm."persistence-uni-name".* exists to, and quarkus.hibernate-orm.query.* could be interpreted as "configuration for the persistence unit named query".
There is, however, little to no overlap between those two possible meanings: the * in the patterns above will rarely, if ever, be the same.
Nevertheless, our config seems to always assume that a property starting with quarkus.hibernate-orm.query.* has the first meaning, regardless of what's in *, leading to that configuration property being ignored, because it doesn't matched any config mapping.
Expected behavior
I'd expect quarkus.hibernate-orm.query.datasource to be interpreted as "the datasource for the persistence unit named query" rather than "the datasource config property for the query config group, since only the former actually makes sense and has a matching config mapping.
Actual behavior
quarkus.hibernate-orm.query.datasource is interpreted as "the datasource config property for the query config group, which doesn't make sense.
java.lang.RuntimeException: java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#configurationDescriptorBuilding threw an exception: io.quarkus.runtime.configuration.ConfigurationException: Model classes are defined for the default persistence unit, but no default datasource was found. The default EntityManagerFactory will not be created. To solve this, configure the default datasource. Refer to https://quarkus.io/guides/datasource for guidance.
Edit the application.properties with this content:
Not this is with Quarkus 3.6.6; I didn't try this myself, so it might be solved with the large refactorings that happened in... 3.7 I think? We'd need to check.
The Hibernate Config is still using the old config structure, which seems to have a bug in the case where a Map key shadows a group property.
Moving to mappings should be able to fix the issue. In the meantime, my recommendation is to not use a map key that may shadow other configuration properties from the config root.
Describe the bug
See https://stackoverflow.com/questions/77842431/quarkus-unable-to-name-a-datasource-query
Essentially:
quarkus.hibernate-orm.query.*
properties exist in the Hibernate ORM extension; there is a config group calledquery
.quarkus.hibernate-orm
is also a configuration map, soquarkus.hibernate.orm."persistence-uni-name".*
exists to, andquarkus.hibernate-orm.query.*
could be interpreted as "configuration for the persistence unit namedquery
".*
in the patterns above will rarely, if ever, be the same.quarkus.hibernate-orm.query.*
has the first meaning, regardless of what's in*
, leading to that configuration property being ignored, because it doesn't matched any config mapping.Expected behavior
I'd expect
quarkus.hibernate-orm.query.datasource
to be interpreted as "the datasource for the persistence unit namedquery
" rather than "thedatasource
config property for thequery
config group, since only the former actually makes sense and has a matching config mapping.Actual behavior
quarkus.hibernate-orm.query.datasource
is interpreted as "thedatasource
config property for thequery
config group, which doesn't make sense.How to Reproduce?
Copied from https://stackoverflow.com/questions/77842431/quarkus-unable-to-name-a-datasource-query
Checking out the quickstart from here https://github.com/quarkusio/quarkus-quickstarts.git
On hibernate-orm-panache-quickstart: Edit the application.properties with this content:
Run the test: FAILED
Edit the application.properties with this content:
Run the test: PASS
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.6.6
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: