In Quarkus, default h2 datasource configuration breaks dev services feature
See original GitHub issueThis 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):
- Use the Quarkus datasource example
- Remove the
h2
driver dependency and uncomment thepostgresql
dependency in thepom.xml
file - Comment provided configuration in
application.properties
file and add the following line:
quarkus.datasource.db-kind = postgresql
- 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:
- is related to https://jira.camunda.com/browse/SUPPORT-14412
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
Handover for testing.
Test with Quarkus datasource example. Requirement: running Docker and Portainer. Suggested scenarios:
quarkus.datasource.db-kind = pg
, with only postgresql jdbc driver, expected a docker container is createdquarkus.datasource.db-kind = h2
, with only h2 jdbc driver, Edit: expecteda docker container is createdan in-memory database is usedquarkus.datasource.db-kind = mysql
, with only mysql jdbc driver, expected a docker container is createdTested on the following config/versions:
DEV mode:
7.19.0-SNAPSHOT
quarkus.datasource.db-kind = pg, with only postgresql jdbc driver
Camunda h2 datasource config, with only h2 jdbc driver
7.18.1-SNAPSHOT
quarkus.datasource.db-kind = mysql, with only mysql jdbc driver
Camunda postgresql config, with only postgresql jdbc driver
7.17.7-SNAPSHOT
quarkus.datasource.db-kind = h2, with only h2 jdbc driver
Camunda mysql config, with only mysql jdbc driver
Packaging mode:
7.19.0-SNAPSHOT Camunda h2 datasource config, with only h2 jdbc driver
7.18.1-SNAPSHOT
7.17.7-SNAPSHOT
Test cases: