Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

130
Visualizações
Spring Boot 2.6 + Integration - internalPublisherAnnotationBeanPostProcessor circular dependency

We have upgraded to 2.6 Spring boot version. We are also using Spring's Integration (org.springframework.boot:spring-boot-starter-integration).

When we try to start up the application we get:

***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

┌──->──┐
|  org.springframework.integration.internalPublisherAnnotationBeanPostProcessor
└──<-──┘

We were able to repro the issue with a clean Spring boot application:

DemoApplication.java

package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.integration.config.EnableIntegration;
import org.springframework.integration.config.EnablePublisher;

@EnableIntegration
@EnablePublisher
@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

}

build.gradle

plugins {
    id 'org.springframework.boot' version '2.6.1'
    id 'io.spring.dependency-management' version '1.0.11.RELEASE'
    id 'java'
}

Does anyone have a hint of what might go wrong? Maybe some additional configuration is missing

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Has been fixed recently: https://github.com/spring-projects/spring-integration/issues/3694.

Will be released next week for upcoming Spring Boot 2.6.2.

As a workaround, instead of @EnablePublisher you can add this bean:

@Bean(IntegrationContextUtils.PUBLISHER_ANNOTATION_POSTPROCESSOR_NAME)
static PublisherAnnotationBeanPostProcessor publisherAnnotationBeanPostProcessor() {
    return new PublisherAnnotationBeanPostProcessor() {

        @Override
        public void afterPropertiesSet() {

        }

    };
}

It's problem that it has that this.beanFactory.getBean(PublisherAnnotationBeanPostProcessor.class) in its afterPropertiesSet(). So, to mitigate a cycle we just need to get rid of it!

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda