Author |
Message
|
jmig |
Posted: Tue Jul 03, 2012 12:39 pm Post subject: Setting properties and getting rc 2142 |
|
|
Newbie
Joined: 03 Jul 2012 Posts: 4
|
Using: WMQ 7.0.1.3
I am trying to set properties to a message for selectors to later use. Whenever I actually set a property, on the put call I get rc 2142.
16:09:56,185 ERROR [org.jboss.weld.injection.FieldInjectionPoint] (http-/127.0.0.1:8080-4) MQException with completion code: 2 and reason code: 2142: com.ibm.mq.MQException: MQJE001: Completion Code '2', Reason '2142'.
at com.ibm.mq.MQMessage.writePropertiesRfh2(MQMessage.java:3471) [com.ibm.mq-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
at com.ibm.mq.MQMessage.performProcessingBeforePut(MQMessage.java:3313) [com.ibm.mq-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
at com.ibm.mq.MQDestination.put(MQDestination.java:1104) [com.ibm.mq-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
at com.ibm.mq.MQDestination.put(MQDestination.java:1038) [com.ibm.mq-7.0.1.3.jar:7.0.1.3 - k701-103-100812]
Code snippet:
MQQueue queue = qMgr.accessQueue(propertiesBean.getProperty("mq.product.request"), openOptions, null, null, null);
MQMessage message = new MQMessage();
message.format = MQConstants.MQFMT_STRING;
message..setStringProperty("REGNUM", "101");
...
queue.put(message);
I have looked into / tried changing the message format to RFH2 and the character set (but not sure how to change the ccsid, like has been suggested elsewhere on the forum). The queue's property control is set to compatibility. I also saw suggestions to change the TARGCLIENT, but I also wasn't sure on how to do that.
I feel like I'm missing something simple and have just been looking at this too long. Any help would be great. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jul 03, 2012 12:55 pm Post subject: Re: Setting properties and getting rc 2142 |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
jmig wrote: |
I also saw suggestions to change the TARGCLIENT, but I also wasn't sure on how to do that. |
Search facility (top right of this page) and search for TARGCLIENT. Many discussions. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jmig |
Posted: Tue Jul 03, 2012 1:12 pm Post subject: |
|
|
Newbie
Joined: 03 Jul 2012 Posts: 4
|
I've been through a lot of those, almost all of which talk about doing that change through JMS. Still haven't found a way to do that with java. We're not using JMS to send these messages. So if you could point to something that would show how to do that without JMS, that would be useful. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jul 03, 2012 7:58 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried if the same code works at level 7.0.1.8? You might also want to check how this works if you set the CCSID of the message to 1208...
I remember working an example not so far ago in java base and C#... (read the property from the incoming message (GMO option property in handle) and put it on the outgoing message) and I had no problem  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jmig |
Posted: Thu Jul 05, 2012 7:43 am Post subject: |
|
|
Newbie
Joined: 03 Jul 2012 Posts: 4
|
I had tried that before and still get the same problem. Am I using the wrong method to set a property?
What I tried:
message.format = MQConstants.MQFMT_STRING;
message.characterSet = 1208;
message.setStringProperty("STORENUM", "700");
message.writeString(xmlMessage.toString());
queue.put(message);
Is set*Property only for mq properties?
Quote: |
Have you tried if the same code works at level 7.0.1.8? |
I have not tried that yet, but I will give it a shot later today. Even if it did work on 7.0.1.8, I highly doubt the company would upgrade to that. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jul 05, 2012 8:28 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I think you need to pay attention to what's said here |
|
Back to top |
|
 |
jmig |
Posted: Thu Jul 05, 2012 11:28 am Post subject: |
|
|
Newbie
Joined: 03 Jul 2012 Posts: 4
|
Thanks for all the suggestions! I decided to try printing out all the headers before the put to see if things were being set and that showed an exception that was getting buried I guess. I was missing the CachingHeader class from the pcf jar. DOH!  |
|
Back to top |
|
 |
|