Posted: Mon May 03, 2010 5:08 pm Post subject: EOFExceptions when pulling message of the queue
Apprentice
Joined: 04 Sep 2009 Posts: 31
Occasionally our MessageListeners are having an issue where sometimes when we pull a message off the queue we see a LinkException that says that an EOFException has occurred
Using the stack reported by the listener is essentially readInt in Msg2 whereby it's seeing an EOFException instead of something that is infact in an int.
Also occasionally we see within what should be "text" ie. xml the following
Only the new code has the Linked Exception but it's basically an EOFException during readInt
javax.jms.JMSException: MQJMS1000: Failed to create JMS message
at com.ibm.mq.jms.services.ConfigEnvironment.newException(Config
Environment.java:540)
at com.ibm.mq.jms.MQQueueReceiver.getMessage(MQQueueReceiver.jav
a:1740)
at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.j
ava:828)
at com.ibm.mq.jms.contact admin.run(contact admin.java
:401)
at java.lang.Thread.run(Thread.java:619)
These are the jars in use by the process with the Message Listener
Posted: Tue May 04, 2010 2:17 pm Post subject: Re: EOFExceptions when pulling message of the queue
Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
steffi2 wrote:
Occasionally our MessageListeners are having an issue where sometimes when we pull a message off the queue we see a LinkException that says that an EOFException has occurred
Using the stack reported by the listener is essentially readInt in Msg2 whereby it's seeing an EOFException instead of something that is infact in an int.
Sounds to me like you might have a message content that does not match your expectations. Are you using JMS or MQbase?
steffi2 wrote:
Also occasionally we see within what should be "text" ie. xml the following
Only the new code has the Linked Exception but it's basically an EOFException during readInt
javax.jms.JMSException: MQJMS1000: Failed to create JMS message
at com.ibm.mq.jms.services.ConfigEnvironment.newException(Config
Environment.java:540)
at com.ibm.mq.jms.MQQueueReceiver.getMessage(MQQueueReceiver.jav
a:1740)
at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.j
ava:828)
at com.ibm.mq.jms.contact admin.run(contact admin.java
:401)
at java.lang.Thread.run(Thread.java:619)
These are the jars in use by the process with the Message Listener
jms-1.1.jar
mq-6.000.jar
mqjms-1.0.2b.jar
From what you are saying you would be using JMS here. One of the reasons you might be seeing an RFH header in the payload when using JMS is because of a poorly formatted message. The MQMD should indicate that the next header is an RFH (see values in constants) and the RFH will then indicate the content/format of the next part (header or payload).
This usually happens when a message is being built with an RFH header by a non JMS app and read by a JMS app, but the non JMS app did miss some of the important finer points in its build process....
If using JMS on MQ 7 make sure you are in V6 compatible mode.
Here's the actual backtrace I get and I can tell you that on this occasion the sender is JMS as well as the consumer.
Linked exception
java.io.EOFException
at com.ibm.mq.MQMsg2.readInt(MQMsg2.java:1964)
at com.ibm.mq.jms.MQJMSMessage.createJMSMessage(MQJMSMessage.java:325)
at com.ibm.mq.jms.MQQueueReceiver.getMessage(MQQueueReceiver.java:1670)
at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:828)
at com.ibm.mq.jms.contact admin.run(contact admin.java:401)
at java.lang.Thread.run(Thread.java:619)
Here's the actual backtrace I get and I can tell you that on this occasion the sender is JMS as well as the consumer.
Linked exception
java.io.EOFException
at com.ibm.mq.MQMsg2.readInt(MQMsg2.java:1964)
at com.ibm.mq.jms.MQJMSMessage.createJMSMessage(MQJMSMessage.java:325)
at com.ibm.mq.jms.MQQueueReceiver.getMessage(MQQueueReceiver.java:1670)
at com.ibm.mq.jms.MQQueueReceiver.receiveAsync(MQQueueReceiver.java:828)
at com.ibm.mq.jms.contact admin.run(contact admin.java:401)
at java.lang.Thread.run(Thread.java:619)
A little bit more context would probably have helped a lot more.
What this looks like to me is that you are trying to get the value from a JMSMap message? Have you checked using getMapNames or itemexists that the name you are trying to retrieve the value for really exists? Can you also please check the type of the object?
It still looks to me that you may not be getting the content you expected. To be completely sure we would probably need to see both the code used to generate and the code used to read the message...
Can you inspect the message using RFHUtil(c) on the queue before receiving it?
The exception per se says very little... _________________ MQ & Broker admin
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum