question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error `It's not possible to automatically add a synthetic no-args constructor to an unproxyable bean class.`

See original GitHub issue

Describe the bug

Using a @RequestScoped Service fails, if it extends a abstract service and uses constructor injection to redirect a Repository Bean proxy into the super constructor.

It works, if I use attribute injection via @Inject.

Kotlin, Gradle, AllOpen-Plugin

Expected behavior

A working application.

Actual behavior

[error]: Build step io.quarkus.arc.deployment.ArcProcessor#generateResources threw an exception: javax.enterprise.inject.spi.DeploymentException: It's not possible to automatically add a synthetic no-args constructor to an unproxyable bean class. You need to manually add a non-private no-args constructor to org.quarkus.error.reproducer.service.FruitAService in order to fulfill the requirements for normal scoped/intercepted/decorated beans.

How to Reproduce?

quarkus-error-reproducer.zip

./gradlew quarkusDev

Output of uname -a or ver

5.15.12-zen1-1-zen

Output of java -version

openjdk version “17.0.1” 2021-10-19 OpenJDK Runtime Environment (build 17.0.1+12) OpenJDK 64-Bit Server VM (build 17.0.1+12, mixed mode)

GraalVM version (if different from Java)

N/A

Quarkus version or git rev

2.6.1

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

Gradle 7.3.3

Additional information

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
manovotncommented, Jan 5, 2022

a synthetic no-args constructor

The automagical creation of a no-arg constructor is only single-level meaning is there is an [abstract] super class that doesn’t have no-args constructor, it will fail.

0reactions
MartinX3commented, Jan 6, 2022

Good hint. I think this bug ticket should be closed. But maybe the kotlin guides should hint for the kotlin plugins, if someone uses generics and abstract classes.

Here is the new issue ticket: https://github.com/quarkusio/quarkus/issues/22689

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why do I need a no-args constructor to use ApplicationScoped ...
Invoking a parameterized constructor to create a proxy is not really an option because you have no context as to what the parameters...
Read more >
Contexts and Dependency Injection - Quarkus
We don't generate a no-args constructor automatically if a bean class extends a class that does not declare a no-args constructor. 5.5. Removing...
Read more >
Unproxyable class: superclasses also need no-arg constructor?
I'm getting this exception, slightly anonymized: org.jboss.weld.exceptions.UnproxyableResolutionException: WELD-001435 Normal scoped bean ...
Read more >
Why Default or No Argument Constructor is Important in Java ...
Almost all Java developers know that compiler adds a default constructor or better known as a no-argument constructor in every Java class, but...
Read more >
No-arg compiler plugin - Kotlin
The generated constructor is synthetic so it can't be directly called ... This allows the Java Persistence API (JPA) to instantiate a class...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found