| Author | 
		  Message
		 | 
		
		  | gopal reddy | 
		  
		    
			  
				 Posted: Fri Mar 10, 2006 12:22 am    Post subject: MQMessage receiving problem | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | elvis_gn | 
		  
		    
			  
				 Posted: Fri Mar 10, 2006 1:18 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | EddieA | 
		  
		    
			  
				 Posted: Fri Mar 10, 2006 8:49 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | gopal reddy | 
		  
		    
			  
				 Posted: Sat Mar 11, 2006 2:46 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | fjb_saper | 
		  
		    
			  
				 Posted: Sat Mar 11, 2006 4:55 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    Grand High Poobah
 
 Joined: 18 Nov 2003 Posts: 20768 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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | gopal reddy | 
		  
		    
			  
				 Posted: Sun Mar 12, 2006 2:39 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | wschutz | 
		  
		    
			  
				 Posted: Sun Mar 12, 2006 3:44 am    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		    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 | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | gopal reddy | 
		  
		    
			  
				 Posted: Sun Mar 12, 2006 9:43 pm    Post subject:  | 
				     | 
			   
			 
		   | 
		
		
		   Newbie
 
 Joined: 02 Mar 2006 Posts: 6 Location: India 
  | 
		  
		    
		   | 
		
		
		  | Back to top | 
		  
		  	
		   | 
		
		
		    | 
		
		
		  | 
		    
		   |