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.

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

See original GitHub issue

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: https://github.com/quarkusio/quarkus/discussions/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

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
benjaminraucommented, Nov 24, 2022

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

1reaction
Ladicekcommented, 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().

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compilation failure after adding Lombok NonNull annotation ...
Issue seems to be related to https://github.com/datanucleus/datanucleus-jdo-query/issues/18 and is solved with specifying
Read more >
@NonNull - Project Lombok
You can use @NonNull on a record component, or a parameter of a method or constructor. This will cause to lombok generate a...
Read more >
Lombok @NonNull - Java By Examples
When we use the @NonNull annotation on a method, Lombok adds a null check to the beginning of the method. For constructors, the...
Read more >
What is the @NonNull annotation in Lombok? - Educative.io
The @NonNull annotation generates a null check for fields and arguments annotated with this annotation. This annotation can be used on fields, constructor ......
Read more >
chore(deps): update dependency io.quarkus:quarkus ... - GitLab
An error occurred while retrieving approval data for this merge request. chore(deps): update dependency io.quarkus:quarkus ...
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