Skip to content
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

CDI issue with avro after migration to Quarkus 2.7 #24452

Closed
jumolinaro opened this issue Mar 21, 2022 · 8 comments · Fixed by #24628
Closed

CDI issue with avro after migration to Quarkus 2.7 #24452

jumolinaro opened this issue Mar 21, 2022 · 8 comments · Fixed by #24628
Labels
area/gradle Gradle area/kotlin kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.
Milestone

Comments

@jumolinaro
Copy link

Describe the bug

We have a Quarkus application with Java and Kotlin sources.
This component contains an avro file used to produce messages for Kafka

Gradle build of this application works perfectly with Quarkus 2.6 (2.6.3.Final)
But after migration to Quarkus 2.7 (2.7.5.Final), gradle build fails with some dependencies injection issues (see below)

It seems that some classes generated from Kotlin sources are not found by @Inject annotation used in classes generated from Java sources.

If we remove avro generation from this component, gradle build works fine.

Expected behavior

Task :quarkusBuild
Caching disabled for task ':quarkusBuild' because:
Build cache is disabled
Task ':quarkusBuild' is not up-to-date because:
Task has failed previously.
building quarkus jar

Task :quarkusBuild
Quarkus augmentation completed in 6991ms
:quarkusBuild (Thread[Execution worker for ':',5,main]) completed. Took 8.685 secs.
:assemble (Thread[Execution worker for ':',5,main]) started.

Task :assemble
Skipping task ':assemble' as it has no actions.
:assemble (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:check (Thread[Execution worker for ':',5,main]) started.

Task :check
Skipping task ':check' as it has no actions.
:check (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.
:build (Thread[Execution worker for ':',5,main]) started.

Task :build
Skipping task ':build' as it has no actions.
:build (Thread[Execution worker for ':',5,main]) completed. Took 0.0 secs.

BUILD SUCCESSFUL

Actual behavior

Task :quarkusBuild FAILED
:quarkusBuild (Thread[Execution worker for ':',5,main]) completed. Took 10.161 secs.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':quarkusBuild'.

io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 8 deployment problems:
Unsatisfied dependency for type xxx.xxx.MonitoringEventService and qualifiers [@default]
- java member: xxx.xxx.XxxxService#monitoringEventService
- declared on CLASS bean [types=[xxx.xxx.XxxxService, java.lang.Object], qualifiers=[@default, @Any], target=xxx.xxx.XxxxService]

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

11.0.10

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.7.5.Final

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

No response

Additional information

No response

@jumolinaro jumolinaro added the kind/bug Something isn't working label Mar 21, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 21, 2022

/cc @evanchooly, @manovotn, @mkouba

@quarkus-bot quarkus-bot bot added area/arc Issue related to ARC (dependency injection) area/kotlin labels Mar 21, 2022
@jumolinaro jumolinaro changed the title CDI Issue with avro after migration to Quarkus 2.7 CDI issue with avro after migration to Quarkus 2.7 Mar 21, 2022
@gsmet
Copy link
Member

gsmet commented Mar 21, 2022

I think we will need a small reproducer for that one.

@gsmet gsmet added the triage/needs-reproducer We are waiting for a reproducer. label Mar 21, 2022
@jumolinaro
Copy link
Author

Hi @gsmet,
I totally agree with you.

So here is a small reproducer with 3 files (1 avro, 1 java & 1 kotlin)
https://github.com/jumolinaro/quarkus-issue-24452

In this reproducer, usage of Avro is not useful (no messages sent to Kafka) but it reproduces the current issue.

@mkouba
Copy link
Contributor

mkouba commented Mar 28, 2022

So here is a small reproducer with 3 files (1 avro, 1 java & 1 kotlin)

I can take a look...

@mkouba mkouba added the area/gradle Gradle label Mar 28, 2022
@aloubyansky
Copy link
Member

@glefloch will you have time to look into what happens there on the plugin level?

@glefloch
Copy link
Member

yes sure.

@glefloch
Copy link
Member

glefloch commented Mar 28, 2022

The devmode is working, I think the problem comes from a missing source path in the model. I will push a fix.

@mkouba
Copy link
Contributor

mkouba commented Mar 28, 2022

The devmode is working, I think the problem comes from a missing source path in the model. I will push a fix.

Hm, that's interesting... it's usually the other way around - a problem in dev mode but not in prod mode ;-).

@quarkus-bot quarkus-bot bot added this to the 2.9 - main milestone Mar 30, 2022
@mkouba mkouba removed the area/arc Issue related to ARC (dependency injection) label Mar 30, 2022
@gsmet gsmet modified the milestones: 2.9 - main, 2.8.1.Final Apr 11, 2022
@gsmet gsmet modified the milestones: 2.8.1.Final, 2.7.6.Final May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gradle Gradle area/kotlin kind/bug Something isn't working triage/needs-reproducer We are waiting for a reproducer.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants