-
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
Quarkus @ApplicationScoped working in dev run, but not in prod #23282
Comments
/cc @evanchooly |
@mkouba Could this be because of the additional interceptors that are applied in dev mode? |
I don't think so.
So from CDI POV a normal scoped bean may not declare @stuartwdouglas Could it be that quarkus transformations are not taken into account when used together with kotlin? |
Does the application work if |
It doesn't. (neither in dev nor prod modes) |
Do you have a reproducer that does not require a discord account? |
Just created one here. |
Fixes quarkusio#23282 (cherry picked from commit 52f73dd)
Describe the bug
I have an abstract class, which has an implementation with @ApplicationScoped.
This works without an issue in
quarkusDev
, but when running the built app, it complains of a function that I have implemented in the abstract class.java.lang.VerifyError: class me.l3n.[...].GoodReadsCrawlerService_ClientProxy overrides final method me.l3n.bot.[...].CrawlerService .parseHtml(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Note that I'm not even overriding that
parseHtml()
function.But if I change the GoodReadsCrawlerService to Singleton(), OR add the open keyword to
parseHtml()
, it works just fine in any case.I'd assume the
ClientProxy
is treating the abstract class as an interface, so implements all functions for proxying, assuming they're all abstract.But I believe this could be an issue with the prod proxy.
Expected behavior
The proxy should have the same behavior in dev and prod environments when dealing with an abstract class implementing a method.
Actual behavior
java.lang.VerifyError: class me.l3n.[...].GoodReadsCrawlerService_ClientProxy overrides final method me.l3n.bot.[...].CrawlerService .parseHtml(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Unless that method has the
open
keyword or the scope is changed toSingleton
.How to Reproduce?
In Kotlin, create an abstract class with a method implementation, then extend it from another class, with the
@ApplicationScoped
annotation.Test in
quarkusDev
, then running the app produced inquarkusBuild
.An example can be found in my repo.
Output of
uname -a
orver
Windows 10
Output of
java -version
java version "11.0.12" 2021-07-20 LTS
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.6.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.2
Additional information
No response
The text was updated successfully, but these errors were encountered: