我面臨以下錯誤并使用 spring 版本 5.3.14 和 Spring_integration 5.5.7 并使用 camel 版本 2.25.4。
org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.expression.Expression' for property 'onFailureExpression'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'org.springframework.expression.Expression' for property 'onFailureExpression': no matching editors or conversion strategy found
組態檔:
<int:filter id="xpathfilter" input-channel="eventSpringXpathChannel"
output-channel="eventSpringOutChannel" discard-channel="eventSpringFailureChannel"
expression="#xpath(payload, headers.get('xpathKey'), 'boolean')">
<int:request-handler-advice-chain>
<bean class="org.springframework.integration.handler.advice.ExpressionEvaluatingRequestHandlerAdvice">
<property name="onFailureExpression" value="payload" />
<property name="failureChannel" ref="eventSpringXpathErrorChannel" />
<property name="trapException" value="true" />
</bean>
</int:request-handler-advice-chain>
</int:filter>
uj5u.com熱心網友回復:
該 setter 需要一個 的實體org.springframework.expression.Expression,但您只提供value="payload",它確實不是Expression.
看另一個二傳手:
/**
* Set the expression to evaluate against the root message after a failed
* handler invocation. The exception is available as the variable {@code #exception}.
* Defaults to {@code payload}, if {@code failureChannel} is configured.
* @param onFailureExpression the SpEL expression.
* @since 4.3.7
*/
public void setOnFailureExpressionString(String onFailureExpression) {
因此,您的配置將如下所示:
<property name="onFailureExpressionString" value="payload" />
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/534304.html
標籤:春天弹簧集成
