spring-projects / spring-projects/spring-modulith

`DayHasPassed` not JSON-serializable

Open
#1,480 3 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Nov 25, 2025.

in: event publication registry in: moments resolution: duplicate
Dominant language
Java
Stars
1.2k
Forks
222
PR merge metrics
No merged PRs in 30d

Description

In Spring Modulith 1 I was doing:

@ApplicationModuleListener
public void on(DayHasPassed dayHasPassed) {

After migrating to Modulith 2 I get:

tools.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of org.springframework.modulith.moments.DayHasPassed (no Creators, like default constructor, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

Is there any recommended way of getting Moments events serialized or is this something discouraged and I should use the in-memory EventListener mechanism?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.