question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot launch with zero-config postgres devservice database: "configured datasource <default> not found"

See original GitHub issue

Quarkus 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

  1. Go to code.quarkus.io
  2. Select hibernate ORM and JDBC-PostgreSQL
  3. 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:open
  • Created 2 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Felkcommented, Feb 7, 2022

@Felk I faced this and the problem is you need docker running on your windows, not on your wsl2 distro.

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!

0reactions
gilvansfilhocommented, Feb 8, 2022

Sorry @Felk I hadn’t seen this before the last reply.

My solution was to also run mvn quarkus:dev within WSL2, not on the Windows host machine. It then works as expected, very nice!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found