spring Integration,in outbound-gateway want to use URL as dynamic like
<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>
Here Requestvalues is simple POJO it like
@Data
public class Requestvalues {
public String Url;
public String reqMethod;
}
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.integration.http.outbound.HttpRequestExecutingMessageHandler#0': Cannot create inner bean '(inner bean)#6ea2bc93' of type [org.springframework.integration.config.ExpressionFactoryBean] while setting bean property 'uriVariableExpressions' with key [url]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6ea2bc93': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.integration.config.ExpressionFactoryBean]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: expressionString must not be empty or null