Hello everyone,
I’m configuring Axon Server to connect it with my Spring Boot microservice. When I run java -jar axonserver.jar
, I see that Axon Server is running properly with no problems and on the port that I’ve specified. However, when I run my application, I encounter this error. Could you help me resolve this issue?
the error :
io.grpc.StatusRuntimeException: UNAVAILABLE
at io.grpc.Status.asRuntimeException(Status.java:539) ~[grpc-api-1.50.2.jar:1.50.2]
at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onClose(ClientCalls.java:487) ~[grpc-stub-1.50.2.jar:1.50.2]
at io.axoniq.axonserver.connector.impl.AxonServerManagedChannel$FailingCall.start(AxonServerManagedChannel.java:413) ~[axonserver-connector-java-4.6.3.jar:4.6.3]
at io.grpc.stub.ClientCalls.startCall(ClientCalls.java:341) ~[grpc-stub-1.50.2.jar:1.50.2]
at io.grpc.stub.ClientCalls.asyncStreamingRequestCall(ClientCalls.java:332) ~[grpc-stub-1.50.2.jar:1.50.2]
at io.grpc.stub.ClientCalls.asyncBidiStreamingCall(ClientCalls.java:119) ~[grpc-stub-1.50.2.jar:1.50.2]
at io.axoniq.axonserver.grpc.query.QueryServiceGrpc$QueryServiceStub.openStream(QueryServiceGrpc.java:244) ~[axonserver-connector-java-4.6.3.jar:4.6.3]
at io.axoniq.axonserver.connector.query.impl.QueryChannelImpl.doConnectQueryStream(QueryChannelImpl.java:247) ~[axonserver-connector-java-4.6.3.jar:4.6.3]
at io.axoniq.axonserver.connector.query.impl.QueryChannelImpl.registerQueryHandler(QueryChannelImpl.java:306) ~[axonserver-connector-java-4.6.3.jar:4.6.3]
at org.axonframework.axonserver.connector.query.AxonServerQueryBus.subscribe(AxonServerQueryBus.java:244) ~[axon-server-connector-4.7.0.jar:4.7.0]
at org.axonframework.queryhandling.annotation.AnnotationQueryHandlerAdapter.lambda$subscribe$1(AnnotationQueryHandlerAdapter.java:96) ~[axon-messaging-4.7.0.jar:4.7.0]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[na:na]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.TreeMap$KeySpliterator.forEachRemaining(TreeMap.java:3099) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:682) ~[na:na]
at org.axonframework.queryhandling.annotation.AnnotationQueryHandlerAdapter.subscribe(AnnotationQueryHandlerAdapter.java:101) ~[axon-messaging-4.7.0.jar:4.7.0]
at org.axonframework.config.DefaultConfigurer.lambda$null$36(DefaultConfigurer.java:693) ~[axon-configuration-4.7.0.jar:4.7.0]
at org.axonframework.config.MessageHandlerRegistrar.start(MessageHandlerRegistrar.java:90) ~[axon-configuration-4.7.0.jar:4.7.0]
at org.axonframework.lifecycle.Lifecycle$LifecycleRegistry.lambda$onStart$0(Lifecycle.java:68) ~[axon-messaging-4.7.0.jar:4.7.0]
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[na:na]
at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:1024) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[na:na]
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:921) ~[na:na]
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[na:na]
at java.base/java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:662) ~[na:na]
at org.axonframework.config.DefaultConfigurer.invokeLifecycleHandlers(DefaultConfigurer.java:883) ~[axon-configuration-4.7.0.jar:4.7.0]
at org.axonframework.config.DefaultConfigurer.invokeStartHandlers(DefaultConfigurer.java:829) ~[axon-configuration-4.7.0.jar:4.7.0]
at org.axonframework.config.DefaultConfigurer$ConfigurationImpl.start(DefaultConfigurer.java:980) ~[axon-configuration-4.7.0.jar:4.7.0]
at org.axonframework.spring.config.SpringAxonConfiguration.start(SpringAxonConfiguration.java:76) ~[axon-spring-4.7.0.jar:4.7.0]
at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:288) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:471) ~[spring-context-6.1.6.jar:6.1.6]
at java.base/java.lang.Iterable.forEach(Iterable.java:75) ~[na:na]
at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:260) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:205) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:981) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:627) ~[spring-context-6.1.6.jar:6.1.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) ~[spring-boot-3.2.5.jar:3.2.5]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-3.2.5.jar:3.2.5]
at com.esoft.productsservice.ProductsServiceApplication.main(ProductsServiceApplication.java:15) ~[classes/:na]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:580) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) ~[spring-boot-devtools-3.2.5.jar:3.2.5]
this my application.properties
server.port=0
spring.application.name=products-service
eureka.client.service-url.defaultZone = http://localhost:8761/eureka
eureka.instance.instance-id=${spring.application.name}:${instanceId:${random.value}}
spring.datasource.url=jdbc:h2:mem:products
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.h2.console.enabled=true
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.jpa.hibernate.ddl-auto=update
axon.axonserver.servers=localhost:9090
finally this is my axonserver.properties
axoniq.axonserver.event.storage=./data
axoniq.axonserver.snapshot.storage=./data
axoniq.axonserver.controldb-path=./data
server.port=9090
axoniq.axonserver.name = My axon Server
axoniq.axonserver.hostname=true
axoniq.axonserver.devmode.enabled=true
axoniq.axonserver.standalone=true
#gRPC port for axonserver platform
axoniq.axonserver.port=8124
Ps : I’m using maven-shade-plugin