ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » MQMessage receiving problem

Post new topic  Reply to topic
 MQMessage receiving problem « View previous topic :: View next topic » 
Author Message
gopal reddy
PostPosted: Fri Mar 10, 2006 12:22 am    Post subject: MQMessage receiving problem Reply with quote

Newbie

Joined: 02 Mar 2006
Posts: 6
Location: India

Hi all,
Thanks for all the help u have done all these days.
I got another problem while receiving MQMessage.Following is the code i have witten for receiving the message.
Following code works fine some times and gives the below mentioned exception sometimes


mqManager = new MQQueueManager(qManagerName);
try
{
openOptions = MQC.MQOO_INPUT_AS_Q_DEF + MQC.MQOO_FAIL_IF_QUIESCING;
mqQueue = mqManager.accessQueue(queueName, openOptions, null, null, null);
do
{
myMessage = new MQMessage();
try
{
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.matchOptions = MQC.MQMO_NONE;
gmo.waitInterval = 30000;
mqQueue.get(myMessage,gmo);
msgText = myMessage.readUTF();

here i am getting the problem.It is giving an exception

java.io.EOFException
at java.io.DataInputStream.readFully(DataInputStream.java:268)
at java.io.DataInputStream.readUTF(DataInputStream.java:639)
at java.io.DataInputStream.readUTF(DataInputStream.java:610)
at com.ibm.mq.MQMessage.readUTF(MQMessage.java:779)


Please help me out from this problem
Back to top
View user's profile Send private message Send e-mail
elvis_gn
PostPosted: Fri Mar 10, 2006 1:18 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi gopal reddy,

Try this
Code:
String msgString = inMsg.readString(inMsg.getMessageLength());

instead of
Code:
msgText = myMessage.readUTF();


If still dosen't work, i would suggest downloading some of the sample code available on this forum.

Regards.
Back to top
View user's profile Send private message Send e-mail
EddieA
PostPosted: Fri Mar 10, 2006 8:49 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Quote:
msgText = myMessage.readUTF();

Are you certain that the message is in this format. readUTF() expects that the message starts with a 2 byte count.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
gopal reddy
PostPosted: Sat Mar 11, 2006 2:46 am    Post subject: Reply with quote

Newbie

Joined: 02 Mar 2006
Posts: 6
Location: India

i should use only the following statement
msgText = myMessage.readUTF();
b'coz i am receiving this message through MDB.In that i have only this option to read a message.
If anyone has a solution plz help me.


I am sending an MQMessage where the MDB will receive that message.I need to cast that message to MQMessage.can anyone help me with the sample code
Back to top
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Sat Mar 11, 2006 4:55 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

gopal reddy wrote:
i should use only the following statement
msgText = myMessage.readUTF();
b'coz i am receiving this message through MDB.In that i have only this option to read a message.
If anyone has a solution plz help me.

Completely wrong. Back to the drawing board. Even a cast to MQMessage will not give you base java but the JMS implementation.... If you use an MDB you will HAVE to learn how to use JMS.


gopal reddy wrote:
I am sending an MQMessage where the MDB will receive that message.I need to cast that message to MQMessage.can anyone help me with the sample code

Read the comment above and answer some simple questions:
What is the format of the message (MQSTR)? What is the content of the message(writeUTF)? How was the message sent(from java, jms or other app)?

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
gopal reddy
PostPosted: Sun Mar 12, 2006 2:39 am    Post subject: Reply with quote

Newbie

Joined: 02 Mar 2006
Posts: 6
Location: India

MQMessage consists of xml data which is packed as string and sent using writeUTF().
In MDB i am able to receive this message by casting it to JMSBytesMessage.But some times it works fine and sometimes it is sending a null message along with the original message.
I went through the IBM site and they have mentioned that it is a bug in MQ(using writeUTF() and writeUTF()) and they have given a fix pack which is not of .exe but it is ibm-axpvms-wmq0530_eco08-v0100--4.pcsi. i do not know what to do with this one and they have not mentioned anything abt that in the site
plz help me out


fjb_saper wrote:
gopal reddy wrote:
i should use only the following statement
msgText = myMessage.readUTF();
b'coz i am receiving this message through MDB.In that i have only this option to read a message.
If anyone has a solution plz help me.

Completely wrong. Back to the drawing board. Even a cast to MQMessage will not give you base java but the JMS implementation.... If you use an MDB you will HAVE to learn how to use JMS.


gopal reddy wrote:
I am sending an MQMessage where the MDB will receive that message.I need to cast that message to MQMessage.can anyone help me with the sample code

Read the comment above and answer some simple questions:
What is the format of the message (MQSTR)? What is the content of the message(writeUTF)? How was the message sent(from java, jms or other app)?

Enjoy
Back to top
View user's profile Send private message Send e-mail
wschutz
PostPosted: Sun Mar 12, 2006 3:44 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Can you paste the link for this fix? The axpvms part of the name makes it sound like OpenVMS.. Since you are looking for an .exe file, I suspect you are on windows .....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
gopal reddy
PostPosted: Sun Mar 12, 2006 9:43 pm    Post subject: Reply with quote

Newbie

Joined: 02 Mar 2006
Posts: 6
Location: India

Following is the link to the MQ patch

https://www14.software.ibm.com/webapp/iwm/web/reg/download.do?source=wsmqcsd&S_PKG=csd08&cp=UTF-8#
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQMessage receiving problem
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.