quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

'Unable to find a JDBC driver' for Hibernate Reactive after updating to 3.7.1 #38533

Closed janek64 closed 9 months ago

janek64 commented 9 months ago

Describe the bug

When using io.quarkus:quarkus-hibernate-reactive-panache with version 3.7.1, the build fails with an error message regarding a missing JDBC driver even though JDBC is not used in the application. In version 3.6.9, the application successfully builds. I am not entirely sure, but it seems like the issue is only reproducible with Gradle.

The application only uses reactive dependencies:

dependencies {
    implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")
    implementation 'io.quarkus:quarkus-resteasy-reactive-jackson'
    implementation 'io.quarkus:quarkus-hibernate-reactive-panache'
    implementation 'io.quarkus:quarkus-reactive-pg-client'
    implementation 'io.quarkus:quarkus-arc'
    implementation 'io.quarkus:quarkus-resteasy-reactive'
    testImplementation 'io.quarkus:quarkus-junit5'
    testImplementation 'io.rest-assured:rest-assured'
}

Furthermore, the configuration is as suggested in the docs:

quarkus.datasource.db-kind = postgresql
quarkus.datasource.username = quarkus_test
quarkus.datasource.password = quarkus_test
quarkus.datasource.reactive.url = vertx-reactive:postgresql://localhost:5432/quarkus_test

Expected behavior

The application starts and accesses the database using Hibernate Reactive.

Actual behavior

The following exception is produced when starting the dev mode:

     2024-02-01 16:37:42,442 ERROR [io.qua.dep.dev.IsolatedDevModeMain] (main) Failed to start quarkus: 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 'postgresql' for the default datasource (available: ''). Check if it's a typo, otherwise 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:371)
        at io.quarkus.agroal.deployment.AgroalProcessor.getAggregatedConfigBuildItems(AgroalProcessor.java:345)
        at io.quarkus.agroal.deployment.AgroalProcessor.build(AgroalProcessor.java:102)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)

        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:334)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:251)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createInitialRuntimeApplication(AugmentActionImpl.java:60)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.firstStart(IsolatedDevModeMain.java:112)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:433)
        at io.quarkus.deployment.dev.IsolatedDevModeMain.accept(IsolatedDevModeMain.java:55)
        at io.quarkus.bootstrap.app.CuratedApplication.runInCl(CuratedApplication.java:138)
        at io.quarkus.bootstrap.app.CuratedApplication.runInAugmentClassLoader(CuratedApplication.java:93)
        at io.quarkus.deployment.dev.DevModeMain.start(DevModeMain.java:131)
        at io.quarkus.deployment.dev.DevModeMain.main(DevModeMain.java:62)
Caused by: 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 'postgresql' for the default datasource (available: ''). Check if it's a typo, otherwise 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:371)
        at io.quarkus.agroal.deployment.AgroalProcessor.getAggregatedConfigBuildItems(AgroalProcessor.java:345)
        at io.quarkus.agroal.deployment.AgroalProcessor.build(AgroalProcessor.java:102)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)

        at io.quarkus.builder.Execution.run(Execution.java:123)
        at io.quarkus.builder.BuildExecutionBuilder.execute(BuildExecutionBuilder.java:79)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:160)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:330)
        ... 9 more
Caused by: io.quarkus.runtime.configuration.ConfigurationException: Unable to find a JDBC driver corresponding to the database kind 'postgresql' for the default datasource (available: ''). Check if it's a typo, otherwise 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:371)
        at io.quarkus.agroal.deployment.AgroalProcessor.getAggregatedConfigBuildItems(AgroalProcessor.java:345)
        at io.quarkus.agroal.deployment.AgroalProcessor.build(AgroalProcessor.java:102)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849)
        at io.quarkus.builder.BuildContext.run(BuildContext.java:256)
        at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
        at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
        at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
        at java.base/java.lang.Thread.run(Thread.java:1583)
        at org.jboss.threads.JBossThread.run(JBossThread.java:501)

When setting the quarkus.datasource.jdbc=false property as suggested, the following error is produced:

     2024-02-01 16:46:07,846 ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error running Quarkus: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:113)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ExceptionInInitializerError
        at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
        at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
        at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103)
        at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:200)
        at java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:549)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 3 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: io.quarkus.agroal.runtime.DataSourcesJdbcBuildTimeConfig
        at io.quarkus.runtime.configuration.AbstractConfigBuilder.withMapping(AbstractConfigBuilder.java:66)
        at io.quarkus.runtime.generated.StaticInitConfigCustomizer.configBuilder(Unknown Source)
        at io.smallrye.config.SmallRyeConfigBuilder.lambda$build$0(SmallRyeConfigBuilder.java:722)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
        at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:722)
        at io.quarkus.runtime.generated.Config.<clinit>(Unknown Source)
        ... 17 more
Caused by: java.lang.ClassNotFoundException: io.quarkus.agroal.runtime.DataSourcesJdbcBuildTimeConfig
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:518)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:468)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:518)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:468)
        at io.quarkus.runtime.configuration.AbstractConfigBuilder.withMapping(AbstractConfigBuilder.java:64)
        ... 29 more

How to Reproduce?

Please find the attached reproducer for the issue:

jdb-driver-exception-reproducer.zip

Output of uname -a or ver

No response

Output of java -version

openjdk 21.0.2 2024-01-16 LTS
OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)

Quarkus version or git rev

3.7.1

Build tool (ie. output of mvnw --version or gradlew --version)

------------------------------------------------------------
Gradle 8.5 ------------------------------------------------------------ 

Build time:   2023-11-29 14:08:57 UTC
Revision:     28aca86a7180baa17117e0e5ba01d8ea9feca598 

Kotlin:       1.9.20
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          21.0.2 (Eclipse Adoptium 21.0.2+13-LTS)
OS:           Windows 11 10.0 amd64

Additional information

No response

quarkus-bot[bot] commented 9 months ago

/cc @DavideD (hibernate-reactive), @gavinking (hibernate-reactive), @geoand (kotlin)

gsmet commented 9 months ago

I had a quick look and I think there might be something wrong in how the deployment dependencies are resolved in the Gradle plugin.

Because quarkus-agroal-deployment is supposed to be excluded from quarkus-hibernate-reactive-deployment -> quarkus-hibernate-orm-deployment and it still comes. I wonder if maybe exclusions are not properly taken into account as we don't do that very often.

The problem is that you don't have the runtime classes as the runtime classpath seems to be OK.

/cc @glefloch @aloubyansky @quarkusio/devtools

gsmet commented 9 months ago

Also /cc @snazy

janek64 commented 9 months ago

Not sure if this helps, but I tried excluding the problematic dependency via the following configuration:

configurations {
    all*.exclude group: 'io.quarkus', module: 'quarkus-agroal-deployment'
}

This completely excludes quarkus-agroal-deployment as it does not appear in ./gradlew dependencies anymore. However, starting Quarkus will then produce the following error:

2024-02-06 12:14:41,679 ERROR [io.qua.run.boo.StartupActionImpl] (Quarkus Main Thread) Error running Quarkus: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:118)
        at java.base/java.lang.reflect.Method.invoke(Method.java:580)
        at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:113)
        at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ExceptionInInitializerError
        at io.quarkus.runner.ApplicationImpl.<clinit>(Unknown Source)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
        at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
        at java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103)
        at java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:200)
        at java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:549)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
        at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:70)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
        at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
        at io.quarkus.runner.GeneratedMain.main(Unknown Source)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
        ... 3 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: io.quarkus.agroal.runtime.DataSourcesJdbcBuildTimeConfig
        at io.quarkus.runtime.configuration.AbstractConfigBuilder.withMapping(AbstractConfigBuilder.java:66)
        at io.quarkus.runtime.generated.StaticInitConfigCustomizer.configBuilder(Unknown Source)
        at io.smallrye.config.SmallRyeConfigBuilder.lambda$build$0(SmallRyeConfigBuilder.java:722)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
        at java.base/java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:357)
        at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:510)
        at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
        at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
        at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
        at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
        at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:722)
        at io.quarkus.runtime.generated.Config.<clinit>(Unknown Source)
        ... 17 more
Caused by: java.lang.ClassNotFoundException: io.quarkus.agroal.runtime.DataSourcesJdbcBuildTimeConfig
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:518)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:468)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:518)
        at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:468)
        at io.quarkus.runtime.configuration.AbstractConfigBuilder.withMapping(AbstractConfigBuilder.java:64)
        ... 29 more
snazy commented 9 months ago

Could it be related to #37938? /cc @tomas1885

cleverson-menurapp commented 9 months ago

Same problem here.

gsmet commented 9 months ago

@janek64 yeah, that's probably not so simple, unfortunately.

@vemilyus could you have a look at this one? There's a good chance it's related to your changes. Thanks!

vemilyus commented 9 months ago

On it!

gsmet commented 9 months ago

@vemilyus my comment here might be useful in understanding what's going on: https://github.com/quarkusio/quarkus/issues/38533#issuecomment-1921653601

It's a wild guess though :).

vemilyus commented 9 months ago

@gsmet

quarkus-hibernate-orm pulls in quarkus-agroal which leads to quarkus-agroal-deployment being picked up by the Gradle plugin.

However, none of the reactive DB extensions specifies an exclusion for quarkus-agroal in their quarkus-extension.properties file.

As far as I can see excluded artifacts are handled in the ApplicationModelBuilder class.

So the only thing we would need to do would be to add an exclusion of quarkus-agroal to quarkus-reactive-datasource, right?

Please let me know if I'm right or completely wrong :)

Edit: I also checked quarkus-hibernate-reactive and there are exclusion for multiple javax.persistence:... artifacts, but not for quarkus-agroal.

gsmet commented 9 months ago

This extension is a bit specific (and hackyish) because we rely on parts of the Hibernate ORM extension. There's a plan to actually move the common parts to a separate extension but we never got to it.

At the moment, we rely on these (not pretty) exclusions:

https://github.com/quarkusio/quarkus/blob/main/extensions/hibernate-reactive/deployment/pom.xml#L27-L43

vemilyus commented 9 months ago

As far as I understand those are exclusions in the Maven project model, not in the Quarkus extension model. Shouldn't artifacts excluded by an extension be specified under excluded-artifacts in quarkus-extension.properties?

quarkus-agroal gets picked up by the Gradle plugin because it's an explicit extension dependency of quarkus-hibernate-orm (in quarkus-extension.yaml.

I must admit, I'm a bit confused here... How should the Gradle plugin determine based on a few excludes in a pom.xml which deployment artifacts to add to the deployment classpath? What if the pom.xml isn't part of the artifact?

snazy commented 9 months ago

Gradle itself can deal with exclusions in a pom. It's probably some code in the Quarkus Gradle plugin? Or, more likely, something that gets lost from Gradle to dev-mode.

vemilyus commented 9 months ago

The Gradle plugin doesn't know about the pom. It only reads the quarkus-extension.yaml file and looks at previously configured dependencies (e.g. from a pom) when building the deployment classpath. So the pom might exclude an artifact, but due to the extension's presence in quarkus-extension.yaml the plugin pulls it back in.

Also, doesn't an exclusion like this

    <dependencies>
        <dependency>
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-hibernate-orm-deployment</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-narayana-jta-deployment</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-narayana-jta</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-agroal</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>io.quarkus</groupId>
                    <artifactId>quarkus-agroal-deployment</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

only affect the classpath of the immediate module, and not any other modules? So someone else is perfectly able to pull in those excluded dependencies.

vemilyus commented 9 months ago

One of the main changes I made to the Gradle plugin is to recursively pull in all extensions' deployment modules to also get those where one extension or module may depend on another extension. To solve those transitive dependencies.

vemilyus commented 9 months ago

I added these exclusions to quarkus-reactive-datasource:

<excludedArtifacts>
    <excludedArtifact>io.quarkus:quarkus-agroal</excludedArtifact>
    <excludedArtifact>io.quarkus:quarkus-agroal-deployment</excludedArtifact>
    <excludedArtifact>io.quarkus:quarkus-narayana-jta</excludedArtifact>
    <excludedArtifact>io.quarkus:quarkus-narayana-jta-deployment</excludedArtifact>
    <excludedArtifact>io.smallrye:smallrye-context-propagation-jta</excludedArtifact>
</excludedArtifacts>

This made the reproducer start without issue.

However, this breaks all extensions relying on JDBC datasources (e.g. Flyway or Quartz), so that doesn't really help us either, unless we intend to break JDBC support when using reactive datasources.

Another solution would be to NOT treat being unable to find a JDBC driver when using a reactive datasource as a hard failure, just as a warning. In that case we simply wouldn't create an AgroalDataSource in AgroalProcessor. This would enable us to use a reactive driver without having to block us from using JDBC on the side. For any JDBC based extension we'd have to configure a non-reactive datasource anyway so we could use that to determine the appropriate response.

@gsmet What do you think?

aloubyansky commented 9 months ago

@vemilyus all the dependency related config, such as exclusions, is still in the POM, which Gradle knows how to handle, generally. quarkus-extension.properties only points to the corresponding deployment artifact of the extension. quarkus-extension.yaml should not be read during the build process at all.

vemilyus commented 9 months ago

@aloubyansky I wrote to you on Zulip about some topics where I need to increase my understanding, which (I think) has no place in this issue.

gsmet commented 9 months ago

I'm not exactly sure how things are resolved but basically, we need to be careful to handle the exclusions when considering the extensions. I'm not familiar enough with Gradle to help here.

vemilyus commented 9 months ago

After talking to @aloubyansky a bit I realized that's what was missing from the Gradle plugin. Will try to find out how we can best handle those exclusions.

vemilyus commented 9 months ago

@aloubyansky @gsmet @janek64 One bug fix coming up :)

The reproducer of this issue is a new integration test case for the Gradle plugin ;)

shohruh-genius commented 9 months ago

dependencies { implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")) implementation("io.quarkus:quarkus-grpc") implementation("io.quarkus:quarkus-jdbc-postgresql") implementation("io.quarkus:quarkus-reactive-pg-client") implementation("io.quarkus:quarkus-hibernate-reactive-panache-kotlin") implementation("io.quarkus:quarkus-resteasy-reactive-jackson") implementation("io.quarkus:quarkus-kotlin") implementation("io.quarkus:quarkus-smallrye-jwt") implementation("io.quarkus:quarkus-smallrye-graphql") implementation("io.quarkus:quarkus-smallrye-health") implementation("io.quarkus:quarkus-smallrye-stork") implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") implementation("io.quarkus:quarkus-resteasy-reactive") implementation("io.quarkus:quarkus-arc") implementation("io.quarkiverse.hibernatetypes:quarkus-hibernate-types:2.1.0") implementation("io.quarkiverse.config:quarkus-config-consul") implementation("io.smallrye.stork:stork-service-discovery-consul") implementation("io.smallrye.reactive:smallrye-mutiny-vertx-consul-client") testImplementation("io.quarkus:quarkus-junit5") testImplementation("io.rest-assured:rest-assured") } this implementations worked for my project with quarkus 3.7.2

vemilyus commented 9 months ago

@shohruh-genius Yes, because you are pulling in io.quarkus:quarkus-jdbc-postgresql. However, the point of this issue is that we must be able to run reactive Hibernate without having to pull in a JDBC driver.

shohruh-genius commented 9 months ago

@vemilyus the problem raises when I delete implementation("io.quarkiverse.hibernatetypes:quarkus-hibernate-types:2.1.0")

sumeetmi2 commented 9 months ago

I am facing the same issue with 'mysql'. I am using mysql-reactive in my project. Is there any workaround for the time being?

For now I have manually added quarkus-agroal dependency in my gradle.