quarkiverse / quarkus-amazon-services

Quarkus Amazon Services extensions
Apache License 2.0
41 stars 48 forks source link

quarkiverse's LambdaBuildTimeConfig interface conflicts with io.quarkus's LambdaBuildTimeConfig class #1209

Open emakunin opened 5 months ago

emakunin commented 5 months ago

Hello,

I'm trying to use quarkus-amazon-lambda from io.quarkiverse .amazonservices to inject AWS lambda client in a service that uses

       <dependency>
            <!-- AWS Lambda Client injection -->
            <groupId>io.quarkiverse.amazonservices</groupId>
            <artifactId>quarkus-amazon-lambda</artifactId>
        </dependency>

        <dependency>
             <!-- My service or some async job lambda -->
            <groupId>io.quarkus</groupId>
            <artifactId>quarkus-amazon-lambda-rest</artifactId> <!-- or just quarkus-lambda -->
       <dependency>

I tried all available versions of quarkus and quarkiverse and theirs combinations. However it doesn't work. You can try with the version combinations mentioned in https://github.com/quarkiverse/quarkus-amazon-services.

As a result my build fails with

[ERROR] Failed to execute goal io.quarkus.platform:quarkus-maven-plugin:3.8.1:build (default) on project inventory-management-rest: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors [ERROR] [error]: Build step io.quarkus.amazon.lambda.deployment.LambdaProcessor#setupClient threw an exception: java.lang.IncompatibleClassChangeError: Found class io.quarkus.amazon.lambda.runtime.LambdaBuildTimeConfig, but interface was expected [ERROR] at io.quarkus.amazon.lambda.deployment.LambdaProcessor.setupClient(LambdaProcessor.java:104) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERROR] at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) [ERROR] at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [ERROR] at java.base/java.lang.reflect.Method.invoke(Method.java:568) [ERROR] at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:849) [ERROR] at io.quarkus.builder.BuildContext.run(BuildContext.java:256) [ERROR] at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18) [ERROR] at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) [ERROR] at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) [ERROR] at java.base/java.lang.Thread.run(Thread.java:840) [ERROR] at org.jboss.threads.JBossThread.run(JBossThread.java:501) [ERROR] -> [Help 1]

In this commit you added LambdaBuildTimeConfig interface that conflicts with the LambdaBuildTimeConfig class used by io.quarkus. See io quarkus class LambdaBuildTimeConfig

I guess the config interface package or the interface name need to be modified. So far a workaround is to not use quarkiverse and inject clients manually.

scrocquesel commented 5 months ago

@radcortez Is is expected that we cannot share the root prefix in two different packages ? Is it because in we use interface mapping in the extension while quarkus is using class mapping.

radcortez commented 5 months ago

You can share them, but I think the issue is something else. Both classes have the same FQN io.quarkus.amazon.lambda.runtime.LambdaBuildTimeConfig:

https://github.com/quarkusio/quarkus/blob/86ba00e29a9a326afa02a74dd81a8228a5d04c02/extensions/amazon-lambda/runtime/src/main/java/io/quarkus/amazon/lambda/runtime/LambdaBuildTimeConfig.java https://github.com/quarkiverse/quarkus-amazon-services/blob/9377e50a406db11355bf12b32e2bb09aee50f7c8/lambda/runtime/src/main/java/io/quarkus/amazon/lambda/runtime/LambdaBuildTimeConfig.java

scrocquesel commented 5 months ago

It seems there are limited solutions available:

I would vote for option 2.

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

GheorgheGanea commented 3 months ago

any news?

emakunin commented 2 months ago

Hi folks,

Thank you for taking a look at the problem. I apologise for the radio silence.

I've tested the proposed fix, but it seems that there's another issue (unless I do smth. wrong) https://github.com/quarkiverse/quarkus-amazon-services/pull/1267#issuecomment-2231490200

scrocquesel commented 2 months ago

I'm a bit busy atm

@emakunin would you mind provide a repro plz

github-actions[bot] commented 1 week ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

scrocquesel commented 4 days ago

@emakunin @GheorgheGanea Version 3.0.0.alpha1 is out. Could you have a look at it.