Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Guava Event Bus serialization

Alex Roig
6 years ago May 04, 2016 3:21pm


I started a project some time ago and now I'm refactoring it to use the Guava event bus. I adapted the code on the quicktickets demo as you were using it there.
I'ts working like a charm but I'm facing the "small" and "annoying" issue with EventBus class as it's not serializable and when saving any change the session gets expired. Developing having to login again and again is a pain. 

Someone found a solution or similar library to do the same but with serializable classes?

java.io.NotSerializableException: com.google.common.eventbus.EventBus
    at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
    at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)