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.

io.vertx.core.eventbus.EventBus cannot decode List<Long> payload (???)

See original GitHub issue

Describe the bug

I do something like

eventBus.send("myBusAddress", List.of(1L,2L));

and having a consumer method like

@ConsumeEvent(BUS_ADDRESS_RETRY)
    public void doAsync(List<Long> longList) {
    ...
    }

Expected behavior

Was hoping this would just work, meaning that in doAsync the longList = [1L,2L]

Actual behavior

Instead I get

2022-11-23 10:00:25,967 ERROR job=[] traceId=[] spanId=[] [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile local): java.lang.ClassNotFoundException: java.util.List<java.lang.Long>
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:459)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:450)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:459)
	at io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:450)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at io.quarkus.deployment.steps.VertxProcessor$build609260703.deploy_0(Unknown Source)
	at io.quarkus.deployment.steps.VertxProcessor$build609260703.deploy(Unknown Source)
	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
	at io.quarkus.runtime.Application.start(Application.java:101)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:110)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:69)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:42)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:122)
	at io.quarkus.runner.GeneratedMain.main(Unknown Source)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:103)
	at java.base/java.lang.Thread.run(Thread.java:833)

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.13.3.Final

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

No response

Additional information

When trying to use latest quarkus version 2.14.1.Final breaks my project build with

cannot find symbol symbol: class OkHttpClient package okhttp3 does not exist

Think that’s another issue I have to create when I dont get this fixed on my own-

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:14 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
syrcommented, Nov 26, 2022

I believe that this problem is fixed with #29446. And I wasn’t able to reproduce the issue in the main branch.

The fix targets 2.14.2.Final and should be backported in 2.13 as well.

Unfortunately, I’m not aware of any workaround; maybe just try use a raw type instead of List<Integer> in the consuming method?

Can confirm that the issue is fixed with 2.14.2.Final. 😃

1reaction
Ladicekcommented, Nov 25, 2022

I believe that this problem is fixed with #29446.

Agree, given the error message says java.lang.ClassNotFoundException: java.util.List<java.lang.Long>, which just points to Type.toString() again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vert.x Core Manual
The Event bus. Shared data - local maps and clustered distributed maps. Periodic and delayed actions. Deploying and undeploying Verticles. Datagram ...
Read more >
Java Examples for io.vertx.core.eventbus.Message - Javatips.net
This java examples will help you to understand the usage of io.vertx.core.eventbus.Message. These source code samples are taken from different open source ...
Read more >
Vertx event bus and encoding issues when ... - Stack Overflow
What am i missing when encoding/decoding objects. I'm not entirely sure how a string relates to a ByteArray but I need to pass...
Read more >
Uses of Interface io.vertx.core.eventbus.EventBus
Methods in io.vertx.core.eventbus.impl that return EventBus. Modifier and Type, Method and Description. <T> EventBus, EventBusImpl.
Read more >
EventBus Messages Getting Lost on AWS Cluster
vertx.eventBus().send(eventBusSubject, payload, deliveryOptions, (res) -> { ... /main/java/io/vertx/core/eventbus/impl/clustered/ConnectionHolder.java#L93.
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