【发布时间】:2017-10-03 08:16:20
【问题描述】:
spring 集成,在 outbound-gateway 中想使用动态的 URL 像
<bean id="requestValues" class="com.src.model.RequestValues"/>
<int-http:outbound-gateway
request-channel="reqChannel" url="${UrlValue}"
http-method="${reqmethod}" expected-response-type="java.lang.String" header-mapper="headerMapper"
charset="UTF-8" reply-timeout="5000" reply-channel="responseChannel" >
<int-http:uri-variable name="UrlValue" expression="#{requestValues.getUrl()}" />
<int-http:uri-variable name="reqmethod" expression="#{requestValues.getReqMethod()}" />
</int-http:outbound-gateway>
这里的Requestvalues是简单的POJO 就像
@Data
public class Requestvalues {
public String Url;
public String reqMethod;
}
org.springframework.beans.factory.BeanCreationException:创建名为 'org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler#0' 的 bean 时出错:无法创建 [org 类型的内部 bean'(inner bean)#6ea2bc93' .springframework.integration.config.ExpressionFactoryBean] 同时使用键 [url] 设置 bean 属性'uriVariableExpressions';嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名称为“(内部 bean)#6ea2bc93”的 bean 时出错:通过构造函数实例化 bean 失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [org.springframework.integration.config.ExpressionFactoryBean]:构造函数抛出异常;嵌套异常是 java.lang.IllegalArgumentException: expressionString 不能为空或 null
【问题讨论】:
标签: java spring spring-integration