Axon 2.4.5 AbstractMessageHandler#matches(Message) causing AggregateIdentifierNotInitializedException

Hi All,

I am trying to load a an AggregateRoot using the respository (I am using a MongoEventStore) but I get AggregateIdentifierNotInitializedException thrown: the problem occurs when the AbstractMessageHandler#matches(Message) is called more exactly in line 2 :

1.Assert.notNull(message, "Event may not be null");
2.if (payloadType != null && !payloadType.isAssignableFrom(message.getPayloadType())) {
3.    return false;
5. for (ParameterResolver parameterResolver : parameterValueResolvers) {
6.    if (!parameterResolver.matches(message)) {
7.        return false;
8.    }
10.return true;

What kind of environment do you run in? If the same class is loaded by two different classloaders, they are different form the jvm. So one instance from the classloader A is not assignable to the type loaded by classloader B.




had the same situation.
In my cas it was the Rleoad classloader from spring-boot devtools.
May caused by: