1

I am trying to send payload over to gemfire cache. I receive this payload as a MQ Message. It works fine if my outbound adapter is another Queue.

However when the outbound channel is outbound adapter for Gemfire it throws exception. Below is the code snippet.

Help here is really appreciated. As i am new to Gemfire + Spring IO

<jms:message-driven-channel-adapter id="wMQ_in_channelAdapter" 
       concurrent-consumers="5"
       max-concurrent-consumers="10"
       connection-factory="inCachingConnectionFactory"           
       destination="requestQueue-mq"
       extract-payload="true"
       channel="demoChannel"/>


<integration:channel id="demoChannel"/>

<integration:service-activator input-channel="demoChannel" 
            ref="demoBean"
            method="upperCase"
            output-channel="orchestrationChannel" /> 

<integration:channel id="orchestrationChannel"/>

<gfe:cache id="PushProducer" cache-xml-location="classpath:PushProducer.xml"/>

<gfe:lookup-region id="exampleRegion" cache-ref="PushProducer" name="exampleRegion"/> 

<int-gfe:outbound-channel-adapter id="cacheChannel" channel="orchestrationChannel" region="exampleRegion">
        <int-gfe:cache-entries>
            <entry key="payload" value="abcd"/>
        </int-gfe:cache-entries> 
</int-gfe:outbound-channel-adapter>

Below is the error i am seeing when the message is received in the application

[org.springframework.jms.listener.DefaultMessageListenerContainer#0-3][org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler] org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler#0 received message: GenericMessage [payload=<?xml version="1.0" encoding="UTF-8"?

The payload is printed here in above line.. and the below line is the error

12:20:00.196 WARN  [org.springframework.jms.listener.DefaultMessageListenerContainer#0-3][org.springframework.jms.listener.DefaultMessageListenerContainer] Execution of JMS message listener failed, and no ErrorHandler has been set.
java.lang.AbstractMethodError
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:277)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:239)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95)
    at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutput(AbstractMessageProducingHandler.java:248)
    at org.springframework.integration.handler.AbstractMessageProducingHandler.produceOutput(AbstractMessageProducingHandler.java:171)
    at org.springframework.integration.handler.AbstractMessageProducingHandler.sendOutputs(AbstractMessageProducingHandler.java:119)
    at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:105)
    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
    at org.springframework.integration.dispatcher.AbstractDispatcher.tryOptimizedDispatch(AbstractDispatcher.java:116)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:101)
    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)
    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:277)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:115)
    at org.springframework.messaging.core.GenericMessagingTemplate.doSend(GenericMessagingTemplate.java:45)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.send(AbstractMessageSendingTemplate.java:95)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:133)
    at org.springframework.messaging.core.AbstractMessageSendingTemplate.convertAndSend(AbstractMessageSendingTemplate.java:125)
    at org.springframework.integration.gateway.MessagingGatewaySupport.send(MessagingGatewaySupport.java:302)
    at org.springframework.integration.jms.ChannelPublishingJmsMessageListener$GatewayDelegate.send(ChannelPublishingJmsMessageListener.java:479)
    at org.springframework.integration.jms.ChannelPublishingJmsMessageListener.onMessage(ChannelPublishingJmsMessageListener.java:322)
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:660)
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:620)
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:591)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:308)
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:246)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1142)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1134)
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1031)
    at java.lang.Thread.run(Thread.java:662)
Artem Bilan
  • 113,505
  • 11
  • 91
  • 118

2 Answers2

0

First of all not enough info in the stacktrace. There is no points regarding CacheWritingMessageHandler.

From other side see this: http://docs.spring.io/spring-integration/docs/latest-ga/reference/html/gemfire.html#gemfire-outbound. So, your <entry key="payload" value="abcd"/> isn't valid, because both key and value must be SpEL expressions. Since the root evaluation object is Message there is no such a getter getAbcd() on the Message object.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • @ Artem,in the stack trace i do see below entry regarding 'CacheWritingMessageHandler' {'DEBUG org.springframework.jms.listener.DefaultMessageListenerContainer#0-5][org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler] org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler#0 received message: GenericMessage'} after the entry it prints the entire payload and then throws that exception message i copied in the above question. BTW, i tried with value as 'payload.toLowerCase()' still the same exception. what is missing the stacktrace isnt giving any hints – user2160677 Feb 15 '15 at 11:14
  • thats my pom dependancies , anything wrong ? {org.springframework.integration spring-integration-core 3.0.2.RELEASE org.springframework.integration spring-integration-jms 3.0.2.RELEASE org.springframework.integration spring-integration-gemfire 3.0.2.RELEASE com.gemstone.gemfire gemfire 7.0.1 } – user2160677 Feb 15 '15 at 11:42
  • Would be better if you debug the `CacheWritingMessageHandler#handleMessageInternal` to determine the root of cause. – Artem Bilan Feb 15 '15 at 12:18
  • Oh, I see, but check the real classpath run with `-verbose` to see which jar each class is loaded from (see my answer) - or look at the dependency tree with maven in case something is overriding the version - in future don't put stuff like this in comments; it's hard to see - edit your question instead when adding code/config - don't put it in a comment. – Gary Russell Feb 15 '15 at 14:21
0

AbstractMethodError is usually because of a classpath problem (version mismatch).

In this case, it looks like you are using spring-integration-core 4.x and spring-integration-gemfire 3.x (or earlier); or vice-versa.

In 4.0, the signature of that method changed (different Message object).

I suggest you use 4.1.2 for everything.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • sorry for the late reply guys, But was busy with some other stuff. It turns out that it was a version issue, with Spring 3.x.x i needed to downgrade the gemfire dependancy from version 7.0.1 to 6.X.X and it worked fine. Thanks for you help gusy. – user2160677 Feb 20 '15 at 09:22