When I do not use Server and use Mongo db I get this error.
rg.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘accountAggregateRepository’: Failed to instantiate [org.axonframework.modelling.command.Repository]: Factory method ‘repository’ threw exception with message: Expected single candidate for component [EventBus]. Found candidates: [eventBus, eventStore]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:659) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:647) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1332) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1162) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:560) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:941) ~[spring-context-6.0.10.jar:6.0.10]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.10.jar:6.0.10]
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:66) ~[spring-boot-3.1.1.jar:3.1.1]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-3.1.1.jar:3.1.1]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:436) ~[spring-boot-3.1.1.jar:3.1.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-3.1.1.jar:3.1.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-3.1.1.jar:3.1.1]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-3.1.1.jar:3.1.1]
at org.isc.axon.framworkcore.FramworkCoreApplication.main(FramworkCoreApplication.java:22) ~[classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.axonframework.modelling.command.Repository]: Factory method ‘repository’ threw exception with message: Expected single candidate for component [EventBus]. Found candidates: [eventBus, eventStore]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171) ~[spring-beans-6.0.10.jar:6.0.10]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655) ~[spring-beans-6.0.10.jar:6.0.10]
… 19 common frames omitted
Caused by: org.axonframework.common.AxonConfigurationException: Expected single candidate for component [EventBus]. Found candidates: [eventBus, eventStore]
at org.axonframework.spring.config.SpringConfigurer$ComponentLocator.findBean(SpringConfigurer.java:71) ~[axon-spring-4.8.1.jar:4.8.1]
at org.axonframework.spring.config.SpringConfigurer.defaultComponent(SpringConfigurer.java:50) ~[axon-spring-4.8.1.jar:4.8.1]
at org.axonframework.config.DefaultConfigurer.defaultEventBus(DefaultConfigurer.java:488) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.config.Component.get(Component.java:85) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.config.DefaultConfigurer$ConfigurationImpl.getComponent(DefaultConfigurer.java:958) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.config.Configuration.getComponent(Configuration.java:278) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.config.Configuration.eventBus(Configuration.java:70) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.config.AggregateConfigurer.lambda$new$28(AggregateConfigurer.java:221) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.config.Component.get(Component.java:85) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.config.AggregateConfigurer.repository(AggregateConfigurer.java:466) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.config.Configuration.repository(Configuration.java:255) ~[axon-configuration-4.8.1.jar:4.8.1]
at org.axonframework.spring.config.BeanHelper.repository(BeanHelper.java:40) ~[axon-spring-4.8.1.jar:4.8.1]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:139) ~[spring-beans-6.0.10.jar:6.0.10]
… 20 common frames omitted