upgrading from 2.3.2 to 2.4 NPE

Same code does not run when changing axon dependency version to 2.4
It results into:

at org.axonframework.unitofwork.DefaultUnitOfWork.publishEvents(DefaultUnitOfWork.java:270)

Is this known?

The UnitOfWork hasn’t changed in between these versions. A NPE is possible on that line when the event is published to a “null” EventBus. Are you sure the EventBus is properly configured in your repository?

Confirm the EventBus is ‘null’ if i use 2.4, but works with 2.3.2
On startup it says that eventBus bean gets instantiated:

16:13:00.121 [localhost-startStop-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Eagerly caching bean ‘eventBus’ to allow for resolving potential circular references
16:13:00.124 [localhost-startStop-1] INFO org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker - Bean ‘eventBus’ of type [class org.axonframework.eventhandling.ClusteringEventBus] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
16:13:00.124 [localhost-startStop-1] DEBUG org.springframework.beans.factory.support.DefaultListableBeanFactory - Finished creating instance of bean ‘eventBus’

Config is very simple:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

http://www.axonframework.org/schema/core http://www.axonframework.org/schema/axon-core.xsd">

<axon:annotation-config />

<axon:event-bus id=“eventBus” />

There was a change with an @Resource annotation on the repository, because it caused problems in some situations. It has been removed in 2.4.
To fix your issue, make sure you configure an Event Bus in your Repository configuration. Or use the axon namespace support in your Spring context.

Note that you don’t need to configure AnnotationEventListenerBeanProcessor if you also specify “annotation-config”.

Confirm, this was the problem. Thanks.