Author |
Message
|
stredders |
Posted: Wed Jun 06, 2007 12:43 am Post subject: Sending MQ msg Mainframe to JMS gets a ClassCastException |
|
|
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 |
|
 |
marcin.kasinski |
Posted: Wed Jun 06, 2007 1:10 am Post subject: Re: Sending MQ msg Mainframe to JMS gets a ClassCastExceptio |
|
|
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 |
|
 |
Vitor |
Posted: Wed Jun 06, 2007 1:30 am Post subject: Re: Sending MQ msg Mainframe to JMS gets a ClassCastExceptio |
|
|
 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 |
|
 |
stredders |
Posted: Wed Jun 06, 2007 1:31 am Post subject: |
|
|
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 |
|
 |
stredders |
Posted: Wed Jun 06, 2007 1:33 am Post subject: |
|
|
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 |
|
 |
Vitor |
Posted: Wed Jun 06, 2007 1:36 am Post subject: |
|
|
 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 |
|
 |
marcin.kasinski |
Posted: Wed Jun 06, 2007 1:45 am Post subject: |
|
|
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 |
|
 |
jefflowrey |
Posted: Wed Jun 06, 2007 2:01 am Post subject: |
|
|
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 |
|
 |
fjb_saper |
Posted: Wed Jun 06, 2007 2:50 am Post subject: |
|
|
 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 |
|
 |
stredders |
Posted: Wed Jun 06, 2007 4:34 am Post subject: |
|
|
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 |
|
 |
|