J M Patel
J M Patel

Reputation: 31

quarkus reactive hibernate connection

I am running a test case and while executing it gives me following error

[ERROR] Errors: 
[ERROR]   xxRepositoryTest.getFirstxxx » Runtime java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
    [error]: Build step io.quarkus.agroal.deployment.AgroalProcessor#build threw an exception: io.quarkus.runtime.configuration.ConfigurationException: Unable to find a JDBC driver corresponding to the database kind 'mysql' for the default datasource. Either provide a suitable JDBC driver extension, define the driver manually, or disable the JDBC datasource by adding 'quarkus.datasource.jdbc=false' to your configuration if you don't need it.
    at io.quarkus.agroal.deployment.AgroalProcessor.resolveDriver(AgroalProcessor.java:353)
    at io.quarkus.agroal.deployment.AgroalProcessor.getAggregatedConfigBuildItems(AgroalProcessor.java:299)
    at io.quarkus.agroal.deployment.AgroalProcessor.build(AgroalProcessor.java:87)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
    at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
    at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
    at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
    at java.base/java.lang.Thread.run(Thread.java:833)
    at org.jboss.threads.JBossThread.run(JBossThread.java:501)

this is how my property file looks:

# datasource configuration
prod.quarkus.datasource.db-kind=mysql
prod.quarkus.datasource.username=<schema>
prod.quarkus.datasource.password=<pwd>
prod.quarkus.datasource.reactive.url=vertx-reactive:mysql://<url>
prod.quarkus.datasource.jdbc=false

To pass the test what is missing my configuration. In pom.xml following imported:

`       <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-reactive</artifactId>
        </dependency>

        <dependency>
            <groupId>io.smallrye.reactive</groupId>
            <artifactId>smallrye-mutiny-vertx-mysql-client</artifactId>
        </dependency>

`

Upvotes: 1

Views: 252

Answers (1)

J M Patel
J M Patel

Reputation: 31

I found the solution here: https://github.com/quarkusio/quarkus/issues/21227 following can not be imported:

<dependency>
  <groupId>io.quarkus</groupId>
  <artifactId>quarkus-security-jpa</artifactId>
</dependency>

Upvotes: 1

Related Questions