I just try to use Axon 4.2, and feel very confused about some place.
1.first problem, when I start my application, it logs like this:
`
[user-center:172.28.1.97:10040] 2019-08-22 22:30:14.868 WARN 24132 [EventProcessor[queryModel]-0] org.axonframework.eventhandling.TrackingEventProcessor Fetch Segments for Processor ‘queryModel’ failed: Could not load segments for processor [queryModel]. Preparing for retry in 4s
[user-center:172.28.1.97:10040] 2019-08-22 22:30:21.988 WARN 24132 [EventProcessor[queryModel]-0] org.axonframework.eventhandling.TrackingEventProcessor Fetch Segments for Processor ‘queryModel’ failed: Could not load segments for processor [queryModel]. Preparing for retry in 8s
`
to solve this problem, I tries 2 ways:
one is switch to jpa, but another error happens:
`
Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: SagaEntry is not mapped [SELECT new org.axonframework.modelling.saga.repository.jpa.SerializedSaga(se.serializedSaga, se.sagaType, se.revision) FROM SagaEntry se WHERE se.sagaId = :sagaId]
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:133)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:157)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:164)
at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:670)
at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:23)
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.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:350)
at com.sun.proxy.$Proxy231.createQuery(Unknown Source)
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.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:305)
at com.sun.proxy.$Proxy231.createQuery(Unknown Source)
`
don’t know how to solve this, so I tried the second way, add this:
@ComponentScan(basePackages = {"org.axonframework"})
then my application start success.
but another thing happens , witch really confused me.
after creating some events, every time I start my application, my @EventHandler method runs,
`
@AllowReplay(false)
@EventHandler
public void on(SysUserModifyBaseInfoEvent event, ReplayStatus replayStatus) {
SysUser sysUser = defaultMappper.map(event.getSysUserAO(), SysUser.class);
userService.updateById(sysUser);
}
`
I thought it was a event replay, so I add @AllowReplay(false), but it wasn’t…
can you tell my the reason? and how to solve this problems? thank you very much~~