Classes with @Funq methods fail in constructor injection for normal scoped bean #27671
Labels
area/arc
Issue related to ARC (dependency injection)
area/funqy
area/kubernetes
kind/bug
Something isn't working
Milestone
Describe the bug
When class that is normal scoped bean has method annotated with
@Funq
and uses constructor injection, an exception is thrown. I looked into this and the reason is that when (and only when!) class does extend SomeClass and there is no default constructor without args, Funqy generates it for us herequarkus/extensions/funqy/funqy-server-common/deployment/src/main/java/io/quarkus/funqy/deployment/FunctionScannerBuildStep.java
Line 176 in b9d7536
but Quarkus Arc does too for normal scoped beans unless a bean class extends a class that does not declare a no-args constructor.
Expected behavior
Constructor injection for normal scoped beans works just fine.
Actual behavior
An exception is thrown:
Exception in thread "main" java.lang.reflect.InvocationTargetException
Caused by: java.lang.ClassFormatError: Duplicate method name "<init>" with signature "()V" in class file io/quarkus/funqy/deployment/DependencyInjectionTest$HiFunction
How to Reproduce?
git clone https://github.com/michalvavrik/funqy-knative-events-constructor-injection-reproducer.git
mvn clean verify
Output of
uname -a
orver
Linux fedora 5.19.4-200.fc36.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 25 17:42:04 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "17.0.3" 2022-04-19
GraalVM version (if different from Java)
GraalVM CE 22.1.0
Quarkus version or git rev
999-SNAPSHOT
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.6
Additional information
No response
The text was updated successfully, but these errors were encountered: