下面是遇到的异常
org.axonframework.eventsourcing.IncompatibleAggregateException: Aggregate identifier must be non-null after applying an event. Make sure the aggregate identifier is initialized at the latest when handling the creation event.
at org.axonframework.eventsourcing.EventSourcedAggregate.publish(EventSourcedAggregate.java:160)
at org.axonframework.commandhandling.model.inspection.AnnotatedAggregate.lambda$doApply$4(AnnotatedAggregate.java:243)
at org.axonframework.commandhandling.model.inspection.AnnotatedAggregate.lambda$registerRoot$0(AnnotatedAggregate.java:135)
at org.axonframework.commandhandling.model.AggregateLifecycle.lambda$execute$2(AggregateLifecycle.java:186)
at org.axonframework.commandhandling.model.AggregateLifecycle.executeWithResult(AggregateLifecycle.java:167)
at org.axonframework.commandhandling.model.AggregateLifecycle.execute(AggregateLifecycle.java:185)
at org.axonframework.commandhandling.model.inspection.AnnotatedAggregate.registerRoot(AnnotatedAggregate.java:132)
at org.axonframework.eventsourcing.EventSourcedAggregate.initialize(EventSourcedAggregate.java:82)
at org.axonframework.eventsourcing.EventSourcingRepository.doCreateNewForLock(EventSourcingRepository.java:209)
at org.axonframework.eventsourcing.EventSourcingRepository.doCreateNewForLock(EventSourcingRepository.java:44)
at org.axonframework.commandhandling.model.LockingRepository.doCreateNew(LockingRepository.java:102)
at org.axonframework.commandhandling.model.LockingRepository.doCreateNew(LockingRepository.java:48)
at org.axonframework.commandhandling.model.AbstractRepository.newInstance(AbstractRepository.java:79)
at cn.vpclub.vpsms.customer.command.handlers.CustomerCommandHandler.handle(CustomerCommandHandler.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.axonframework.messaging.annotation.AnnotatedMessageHandlingMember.handle(AnnotatedMessageHandlingMember.java:127)
at org.axonframework.messaging.annotation.WrappedMessageHandlingMember.handle(WrappedMessageHandlingMember.java:61)
at org.axonframework.commandhandling.AnnotationCommandHandlerAdapter.handle(AnnotationCommandHandlerAdapter.java:94)
at org.axonframework.commandhandling.AnnotationCommandHandlerAdapter.handle(AnnotationCommandHandlerAdapter.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.axonframework.spring.config.AbstractAnnotationHandlerBeanPostProcessor$AdapterIntroductionInterceptor.invoke(AbstractAnnotationHandlerBeanPostProcessor.java:252)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673)
at cn.vpclub.vpsms.customer.command.handlers.CustomerCommandHandler$$EnhancerBySpringCGLIB$$25d49466.handle(<generated>)
at org.axonframework.messaging.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:57)
at org.axonframework.messaging.interceptors.CorrelationDataInterceptor.handle(CorrelationDataInterceptor.java:55)
at org.axonframework.messaging.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:55)
at org.axonframework.messaging.unitofwork.DefaultUnitOfWork.executeWithResult(DefaultUnitOfWork.java:69)
at org.axonframework.commandhandling.SimpleCommandBus.doDispatch(SimpleCommandBus.java:143)
at org.axonframework.commandhandling.SimpleCommandBus.doDispatch(SimpleCommandBus.java:116)
at org.axonframework.commandhandling.SimpleCommandBus.dispatch(SimpleCommandBus.java:86)
at org.axonframework.jgroups.commandhandling.JGroupsConnector.processDispatchMessage(JGroupsConnector.java:266)
at org.axonframework.jgroups.commandhandling.JGroupsConnector.receive(JGroupsConnector.java:237)
at org.jgroups.MessageListener.receive(MessageListener.java:32)
at org.jgroups.JChannel.up(JChannel.java:846)
at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:896)
at org.jgroups.stack.Protocol.up(Protocol.java:344)
at org.jgroups.protocols.RSVP.up(RSVP.java:233)
at org.jgroups.protocols.FRAG2.up(FRAG2.java:196)
at org.jgroups.protocols.FlowControl.up(FlowControl.java:416)
at org.jgroups.protocols.FlowControl.up(FlowControl.java:416)
at org.jgroups.stack.Protocol.up(Protocol.java:344)
at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:293)
at org.jgroups.protocols.UNICAST3.deliverBatch(UNICAST3.java:1024)
at org.jgroups.protocols.UNICAST3.removeAndDeliver(UNICAST3.java:833)
at org.jgroups.protocols.UNICAST3.handleBatchFromSelf(UNICAST3.java:520)
at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:435)
at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:697)
at org.jgroups.protocols.BARRIER.up(BARRIER.java:195)
at org.jgroups.stack.Protocol.up(Protocol.java:344)
at org.jgroups.protocols.FD_ALL.up(FD_ALL.java:212)
at org.jgroups.stack.Protocol.up(Protocol.java:344)
at org.jgroups.stack.Protocol.up(Protocol.java:344)
at org.jgroups.stack.Protocol.up(Protocol.java:344)
at org.jgroups.protocols.TP.passBatchUp(TP.java:1255)
at org.jgroups.util.MaxOneThreadPerSender$BatchHandlerLoop.passBatchUp(MaxOneThreadPerSender.java:284)
at org.jgroups.util.SubmitToThreadPool$BatchHandler.run(SubmitToThreadPool.java:136)
at org.jgroups.util.MaxOneThreadPerSender$BatchHandlerLoop.run(MaxOneThreadPerSender.java:273)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)