Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Runtime exception thrown by GatewayProxyFactoryBean

Migrating to Spring Integration 4.0.4, the following exception is thrown when using a service bean created with GatewayProxyFactoryBean:

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)

Our design uses GatewayProxyFactoryBean extensively and this exception seems to be new. In this case we are not using any SpEL expressions. How can this exception be avoided?

like image 652
Robert Bowman Avatar asked Feb 12 '23 21:02

Robert Bowman


1 Answers

Actually it isn't Exception, but just WARN.

From one side you can just ignore it or decrease logging level for the org.springframework.integration.expression.ExpressionUtils category.

Or, of course, and what will be better and even recommended, when you create your own GatewayProxyFactoryBean, provide for it BeanFactory and invoke afterPropertiesSet() of that GatewayProxyFactoryBean.

like image 111
Artem Bilan Avatar answered Feb 26 '23 11:02

Artem Bilan