Spring 集成 Java DSL 错误

Spring Integration Java DSL Error

我已经使用最新的可用版本设置了一个新的 Spring 引导 + Spring 集成 + Spring 集成 Java DSL 项目。该项目构建正常,但是,当我 运行 应用程序时,我得到:

Caused by: java.lang.NoSuchMethodError: org.springframework.integration.dsl.StandardIntegrationFlow.isRegisterComponents()Z
    at org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor.processStandardIntegrationFlow(IntegrationFlowBeanPostProcessor.java:139) ~[spring-integration-java-dsl-1.2.3.RELEASE.jar:?]
    at org.springframework.integration.dsl.config.IntegrationFlowBeanPostProcessor.postProcessBeforeInitialization(IntegrationFlowBeanPostProcessor.java:100) ~[spring-integration-java-dsl-1.2.3.RELEASE.jar:?]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:423) ~[spring-beans-5.0.3.RELEASE.jar:5.0.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1702) ~[spring-beans-5.0.3.RELEASE.jar:5.0.3.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583) ~[spring-beans-5.0.3.RELEASE.jar:5.0.3.RELEASE]

目前使用的依赖如下:

compile ("org.springframework.boot:spring-boot-starter:2.0.0.RC1") {
    exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
}
compile "org.springframework.boot:spring-boot-starter-data-jpa:2.0.0.RC1"
compile "org.springframework.boot:spring-boot-starter-log4j2:2.0.0.RC1"
compile "org.springframework.integration:spring-integration-core:5.0.1.RELEASE"
compile "org.springframework.integration:spring-integration-http:5.0.1.RELEASE"
compile "org.springframework.integration:spring-integration-jms:5.0.1.RELEASE"
compile "org.springframework.integration:spring-integration-java-dsl:1.2.3.RELEASE"

会不会是jar版本组合错误导致的?我不确定如何调试此错误。

当您已经使用 Spring 集成 5.0 时,您不需要额外的 spring-integration-java-dsl 依赖项。自 5.0.

版本以来,它已被合并到核心项目中

Migration Guide and on that page for Spring Integration Java DSL 项目中查看更多信息。