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 » MQ communicate program

Post new topic  Reply to topic
 MQ communicate program « View previous topic :: View next topic » 
Author Message
muyu77
PostPosted: Wed Oct 20, 2004 12:55 am    Post subject: MQ communicate program Reply with quote

Newbie

Joined: 20 Oct 2004
Posts: 5

I communicate between two AIX Servers by MQ,aix1,aix2

aix1 is sender
the data is an array xxsPart[][]

ObjectMessage objmsg = sessionSend.createObjectMessage();
objmsg.setObject(xxsPart);
objmsg.setStringProperty("identifier", identifier);
sender.send(objmsg);

aix2 is receiver
Message aMessage = receiver.receive(Long.parseLong(resMQ.getString("TIMEOUT")));
if (aMessage != null) {
ObjectMessage objmsg = (ObjectMessage) aMessage;
xxsPart = (String[][]) objmsg.getObject();
}
but when I execute the command
ObjectMessage objmsg = (ObjectMessage) aMessage;
return an error:
java.lang.ClassCastException: com.ibm.jms.JMSBytesMessage

who can slove the problem for me

thanks
Back to top
View user's profile Send private message
bower5932
PostPosted: Wed Oct 20, 2004 6:18 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

What version (use mqver) are you using on your two aix boxes? I believe there were several classcastexceptions that were fixed with (or after) FixPack 4.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
muyu77
PostPosted: Wed Oct 20, 2004 10:44 pm    Post subject: Reply with quote

Newbie

Joined: 20 Oct 2004
Posts: 5

thank your answer,but I can not understand you mean "fixpack 4", can you tell me how to slove it. My MQ version is 5.3

very thank you
Back to top
View user's profile Send private message
siliconfish
PostPosted: Wed Oct 20, 2004 10:52 pm    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

Fixpack4 == CSD04
http://www-306.ibm.com/software/integration/mqfamily/support/summary/
_________________
siliconfish
Back to top
View user's profile Send private message
muyu77
PostPosted: Wed Oct 20, 2004 11:42 pm    Post subject: Reply with quote

Newbie

Joined: 20 Oct 2004
Posts: 5

several weeks,I can runing the program and receive the message,but now has the error, I think the error is not Fix Pack 4 problem.


at aix1
installed was4
so the JMSAdmin.config is
INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
PROVIDER_URL=iiop://localhost:2222/
SECURITY_AUTHENTICATION=none

at aix2
not installed was
so the JMSAdmin.config is
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
PROVIDER_URL=file:/usr/mqm/java/bin
SECURITY_AUTHENTICATION=none

is right for setting the JMSAdmin.config file ?
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Oct 21, 2004 5:36 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You jmsadmin files look ok to me. I'd still like to see the output of the mqver command from both boxes. Also, if this error is just now showing up, has anything changed?
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Thu Oct 21, 2004 1:58 pm    Post subject: Reply with quote

Grand High Poobah

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

My guess is you are receiving the object message from a non JMS sender I.e. the message is missing the RFH2 header.

The solution: Treat it as a BytesMessage, extract the bytes into a buffered reader and read the object from the reader.

Have fun
Back to top
View user's profile Send private message Send e-mail
bower5932
PostPosted: Fri Oct 22, 2004 5:47 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

fjb_saper wrote:
My guess is you are receiving the object message from a non JMS sender I.e. the message is missing the RFH2 header.


And you could test this by running amqsbcg against the queue to see if the message has the header or not.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
muyu77
PostPosted: Sun Oct 24, 2004 9:56 pm    Post subject: Reply with quote

Newbie

Joined: 20 Oct 2004
Posts: 5

I have check it , the message is missing the RFH2 header.

but why . how to slove it
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » MQ communicate program
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.