【发布时间】:2021-11-09 07:01:57
【问题描述】:
我想使用 Axon Framework 和 Axon Server 作为我的事件存储和事件总线以及包含 spring data jpa 的 spring boot 项目。
我有一个 docker-compose 启动 2 个容器 - postgres db 和 Axon Server。
我不希望 axon 使用 postgres 作为它的事件存储,我希望它使用 Axon Server 作为事件存储。
因此,我将 @EntityScan 添加到主类以指向我自己的 JPA 实体,当我启动我的 Spring Boot 应用程序时,出现以下异常:
Caused by: java.util.concurrent.ExecutionException: org.axonframework.lifecycle.LifecycleHandlerInvocationException: Failed during invocation of lifecycle handler [public void org.axonframework.axonserver.connector.processor.EventProcessorControlService.start()] on component [org.axonframework.axonserver.connector.processor.EventProcessorControlService@32f2de5c]
Caused by: org.axonframework.lifecycle.LifecycleHandlerInvocationException: Failed during invocation of lifecycle handler [public void org.axonframework.axonserver.connector.processor.EventProcessorControlService.start()] on component [org.axonframework.axonserver.connector.processor.EventProcessorControlService@32f2de5c]
Caused by: java.lang.reflect.InvocationTargetException: null
Caused by: org.axonframework.eventhandling.tokenstore.UnableToRetrieveIdentifierException: Exception occurred while trying to establish storage identifier
Caused by: java.lang.IllegalArgumentException: Unable to locate persister: org.axonframework.eventhandling.tokenstore.jpa.TokenEntry
Caused by: org.hibernate.UnknownEntityTypeException: Unable to locate persister: org.axonframework.eventhandling.tokenstore.jpa.TokenEntry
在我添加所有 JPA 依赖项之前它工作正常,但在我为 jpa 添加 spring-boot-starter 之后
我得到了上述异常
我该如何解决?
【问题讨论】:
标签: spring-boot axon