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

Application startup fails using Lombok's @NonNull on a method annotated with @ConsumeEvent #29434

Closed
benjaminrau opened this issue Nov 23, 2022 · 5 comments · Fixed by #29446
Closed
Assignees
Labels
area/vertx kind/bug Something isn't working
Milestone

Comments

@benjaminrau
Copy link

benjaminrau commented Nov 23, 2022

Describe the bug

When annotating a method parameter with @nonnull for a Vertx Consumer Method (means its annotated with @ConsumeEvent) then the application startup fails, throwing an exception.

Mentioned on: #29322

Expected behavior

No exception is thrown when using @nonnull.

Actual behavior

Exception is thrown when using @nonnull, application can not be started.

How to Reproduce?

  1. Clone the repo: https://github.com/benjaminrau/quarkus-nonnull-reproducer
  2. Start the application

Output of uname -a or ver

Linux br-builders-nb 5.14.0-1052-oem #59-Ubuntu SMP Fri Sep 9 09:37:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "17" 2021-09-14 OpenJDK Runtime Environment (build 17+35-2724) OpenJDK 64-Bit Server VM (build 17+35-2724, mixed mode, sharing)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

= 2.14.0.Final

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

Apache Maven 3.6.3

Additional information

Noticable is that @nonnull is included in the ClassName for EventBusCodec registration too:
2022-11-23 10:29:52,634 INFO [io.qua.ver.dep.EventBusCodecProcessor] (build-5) Local Message Codec registered for type org.acme.@NonNull HelloEvent

@benjaminrau benjaminrau added the kind/bug Something isn't working label Nov 23, 2022
@famod
Copy link
Member

famod commented Nov 23, 2022

I'm under the impression that this has the same root cause as #29425. /cc @Ladicek

@Ladicek
Copy link
Contributor

Ladicek commented Nov 23, 2022

Yeah, that looks very much like the same issue.

@Ladicek
Copy link
Contributor

Ladicek commented Nov 23, 2022

Okay, it is not the same issue. Looks like someone uses Type.toString() to generate a class name, which is wrong. Let me check.

@Ladicek
Copy link
Contributor

Ladicek commented Nov 23, 2022

Found it: https://github.com/quarkusio/quarkus/blob/2.14.1.Final/extensions/vertx/deployment/src/main/java/io/quarkus/vertx/deployment/EventBusCodecProcessor.java#L91

Here, entry.getKey() is a Jandex Type, so entry.getKey().toString() may include type annotations. Fix is simple: entry.getKey().name().toString().

@benjaminrau
Copy link
Author

Thanks a lot for your efforts! Quarkus is really awesome!

@gsmet gsmet modified the milestones: 2.15 - main, 2.14.2.Final Nov 24, 2022
@gsmet gsmet modified the milestones: 2.14.2.Final, 2.13.6.Final Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/vertx kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants