You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2015-10-28 11:45:43,630 ERROR inbound.retry.0-redis:queue-inbound-channel-adapter1 o.s.c.s.b.r.RedisMessageChannelBinder$1:286 - Failed to deliver message
org.springframework.messaging.MessageHandlingException: error occurred in message handler [org.springframework.integration.redis.outbound.RedisQueueOutboundChannelAdapter@5f977c77]; nested exception is java.lang.IllegalArgumentException: EvaluationContext must not be null
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:139) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.cloud.stream.binder.redis.RedisMessageChannelBinder$1$2.recover(RedisMessageChannelBinder.java:277) ~[classes/:na]
at org.springframework.cloud.stream.binder.redis.RedisMessageChannelBinder$1$2.recover(RedisMessageChannelBinder.java:267) ~[classes/:na]
at org.springframework.retry.support.RetryTemplate.handleRetryExhausted(RetryTemplate.java:458) ~[spring-retry-1.1.2.RELEASE.jar:na]
at org.springframework.retry.support.RetryTemplate.doExecute(RetryTemplate.java:320) ~[spring-retry-1.1.2.RELEASE.jar:na]
at org.springframework.retry.support.RetryTemplate.execute(RetryTemplate.java:168) ~[spring-retry-1.1.2.RELEASE.jar:na]
at org.springframework.cloud.stream.binder.redis.RedisMessageChannelBinder$1.doSend(RedisMessageChannelBinder.java:260) ~[classes/:na]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:442) [spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:392) [spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115) [spring-messaging-4.2.3.BUILD-20151027.143026-12.jar:4.2.3.BUILD-SNAPSHOT]
at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45) [spring-messaging-4.2.3.BUILD-20151027.143026-12.jar:4.2.3.BUILD-SNAPSHOT]
at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:105) [spring-messaging-4.2.3.BUILD-20151027.143026-12.jar:4.2.3.BUILD-SNAPSHOT]
at org.springframework.integration.endpoint.MessageProducerSupport.sendMessage(MessageProducerSupport.java:105) [spring-integration-core-4.2.1.RELEASE.jar:na]
at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.popMessageAndSend(RedisQueueMessageDrivenEndpoint.java:224) [spring-integration-redis-4.2.1.RELEASE.jar:na]
at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint.access$300(RedisQueueMessageDrivenEndpoint.java:54) [spring-integration-redis-4.2.1.RELEASE.jar:na]
at org.springframework.integration.redis.inbound.RedisQueueMessageDrivenEndpoint$ListenerTask.run(RedisQueueMessageDrivenEndpoint.java:323) [spring-integration-redis-4.2.1.RELEASE.jar:na]
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:55) [spring-integration-core-4.2.1.RELEASE.jar:na]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_51]
Caused by: java.lang.IllegalArgumentException: EvaluationContext must not be null
at org.springframework.util.Assert.notNull(Assert.java:115) ~[spring-core-4.2.3.BUILD-20151027.143026-12.jar:4.2.3.BUILD-SNAPSHOT]
at org.springframework.expression.spel.ExpressionState.<init>(ExpressionState.java:85) ~[spring-expression-4.2.3.BUILD-20151027.143026-12.jar:4.2.3.BUILD-SNAPSHOT]
at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:329) ~[spring-expression-4.2.3.BUILD-20151027.143026-12.jar:4.2.3.BUILD-SNAPSHOT]
at org.springframework.integration.redis.outbound.RedisQueueOutboundChannelAdapter.handleMessageInternal(RedisQueueOutboundChannelAdapter.java:115) ~[spring-integration-redis-4.2.1.RELEASE.jar:na]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:127) ~[spring-integration-core-4.2.1.RELEASE.jar:na]
... 17 common frames omitted
That's just because:
@Override
public void afterPropertiesSet() throws Exception {
Assert.notNull(this.applicationContext, "The 'applicationContext' property cannot be null");
onInit();
if (this.evaluationContext == null) {
this.evaluationContext = IntegrationContextUtils.getEvaluationContext(getBeanFactory());
}
}
in the MessageChannelBinderSupport, but the RedisMessageChannelBinder has this code:
Fixesspring-cloudGH-166 (spring-cloud#166)
Since `onInit()` in the `MessageChannelBinderSupport` was called before the `evaluationContext` population,
the `RedisMessageChannelBinder#errorAdapter` caused `NPE` for its `evaluationContext`.
* Change the initialization order
* Use `ExpressionUtils` to populate `evaluationContext` - creates `StandardEvaluationContext` if there is no one in the `applicationContext`
* Add more initializations for the `RedisMessageChannelBinder#errorAdapter`
* Remove explicit `evaluationContext` population from the `AbstractTestBinder` to rely on the fix for this ticket
* Some other simple polishing
That's just because:
in the
MessageChannelBinderSupport
, but theRedisMessageChannelBinder
has this code:So, we populate
null
to theRedisQueueOutboundChannelAdapter
in case of normal application initialization.The text was updated successfully, but these errors were encountered: