Config to connect Axon IQ Console

Hi , admin. I try to connect to AxonIQ console to monitor my application , but I got this errol when run application .

**************This is log *******:

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2024-07-26 10:56:28.842 ERROR [payment-service,] 33216 — [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Parameter 1 of method axoniqConsoleSpanFactoryPostProcessor in io.axoniq.console.framework.starter.AxoniqConsoleAutoConfiguration required a bean of type ‘org.axonframework.config.Configuration’ that could not be found.

Action:

Consider defining a bean of type ‘org.axonframework.config.Configuration’ in your configuration.

Process finished with exit code 0

This is file pom.xml :

<?xml version="1.0" encoding="UTF-8"?>


4.0.0

org.springframework.boot
spring-boot-starter-parent
2.6.7

<groupId>com.payment</groupId>
<artifactId>paymentservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>paymentservice</name>
<description>Demo project for Spring Boot</description>
<properties>
	<java.version>11</java.version>
	<spring-cloud.version>2021.0.2</spring-cloud.version>
</properties>
<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-actuator</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
		<version>3.0.0</version>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-starter-sleuth</artifactId>

	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-sleuth-zipkin</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-devtools</artifactId>
		<scope>runtime</scope>
		<optional>true</optional>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<scope>test</scope>
	</dependency>

	<dependency>
		<groupId>org.axonframework</groupId>
		<artifactId>axon-spring-boot-starter</artifactId>
		<version>4.6.1</version>
		<exclusions>
			<exclusion>
				<groupId>org.axonframework</groupId>
				<artifactId>spring-boot-starter-test</artifactId>
			</exclusion>
		</exclusions>
	</dependency>

	<dependency>
		<groupId>org.axonframework</groupId>
		<artifactId>axon-configuration</artifactId>
		<version>4.6.1</version>
	</dependency>

	<dependency>
		<groupId>com.h2database</groupId>
		<artifactId>h2</artifactId>
		<scope>runtime</scope>
	</dependency>
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<optional>true</optional>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-data-jpa</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-stream</artifactId>
		<version>3.2.4</version>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-stream-binder-kafka</artifactId>
		<version>3.2.4</version>
	</dependency>
	<dependency>
		<groupId>org.axonframework</groupId>
		<artifactId>axon-tracing-opentelemetry</artifactId>
		<version>4.6.1</version>
	</dependency>
	<dependency>
		<groupId>org.springframework.kafka</groupId>
		<artifactId>spring-kafka</artifactId>
		<version>2.8.6</version>
	</dependency>
	<dependency>
		<groupId>org.springframework.cloud</groupId>
		<artifactId>spring-cloud-stream</artifactId>
		<version>3.2.4</version>
		<scope>test</scope>
		<classifier>test-binder</classifier>
		<type>test-jar</type>
	</dependency>
	<dependency>
		<groupId>org.springframework.kafka</groupId>
		<artifactId>spring-kafka-test</artifactId>
		<version>2.8.6</version>
		<scope>test</scope>
	</dependency>



	<dependency>
		<groupId>io.axoniq.console</groupId>
		<artifactId>console-framework-client-spring-boot-starter</artifactId>
		<version>1.6.0</version>
	</dependency>

	<!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
	<dependency>
		<groupId>com.google.guava</groupId>
		<artifactId>guava</artifactId>
		<version>31.0.1-jre</version>
	</dependency>

</dependencies>
<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
			<version>${spring-cloud.version}</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>

<build>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
		</plugin>
	</plugins>
</build>

*****************This is file application.properties ****************************
spring.application.name=payment-service
eureka.client.service-url.defaultZone = http://localhost:8761/eureka
server.port = 9001
spring.datasource.url=jdbc:h2:mem:paymentService12345
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true
spring.jpa.hibernate.ddl-auto =update
spring.h2.console.settings.web-allow-others=true
spring.cloud.stream.bindings.output.destination=payment
spring.cloud.stream.bindings.output.content-type=application/json
logging.level.org.springframework.boot.autoconfigure.web.servlet.DispatcherServlet= DEBUG
spring.zipkin.base-url=http://localhost:9411
axoniq.console.application-name=payment-service
axoniq.console.credentials=dd3e9f41-1:86fa44c108684dd4b0c33e338707dc92
axoniq.console.dlq-mode=NONE
axon.axonserver.servers=localhost:8024
#logging.level.org.springframework=DEBUG
axon.axonserver.ssl-enabled=true
spring.zipkin.enabled=false
spring.sleuth.enabled=false
axon.axonserver.servers=localhost:8024
axoniq.console.application-name=Awesome-Microservice
axoniq.console.credentials=dd3e9f41-1:86fa44c108684dd4b0c33e338707dc92
axoniq.console.dlq-mode=NONE
************* this is file AxonConfig ******************************
package com.example.payment_service.config;

import com.thoughtworks.xstream.XStream;
import org.axonframework.config.Configurer;
import org.axonframework.config.DefaultConfigurer;
import org.axonframework.tracing.LoggingSpanFactory;
import org.axonframework.tracing.MultiSpanFactory;
import org.axonframework.tracing.SpanAttributesProvider;
import org.axonframework.tracing.SpanFactory;
import org.axonframework.tracing.opentelemetry.OpenTelemetrySpanFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

@Configuration
public class AxonConfig {

@Bean
public XStream xStream() {
    XStream xStream = new XStream();

    xStream.allowTypesByWildcard(new String[] {
            "com.example.**",
    });
    return xStream;
}

// @Bean
// public SpanFactory spanFactory() {
// // Any bean implementing the SpanFactory will be picked up automatically and override the defaults
// return new MyCustomSpanFactory();
// }

// @Bean
// public Configuration axonConfiguration(Configurer configurer) {
// return (Configuration) configurer.buildConfiguration();
// }
//
//
// @Bean
// public SpanFactory spanFactory() {
// return new MultiSpanFactory(
// Arrays.asList(
// LoggingSpanFactory.INSTANCE,
// OpenTelemetrySpanFactory
// .builder()
// .build()
// )
// );
// }

// @Bean
// public Configuration axonConfiguration() {
// return AxonConfiguration.defaultConfiguration();
// }

@Bean
public Configuration axonConfiguration() {
    return (Configuration) DefaultConfigurer.defaultConfiguration().buildConfiguration();
}

// @Bean
// public SpanAttributesProvider customSpanAttributesProvider() {
// // Auto-configuration picks beans of type SpanAttributesProvider up automatically.
// return new CustomSpanAttributesProvider();
// }
}

Please help me , fix this bug … Thanks very much .