Axon 3: ConstraintViolationException when scheduled event fired with JpaEventStorageEngine + QuartzEventScheduler


When quartz is firing a scheduled event to a JpaEventStorageEngine backed event bus there is a org.hibernate.exception.ConstraintViolationException because “Column ‘type’ cannot be null”.

The storage engine seems to expect a domain event associated with an aggregate, but this is more of an application event used within the saga.

A bug or did I miss something here?

Relevant log messages when the scheduled event fires:

2017-02-23 12:48:28.080 WARN 23407 --- [ryBean_Worker-1] o.h.e.j.s.SqlExceptionHelper : SQL Error: 1048, SQLState: 23000
2017-02-23 12:48:28.080 ERROR 23407 --- [ryBean_Worker-1] o.h.e.j.s.SqlExceptionHelper : Column 'type' cannot be null
2017-02-23 12:48:28.085 WARN 23407 --- [ryBean_Worker-1] o.a.e.s.q.FireEventJob : Exception occurred while publishing scheduled event [com.casumo.trackingpixel.TrackedUserExpiredEvent]


Also, relevant configuration

Hi Ted,

this has to so with an issue in earlier releases of 3.0. Would have to look up which version exactly, if necessary. The type field was marked as mandatory, while in fact, it isn’t.
The solution is to alter the table and make the field nullable/optional.



Right, I was using an old schema. Updated the schema and everything works as expected!