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.

In Quarkus, default h2 datasource configuration breaks dev services feature

See original GitHub issue

This issue was imported from JIRA:

Field Value
JIRA Link CAM-14830
Reporter @yanavasileva
Has restricted visibility comments true

Environment (Required on creation):

Quarkus extension

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

Quarkus offers a feature to create database with zero configuration <1> in dev mode that doesn’t work with Camunda implementation. The database cannot be created because of the h2 datasource configuration provided by default. Observed exception:

2022-08-24 10:57:06,677 ERROR <io.qua.run.Application> (Quarkus Main Thread) Failed to start application (with profile dev): java.sql.SQLException: Driver does not support the provided URL: jdbc:h2:./camunda-h2-dbs/process-engine;TRACE*LEVEL_FILE=0;DB_CLOSE_ON*EXIT=FALSE
        at io.agroal.pool.ConnectionFactory.connectionSetup(ConnectionFactory.java:220)
        at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:204)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:470)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:452)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:68)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
        at java.base/java.lang.Thread.run(Thread.java:832)

Steps to reproduce (Required on creation):

  1. Use the Quarkus datasource example
  2. Remove the h2 driver dependency and uncomment the postgresql dependency in the pom.xml file
  3. Comment provided configuration in application.properties file and add the following line:
quarkus.datasource.db-kind = postgresql
  1. Spin up the example in dev mode
mvn clean compile quarkus:dev

Observed Behavior (Required on creation):

The application fails with SQLException due to missing h2 driver.

Expected behavior (Required on creation):

The application starts in dev mode and creates out of the box postgresql database.

Root Cause (Required on prioritization):

Quarkus extension is provided with default h2 datasource configuration which prevents application from spin up a different database with no configuration provided by the user.

Solution Ideas (Optional):

Removed the default datasource properties so the users can get better use of Quarkus developer tool. Take care of providing datasource configuration for our test suite that relies on the default configuration at the moment.

Hints (optional):

<1>: https://quarkus.io/guides/datasource#dev-services

Links:

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
yanavasilevacommented, Nov 17, 2022

Handover for testing.

Test with Quarkus datasource example. Requirement: running Docker and Portainer. Suggested scenarios:

  1. Running the application in dev mode with config:
  • quarkus.datasource.db-kind = pg, with only postgresql jdbc driver, expected a docker container is created
  • quarkus.datasource.db-kind = h2, with only h2 jdbc driver, Edit: expected a docker container is created an in-memory database is used
  • quarkus.datasource.db-kind = mysql, with only mysql jdbc driver, expected a docker container is created
  • camunda h2 datasource config, with only h2 jdbc driver
  • camunda postgresql config, with only postgresql jdbc driver
  • camunda mysql config, with only mysql jdbc driver
  1. Packaging and running the application with config:
  • camunda h2 datasource config, with only h2 jdbc driver
  • camunda postgresql config, with only postgresql jdbc driver
  • camunda mysql config, with only mysql jdbc driver
0reactions
gbetances089commented, Nov 17, 2022

Tested on the following config/versions:

DEV mode:

7.19.0-SNAPSHOT

  • quarkus.datasource.db-kind = pg, with only postgresql jdbc driver Screenshot 2022-11-17 at 15 28 19

  • Camunda h2 datasource config, with only h2 jdbc driver Screenshot 2022-11-17 at 16 37 50

7.18.1-SNAPSHOT

  • quarkus.datasource.db-kind = mysql, with only mysql jdbc driver Screenshot 2022-11-17 at 13 31 10

  • Camunda postgresql config, with only postgresql jdbc driver Screenshot 2022-11-17 at 16 21 59

7.17.7-SNAPSHOT

  • quarkus.datasource.db-kind = h2, with only h2 jdbc driver image

  • Camunda mysql config, with only mysql jdbc driver Screenshot 2022-11-17 at 16 32 20

Packaging mode:

7.19.0-SNAPSHOT Camunda h2 datasource config, with only h2 jdbc driver Screenshot 2022-11-17 at 17 06 45

7.18.1-SNAPSHOT Screenshot 2022-11-17 at 17 10 57

7.17.7-SNAPSHOT Screenshot 2022-11-17 at 17 16 15

Test cases:

Read more comments on GitHub >

github_iconTop Results From Across the Web

All configuration options - Quarkus
AWS Lambda Type Default AWS Lambda Common Type Default AWS Lambda Gateway REST API Type Default Agroal ‑ Database connection pool Type Default
Read more >
Quarkus - All configuration options
AWS Lambda Type Default Agroal ‑ Database connection pool Type Default quarkus.datasource.jdbc.url. The datasource URL string Additional named datasources Type Default
Read more >
Home of Quarkus Cheat-Sheet - GitHub Pages
Quarkus adds a Dev UI console to expose extension features. The Dev UI is available in ... quarkus.datasource.jdbc.url=jdbc:h2:tcp://localhost/mem:default .
Read more >
Configuring data sources in your Quarkus applications
Configure a data source for your Quarkus application using extensions for built-in database drivers and connect your application to a ...
Read more >
Keycloak 20.0.0 released
In Keycloak 17.0.0 the new Quarkus based distribution of Keycloak, ... Keycloak ships for development purposes with an H2 database driver.
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