使用spring Http.outboundGateway dsl的HttpRequestExecutingMessageHandler错误

时间:2018-04-11 12:48:19

标签: spring-integration spring-integration-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;

1 个答案:

答案 0 :(得分:2)

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

意味着您已升级到最新的Spring Integration,但您仍然坚持使用以前的Spring Framework版本。

或者你需要依赖Spring Integration的传递依赖,或者升级Spring Framework。

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