gpt4 book ai didi

java - @Retryable with exceptionExpression 不设置任何 #root 对象和变量

转载 作者:行者123 更新时间:2023-12-02 09:20:20 29 4
gpt4 key购买 nike

我在 SpringBatch 的库依赖项中使用带有 @Retryable 注释的 Spring Retry 1.2.4。

exceptionExpression 属性中,我指定了一个自定义异常的表达式 #root.status.is5xxServerError(),我在 include< 中提到了该异常的类 属性。

但它会导致错误并显示以下消息:

org.springframework.retry.RetryException: Non-skippable exception in recoverer while processing; nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1001E: Type conversion problem, cannot convert from java.lang.String to java.lang.Boolean

我觉得奇怪的是,如果我查看最后的“处理时恢复器中不可跳过的异常”,批处理 faultTolerant 配置似乎与库配置冲突消息。

此外,在 SpEL 表达式求值中进行调试时,我注意到评估上下文中没有根对象,也没有设置任何变量,尽管它正在尝试解析#root.status.is5xxServerError()。也许这与上面的观察有关。

感谢帮助

最佳答案

这些注释中的表达式支持非常基本。

我最近开了一个GitHub issue添加改进(运行时评估等)。

关于java - @Retryable with exceptionExpression 不设置任何 #root 对象和变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58735630/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com