使用 spring Http.outboundGateway dsl 的 HttpRequestExecutingMessageHandler 错误

HttpRequestExecutingMessageHandler error using spring Http.outboundGateway dsl

我在使用 Http.outboundGateway 时看到以下错误,有人可以帮助我解决问题吗

@Bean
public IntegrationFlow syncProcessFlow() {
    return 
            // dsl code to fetch a message from Queue
            ...
            .<Event, EventType>route(event -> event.getType(), mapping -> mapping
                    .channelMapping(EventType.CREATE, "createFlow")
                    .defaultOutputChannel("nullChannel")
                    .resolutionRequired(false))
            .get();
}

@Bean
public IntegrationFlow createFlow() {
    return IntegrationFlows.from("createFlow")
           .handle(Http.outboundGateway("http://google.com")
                    .httpMethod(HttpMethod.GET)
                    .expectedResponseType(String.class))
            .log(LoggingHandler.Level.DEBUG, "response", m -> m.getPayload())
            .log(LoggingHandler.Level.DEBUG, "response", m -> m.getHeaders())
            .get();
}

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler#0': Post-processing of merged bean definition failed; nested exception is java.la
ng.IllegalStateException: Failed to introspect Class [org.springframework.integration.http.outbound.AbstractHttpRequestExecutingMessageHandler] from ClassLoader [java.net.URLClassLoader@6e708cdf]


Caused by: java.lang.NoClassDefFoundError: Lorg/springframework/expression/spel/support/SimpleEvaluationContext;

java.lang.NoClassDefFoundError: Lorg/springframework/expression/spel/support/SimpleEvaluationContext;

意味着您已经升级到最新的 Spring 集成,但您仍然坚持使用以前的 Spring 框架版本。

或者您需要依赖 Spring 集成的传递依赖,或者升级 Spring 框架。

发生这种重大变化的所有原因都在这里:https://spring.io/blog/2018/04/05/multiple-cve-reports-published-for-the-spring-framework