Runtime exception thrown by GatewayProxyFactoryBean

Migrating to Spring Integration 4.0.4 , when using a bean service created with GatewayProxyFactoryBean

:

the following exception is thrown:
Sep 30, 2014 3:45:21 PM org.springframework.integration.expression.ExpressionUtils createStandardEvaluationContext
WARNING: Creating EvaluationContext with no beanFactory
java.lang.RuntimeException: No beanfactory
    at org.springframework.integration.expression.ExpressionUtils.createStandardEvaluationContext(ExpressionUtils.java:79)
    at org.springframework.integration.gateway.GatewayMethodInboundMessageMapper.createMethodInvocationEvaluationContext(GatewayMethodInboundMessageMapper.java:182)
    at org.springframework.integration.gateway.GatewayMethodInboundMessageMapper.access$000(GatewayMethodInboundMessageMapper.java:77)
    at org.springframework.integration.gateway.GatewayMethodInboundMessageMapper$DefaultMethodArgsMessageMapper.toMessage(GatewayMethodInboundMessageMapper.java:279)
    at org.springframework.integration.gateway.GatewayMethodInboundMessageMapper$DefaultMethodArgsMessageMapper.toMessage(GatewayMethodInboundMessageMapper.java:272)
    at org.springframework.integration.gateway.GatewayMethodInboundMessageMapper.mapArgumentsToMessage(GatewayMethodInboundMessageMapper.java:158)
    at org.springframework.integration.gateway.GatewayMethodInboundMessageMapper.toMessage(GatewayMethodInboundMessageMapper.java:153)
    at org.springframework.integration.gateway.GatewayMethodInboundMessageMapper.toMessage(GatewayMethodInboundMessageMapper.java:77)
    at org.springframework.integration.support.converter.SimpleMessageConverter.toMessage(SimpleMessageConverter.java:82)
    at org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive(AbstractMessagingTemplate.java:112)
    at org.springframework.messaging.core.AbstractMessagingTemplate.convertSendAndReceive(AbstractMessagingTemplate.java:103)
    at org.springframework.integration.gateway.MessagingGatewaySupport.doSendAndReceive(MessagingGatewaySupport.java:241)
    at org.springframework.integration.gateway.MessagingGatewaySupport.sendAndReceive(MessagingGatewaySupport.java:220)
    at org.springframework.integration.gateway.GatewayProxyFactoryBean.invokeGatewayMethod(GatewayProxyFactoryBean.java:341)
    at org.springframework.integration.gateway.GatewayProxyFactoryBean.doInvoke(GatewayProxyFactoryBean.java:304)
    at org.springframework.integration.gateway.GatewayProxyFactoryBean.invoke(GatewayProxyFactoryBean.java:295)

      

It is widely used in our design GatewayProxyFactoryBean

and this exception seems new. In this case, we do not use SpEL expressions. How can this exception be avoided?

+3


source to share


2 answers


In fact, this is not an exception, but simply WARN

.

On the one hand, you can simply ignore it or reduce the logging level for the category org.springframework.integration.expression.ExpressionUtils

.



Or of course, which is better and even recommended, when you create your own GatewayProxyFactoryBean

, specify it BeanFactory

and call afterPropertiesSet()

this GatewayProxyFactoryBean

.

+4


source


A bit late, but as @Artem Bilan suggested, you can do something like this in your log4j.xml file, assuming you are dealing with an application named console



<logger name="org.springframework.integration.expression.ExpressionUtils">
    <appender-ref ref="console"/>
    <level value="ERROR"/>
</logger>

      

0


source







All Articles