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");
}
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.versionproperty and fully rely on dependency management from Spring Boot.To be more precise that
org.springframework.integration.context.IntegrationPropertiesgotpublicconstructor in version5.5and respective change in theIntegrationAutoConfigurationwas introduced since Spring Boot2.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