0

I have configured polling into my spring boot application but, i am getting below error.

java.lang.IllegalAccessError: tried to access method org.springframework.integration.context.IntegrationProperties.()V from class org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration at org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration.integrationGlobalProperties(IntegrationAutoConfiguration.java:88)

I have added below 2 dependencies.

<dependency>
      <groupId>org.springframework.integration</groupId>
      <artifactId>spring-integration-http</artifactId>
</dependency>

<dependency>
      <groupId>org.springframework.integration</groupId>
      <artifactId>spring-integration-core</artifactId>
</dependency>

My code is below :

@InboundChannelAdapter(channel = "channel",
            poller = @Poller(fixedDelay = "5000"))
    public String foo() {
        System.out.println("test1");
        return "foo";
    }
    
    @ServiceActivator(inputChannel = "channel")
    public void handle(String in) {
        System.out.println("test");
    }
  • 1
    Include `spring-boot-starter-integration` instead of `spring-integration-core`. – M. Deinum May 15 '23 at 10:11
  • M.Deinum I already added but getting java.lang.ClassNotFoundException: org.springframework.integration.config.IntegrationManagementConfigurer error when i run my application. it is getting stop after some time – Dharmin Patel May 15 '23 at 12:52

1 Answers1

0

Looks like you have some mess with classpath. You probably use some old Spring Integration version which is not compatible with your Spring Boot version.

Consider to remove the spring-integration.version property and fully rely on dependency management from Spring Boot.

To be more precise that org.springframework.integration.context.IntegrationProperties got public constructor in version 5.5 and respective change in the IntegrationAutoConfiguration was introduced since Spring Boot 2.5: https://github.com/spring-projects/spring-boot/pull/25377.

Both of those versions are EoL already. So, consider to upgrade your project to the latest Spring Boot version and try to rely on its dependency management: https://spring.io/projects/spring-boot#learn

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118