-
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
Failed to start quarkus due to hibernate-orm datasource related config issue/bug(?) #23563
Comments
You still need a default datasource, i.e. one without a or b. |
I wonder why, though? IIRC, when it comes to JPA persistence units, the default one is automatically disabled (unless explicitly configured) as soon as there are named persistence units. Can't we do the same for datasources? On a side note, this NPE is definitely not good user experience, and that at least should be fixed. I'll look into it. Could someone else more familiar with the agroal/datasource part please look into why we always need a default datasource? And maybe document it, since it seems the user guide doesn't explicitly warn that you always need a default datasource. |
Thanks for your feedback. As mentioned in the initial post, I already tried after making postgres the default datasource by removing 'a' but still get same stacktrace. I adapted the application.properties, making postgres default AND also removed the quarkus.hibernate-orm.packages resulting in:
Now quarkus starts up without the mentioned exception, however messes up access by querying tables from datasource b (oracle) using the default datasource (postgres). So seems the problem is related to quarkus.hibernate-orm.packages. FYI: my.package.model.a: contains an @entity class which extends PanacheEntityBase with @table referring to a postgres table |
That's because you didn't assign datasource b to persistence unit b:
EDIT: also, dropping |
@yrodiere I only desparately try to get two datasources plugged to two distinct packages to work. I dont understand what magic is going on and fails with this config. I see no significant difference to the example config from documentation (https://quarkus.io/guides/hibernate-orm#multiple-persistence-units) I adapted the config to:
and get the same stack trace. What seems also weird, is
|
It does seem weird, but I'm not sure it's related. I imagine you have a dependency to panache in your POM, but you're not extending |
OK then I would ignore it if this is normal. My entities extend PanacheEntityBase because I need custom IDs. my.package.model.a: contains an entity class which extends PanacheEntityBase with table referring to a postgres table my.package.model.b: contains an entity class which extends PanacheEntityBase with table referring to a oracle table |
Ok, I had a closer look at the stack trace. This is not a configuration problem at all, this is a bug in Quarkus, and it's been solved in #23422, which has merged in Quarkus 2.7.1.Final. I'll close this ticket as duplicate of #23422. If the problem still occurs with Quarkus 2.7.1.Final, please reopen. |
Duplicate of #23422 |
Hello, I am just starting with quarkus and just cannot get it started with two defined datasources (postgres, oracle), configured like
(Referring to https://quarkus.io/guides/datasource#other-databases)
In the stacktrace I have no clue whats wrong, assuming the warnings are not related.
Considering
Unable to determine a database type for default datasource
I also tried to remove the name 'a' of the postgres datasource to make it the default datasource but it didn't help.Any ideas?
The text was updated successfully, but these errors were encountered: