Spring integration 服务激活器在接收兔子消息时抛出ClassCastException
我正在使用spring与RabbitMQ AMQP的集成,并面临奇怪的行为 我正在通过rabbitMQ从外部服务接收消息,但服务激活器抛出:Spring integration 服务激活器在接收兔子消息时抛出ClassCastException,spring-integration,Spring Integration,我正在使用spring与RabbitMQ AMQP的集成,并面临奇怪的行为 我正在通过rabbitMQ从外部服务接收消息,但服务激活器抛出: java.lang.ClassCastException:org.springframework.context.expression.MapAccessor不能强制转换为org.springframework.expression.PropertyAccessor 我的代码正在部署到Jboss的EAR文件中运行。 当我从单元测试运行相同的上下文XML时,
java.lang.ClassCastException:org.springframework.context.expression.MapAccessor不能强制转换为org.springframework.expression.PropertyAccessor 我的代码正在部署到Jboss的EAR文件中运行。 当我从单元测试运行相同的上下文XML时,消息会被完美地接收到 设置窃听记录器会显示预期收到的消息 我将感谢任何能指导我完成这项工作的建议或想法 我正在使用:
<int-amqp:inbound-channel-adapter
id="firedJobInboundChannelAdapter"
channel="firedNotificationChannel"
queue-names="firedJob-jboss-Q"
connection-factory="rabbitConnectionFactory"
mapped-request-headers="*" />
<int:channel id="firedNotificationChannel" />
<int:json-to-object-transformer
input-channel="firedNotificationChannel"
output-channel="firedNotificationChannelObject"
type="com.company.scheduling.JobStringDataMap"/>
<int:channel id="firedNotificationChannelObject" />
<int:service-activator input-channel="firedNotificationChannelObject" >
<bean id="firedSchedulerJobReciverBean" class="com.company.notifications.scheduler.gateway.FiredSchedulerJobReciver"/>
</int:service-activator>
例外情况为(错误原因以粗体显示):
原因:java.lang.ClassCastException:org.springframework.context.expression.MapAccessor无法强制转换为org.springframework.expression.PropertyAccessor
位于org.springframework.expression.spel.ast.PropertyOrFieldReference.getPropertyAccessorsToTry(PropertyOrFieldReference.java:330)
位于org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:220)
位于org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:112)
位于org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:107)
位于org.springframework.expression.spel.ast.MethodReference.getValueRef(MethodReference.java:72)
位于org.springframework.expression.spel.ast.CompoundExpression.getValueRef(CompoundExpression.java:63)
位于org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:82)
位于org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
位于org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:103)
位于org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:126)
位于org.springframework.integration.util.MessaginMethodInvokerHelper.processInternal(MessaginMethodInvokerHelper.java:227)
位于org.springframework.integration.util.MessaginMethodInvokerHelper.process(MessaginMethodInvokerHelper.java:127)
位于org.springframework.integration.handler.MethodInvokingMessageProcessor.processMessage(MethodInvokingMessageProcessor.java:73)
... 37多
嗯,在JBOSS类路径中似乎有较旧版本的spring context.jar。
它也应该是3.2.4。并确保所有spring jar都是相同的版本,并且没有任何副本。我们真的需要查看整个堆栈跟踪吗?您能否只显示突出显示的部分?或者至少将整个内容复制到一个粘贴箱中,这样文章更容易阅读?谢谢。问题是重复的spring表达式jar。