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 » PUB/SUBJMS

Post new topic  Reply to topic
 PUB/SUBJMS « View previous topic :: View next topic » 
Author Message
JayeshLove
PostPosted: Fri Nov 16, 2001 10:04 am    Post subject: Reply with quote

Newbie

Joined: 15 Nov 2001
Posts: 2

Hi all,
I have installed ma0c_sol.tar.Z on the sun solaris server. I am trying to run JMSPUBSUB.java which is the JMS sample application for Publish subscribe mode. I am getting following error:

Running Publisher produces following output on screen:
----------------------
[P]ublish message, [Q]uit? p
Text to publish : Hello This is the test message

When i publish the message as shown above the subscriber throws the following exception:
-------------
[R]eceiveBlock, Receive[N]oWait, Receive[5]Secs, [Q]uit? R
Exception in thread "main" java.lang.ClassCastException: com.ibm.jms.JMSBytesMessage

I tried writing a java program myself for publisher and subscriber. Still i am getting the same message. Its apparant that publisher is publishing the TextMessage but the subscriber is receiving the ByteMessage .
I have following output from the program which i wrote:
THE MESSAGE published is :
JMS Message class: jms_text
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 4
JMSMessageID: null
JMSTimestamp: 0
JMSCorrelationID:null
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: false
Hello - Test Message !

The message Received is :
JMS Message class: jms_bytes
JMSType: null
JMSDeliveryMode: 2
JMSExpiration: 0
JMSPriority: 4
JMSMessageID: ID:414d5120464d43514d202020202020203bb24ebd000f28a3
JMSTimestamp: 1005867500040
JMSCorrelationID:ID:414d51580000000000000000000000000000000000000000
JMSDestination: null
JMSReplyTo: null
JMSRedelivered: false
JMS_IBM_Encoding:273
JMSXAppID:FMCQM
JMS_IBM_Format:
JMS_IBM_PutApplType:26
JMS_IBM_MsgType:8
JMSXUserID:fmc
JMSXDeliveryCount:1
Integer encoding: 1, Floating point encoding 256
5246482000000001000000f000000111000004b8202020202020202000000000554e495155455f43
4f4e4e454354494f4e5f494420343134643531323034363464343335313464323032303230323032
303230323033626232346562643030313966303133204d515053436f6d6d616e64205075626c6973
68204d515053546f70696320546f7069635f31204d51505353747265616d4e616d65205359535445
4d2e42524f4b45522e44454641554c542e53545245414d204d515053514e616d652053595354454d
2e42524f4b45522e44454641554c542e53545245414d204d5150535075624f707473204e6f526567
48656c6c6f202d2054657374204d6573736167652021

NOTE:
-----
One more important point is that the PSIVTRun program which comes with MQ series to test publish subscribe mode runs perefect. Its publishes the textmessage and gets it back as it is suppose to do.

I read about some CSD05 (PTF U461609) on internet but could not figure out ( it seemed to be just an image file ).I would appreciate if anyone can give me inputs to solve this problem.
Thanking you in anticicpation.
Sincerely,
Jayesh



Back to top
View user's profile Send private message
middlewareonline
PostPosted: Mon Nov 19, 2001 10:08 am    Post subject: Reply with quote

Acolyte

Joined: 09 Jul 2001
Posts: 73

Are you running this locally ? I am asking this beacuse it seems to me that there is some Type Cast error happening. Let me know the answer and I 'll dig into it.

Also, have you tried running PTP sample, just to check the sanity of the install.

MiddlewareOnline.com

_________________
---------------------------------------------
IBM & SUN (J2EE) Certified Consultants,
http://www.MiddlewareOnline.com
A "SARVAM" Online Portal
http://www.SARVAM.com
---------------------------------------------
Back to top
View user's profile Send private message Visit poster's website
JayeshLove
PostPosted: Mon Nov 19, 2001 10:12 am    Post subject: Reply with quote

Newbie

Joined: 15 Nov 2001
Posts: 2

Hi sir,
Thanks for the reply. I am running my code on the same machine where i have MQ series installed. Secondly, PTP samples are running fine. I wrote JMS java code to test sending PTP messages and also receiving the PTP synchronous and asynchronous messages. Everything works perfectly well with PTP.
Even in the case of PUBSUB the PSIVTRun program given by IBM runs fine , indicating that it could publish and receive text message on the topic . I am assuming that the PSIVTRun code is not java JMS based. When i am running the JMSPUBSUB example i have this type cast error.
Your input is highly appreciated on this
Thankx,
Jayesh
Back to top
View user's profile Send private message
kishore
PostPosted: Mon Dec 10, 2001 1:59 am    Post subject: Reply with quote

Newbie

Joined: 10 Oct 2001
Posts: 4

Hi
Actuaaly what ever type you publish(TextMessage,ByteMEssage,MapMessage,StramMessage) it will consider root Message, so you have to do the type casting i.e Suppose you publish TextMessage, in Subscriber side you need to do the type cast like this

inMessage = session.createTextMessage();
inMessage = subscriber.receive();
String msg =((TextMessage)inMessage).getText();

this is one way.

Pls. let me know the status.

kishore

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 » PUB/SUBJMS
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.