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 » Mainframe, CICS, TXSeries » Sending MQ msg Mainframe to JMS gets a ClassCastException

Post new topic  Reply to topic
 Sending MQ msg Mainframe to JMS gets a ClassCastException « View previous topic :: View next topic » 
Author Message
stredders
PostPosted: Wed Jun 06, 2007 12:43 am    Post subject: Sending MQ msg Mainframe to JMS gets a ClassCastException Reply with quote

Newbie

Joined: 06 Jun 2007
Posts: 4
Location: Bracknell, Berkshire, UK

Hi,
I am sending a text MQ Message from IBM Mainframe Z/OS and the recipient is a Java application.

The following error occurs:

2007-06-04 13:09:18.925 browse(), Caught exception during receive: java.lang.ClassCastException: com.ibm.jms.JMSBytesMessage
2007-06-04 13:09:18.925 browse() completed.

Is there anything I can set on the mainframe to prevent this from happening, for example the value of TARGETCLIENT?

Any advice would be appreciated.

Regards
_________________
Mark Stredwick
BMW (UK) Limited
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Wed Jun 06, 2007 1:10 am    Post subject: Re: Sending MQ msg Mainframe to JMS gets a ClassCastExceptio Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

stredders wrote:
Hi,
I am sending a text MQ Message from IBM Mainframe Z/OS and the recipient is a Java application.

The following error occurs:

2007-06-04 13:09:18.925 browse(), Caught exception during receive: java.lang.ClassCastException: com.ibm.jms.JMSBytesMessage
2007-06-04 13:09:18.925 browse() completed.

Is there anything I can set on the mainframe to prevent this from happening, for example the value of TARGETCLIENT?

Any advice would be appreciated.

Regards



TARGETCLIENT describe receive application type, MQ or JMS.
Is this Java application running on z/os ?
Have you tested it with TextMessage ?

What kind of content does this message have ?
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
Vitor
PostPosted: Wed Jun 06, 2007 1:30 am    Post subject: Re: Sending MQ msg Mainframe to JMS gets a ClassCastExceptio Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

stredders wrote:
: java.lang.ClassCastException: com.ibm.jms.JMSBytesMessage
2007-06-04 13:09:18.925 browse() completed.


I'd make sure the putting application is setting the MQMD Format field to indicate a string message. This should cause it to be treated as a text message rather than a byte message.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
stredders
PostPosted: Wed Jun 06, 2007 1:31 am    Post subject: Reply with quote

Newbie

Joined: 06 Jun 2007
Posts: 4
Location: Bracknell, Berkshire, UK

Hi Marcin

Thanks for your reply.

I presum TARGETCLIENT should be JMS, but I do not know how to set the value via our mainframe.

I am trying to find out the operating system for the Java appl (it is running in Germany and I am sending from IBM Mainframe in UK).

My contact in Germany says that they are receiving it as a byteMessage and that they need it to be a textMessage. Is there a setting I can use on my end to influence this?

The message conatins the following data:

TQC401 VF362152019999999010000896999999905

Regards
_________________
Mark Stredwick
BMW (UK) Limited
Back to top
View user's profile Send private message
stredders
PostPosted: Wed Jun 06, 2007 1:33 am    Post subject: Reply with quote

Newbie

Joined: 06 Jun 2007
Posts: 4
Location: Bracknell, Berkshire, UK

Marcin,

The Java appl is running on LINUX.

Regards
_________________
Mark Stredwick
BMW (UK) Limited
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 06, 2007 1:36 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

stredders wrote:
My contact in Germany says that they are receiving it as a byteMessage and that they need it to be a textMessage. Is there a setting I can use on my end to influence this?


I'd still check the Format as a first move.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
marcin.kasinski
PostPosted: Wed Jun 06, 2007 1:45 am    Post subject: Reply with quote

Sentinel

Joined: 21 Dec 2004
Posts: 850
Location: Poland / Warsaw

Hi, after Vitor... check the Format of MQ message.


TARGETCLIENT question:

Is this Linux JAVA application using native MQ or JMS ?
Is this sending z/os WAS application ?
_________________
Marcin
Back to top
View user's profile Send private message Visit poster's website
jefflowrey
PostPosted: Wed Jun 06, 2007 2:01 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

stredders wrote:
My contact in Germany says that they are receiving it as a byteMessage and that they need it to be a textMessage.


This is a 99.99% likely indicator that your MQMD.Format is wrong - like everyone else has said to check.

You can worry about Target Client when the contact in Germany comes back and says that he's getting garbage at the front of the message.

But this is only if you are SENDING using JMS. If you are not, then you can't set Target Client, and the receiving side shouldn't care.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Jun 06, 2007 2:50 am    Post subject: Reply with quote

Grand High Poobah

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

jefflowrey wrote:
stredders wrote:
My contact in Germany says that they are receiving it as a byteMessage and that they need it to be a textMessage.


This is a 99.99% likely indicator that your MQMD.Format is wrong - like everyone else has said to check.


My guess is that your zOS application is not setting the format or has it set to MQFMT_NONE. It needs to be set to MQFMT_STRING.

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
stredders
PostPosted: Wed Jun 06, 2007 4:34 am    Post subject: Reply with quote

Newbie

Joined: 06 Jun 2007
Posts: 4
Location: Bracknell, Berkshire, UK

Marcin, Vitor, Jeff, fjb,

I have set the MQMD format to String and the message was sent and received successfully by the Java appl.

Many thanks for your assistance,

Regards
_________________
Mark Stredwick
BMW (UK) Limited
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 » Mainframe, CICS, TXSeries » Sending MQ msg Mainframe to JMS gets a ClassCastException
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.