-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RESTEasy Singleton resource with constructor injection failing with RESTEASY003190 #16475
Comments
I can confirm that the behavior varies. If there is no scope annotation present then the no-args constructor is generated automatically. However, if the CC @geoand |
In this case, the no-args constructor is generated by ArC because |
@geoand I think that we could just add the |
@mkouba yeah, that makes perfect sense! |
- resolves quarkusio#16475 (cherry picked from commit 9d4364b)
Describe the bug
When using constructor injection in a non annotated resource (reproducer link), e.g.
the program spins up successfully.
Given the default resource scope, as defined by
quarkus.resteasy.singleton-resources
isSingleton
, why do I get an error if I annotate the class with@Singleton
, as I did here?The program fails upon startup with:
It seems there's a difference with explicitly setting the scope to
Singleton
with it being set-up "automatically".If I am missing something, a pointer towards the docs would be more than welcome.
I don't know if this is related to #6722 or #7495.
Expected behavior
As in both cases the scope effectively is
Singleton
, shouldn't the behaviour be the same?Actual behavior
Annotating a RESTEasy Resource with
@Singleton
, I get the aforementioned error.To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
Or attach an archive containing the reproducer to the issue.
Steps to reproduce the behavior:
git clone [email protected]:chris-asl/quarkus-mcve.git
./mvnw quarkus:dev
Configuration
Defaults
Environment:
Output of
uname -a
orver
Linux homer 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
Quarkus version or git rev
1.13.1.Final
(also tested with1.12.2.Final
)Build tool
FYI @el10686
The text was updated successfully, but these errors were encountered: