Cannot launch with zero-config postgres devservice database: "configured datasource <default> not found"
See original GitHub issueQuarkus fails to boot with a “zero config setup” for datasources as described in the datasource guide, which states:
If you want to use Dev Services then all you need to do is include the relevant extension for the type of database you want (either reactive or JDBC, or both), and don’t configure a database URL, username and password, Quarkus will provide the database and you can just start coding without worrying about config.
Instead, it asks me to configure the default data source.
reproduce
- Go to code.quarkus.io
- Select hibernate ORM and JDBC-PostgreSQL
- download the project and try to run it with
mvn quarkus:dev
Quarkus fails to boot with the following error:
2022-01-28 11:22:33,136 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (Aesh InputStream Reader) Failed to start quarkus: java.lang.RuntimeException: java.lang.RuntimeException: Failed to start quarkus
at io.quarkus.dev.appstate.ApplicationStateNotification.waitForApplicationStart(ApplicationStateNotification.java:51)
[...]
... 1 more
Caused by: java.lang.RuntimeException: io.quarkus.runtime.configuration.ConfigurationException: Model classes are defined for the default persistence unit <default> but configured datasource <default> not found: the default EntityManagerFactory will not be created. To solve this, configure the default datasource. Refer to https://quarkus.io/guides/datasource for guidance.
at io.quarkus.hibernate.orm.runtime.JPAConfig.startAll(JPAConfig.java:72)
[...]
environment
quarkus 2.6.3
windows, with docker in WSL2 Ubuntu 20.04
OpenJDK Temurin-17.0.1+12
maven 3.8.2
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Dev Services for Databases - Quarkus
When testing or running in dev mode Quarkus can provide you with a zero-config database out of the box, a feature we refer...
Read more >Zero Config Database configuration with Quarkus (DevServices)
Quarkus 1.13 ships with a new feature called "DevServices" which allows testing or running in dev mode Quarkus without an actual database ......
Read more >Home of Quarkus Cheat-Sheet - GitHub Pages
By default there is no timeout but can be set by using the ... quarkus: datasource: url: jdbc:postgresql://localhost:5432/some-database driver: ...
Read more >Quarkus and how to implement in-memory, entities and DAO
I looked at Zero Config Setup (DevServices), but this doesn't allow me to ... how to launch an H2 database thanks to io.quarkus.test.h2....
Read more >How to build a Spring Boot App providing a GUI with Vue.js
Using Heroku's Postgres as Database for Spring Boot backend and Vue.js ... for explicit configuration files - and thus you wont find any...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Oh, that is good to know, thank you! I switched from Docker Desktop to docker-ce in WSL2 due to Docker Desktop’s licensing changes, so there’s no going back for me.
My solution was to also run
mvn quarkus:dev
within WSL2, not on the Windows host machine. It then works as expected, very nice!Sorry @Felk I hadn’t seen this before the last reply.