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 » JMS, Windows 2000 and AIX... Conversion problems!

Post new topic  Reply to topic
 JMS, Windows 2000 and AIX... Conversion problems! « View previous topic :: View next topic » 
Author Message
droussel
PostPosted: Wed Feb 19, 2003 6:34 am    Post subject: JMS, Windows 2000 and AIX... Conversion problems! Reply with quote

Newbie

Joined: 19 Jul 2002
Posts: 3

Hi all,

To put you in situation, I have a java application which can run from any type of OS as of now. It sends documents to a queue (IDOCS) and those documents are then sent to SAP by an R/3 Link adapter. Using native binding and running the java application on the same computer as the QueueManager (AIX) it was all working fine.

Now, I have translated my app to use JMS instead and tried to run it on my Windows 2000 PC. The message are sent allrigth to the queue, but R/3 Link is now giving me a handfull of errors, complaining about conversion, character sets and things like that.

Here is a sample of errors I get:
02/18/03 17:00:39 SMQ4165: Warning on MQGET from inbound queue. Reason code 2110.

EXPLANATION: The attempt to get a message from the inbound message queue returned a warning. The warning code was 2110. The message will be passed to the use
r exit if one has been specified. If no exit was specified, the message will be passed to the bad message queue. If no bad message queue was specified, the
message will be left on the inbound queue, and the server will terminate.
ACTION: None.
-------------------------------------------------------------------------------

02/18/03 17:00:39 SMQ4192: A data conversion problem occurred on the MQGET. Attempting to process message.

EXPLANATION: A warning was issued because the message needs codepage conversion, but the message is either not in MQSTR format, or a user-defined data- conver
sion exit call failed.
ACTION: Ensure that incoming messages from machines with a different code page, are in MQSTR format or that there is a user exit defined to convert messages i
n other formats.
-------------------------------------------------------------------------------
02/18/03 17:00:40 SMQ4167: IDoc has an invalid structure version. IDoc value="16777216". Expected value="1".

EXPLANATION: The value of the version field in the IDoc header structure contains an invalid value.
ACTION: Ensure that the IDoc message starts with a valid version of the Saplink header structure (MQSAPH).
-------------------------------------------------------------------------------
02/18/03 17:00:40 SMQ4191: A message was put to the bad message queue. Bad message type 1, reason 4108.

EXPLANATION: The message was not in a valid IDoc format. The bad message type is 1 and the bad message reason is 4108.
ACTION: Check the bad message reason code in the bad message header of the message. Attempt to correct the error and send the message again.
-------------------------------------------------------------------------------


I finally set the CCSID to 819 in the connection string, now I suspect that my problem is related to the encoding I use but I can't find what to set it to instead. I write everything in a ByteMessage by the way, just as I was doing it with the native bindings.

Does anyone know how I am supposed to set this up? What encoding type should I set it to? Is the CCSID correct? previously, I was setting the format this way: bytesMessage.format = "MQHSAP ";
But using JMS, there is no such property so I tried to just write it to the ByteMessage, not sure this works either...

Thanks in advance,
Daniel




If it can be of any help, here is a code fragment of what I am doing:
using native binding, which was working fine
/*
//-------------------------------------------------//
//Add the mandatory R3/Link header to our message
bytesMessage.writeBytes("SAPH");
bytesMessage.writeInt(1);
bytesMessage.writeInt(108);
bytesMessage.writeInt(273);
bytesMessage.writeInt(819);
bytesMessage.writeBytes("MQSTR ");

for(int i = 28; i < 108; i++)
bytesMessage.writeByte(32);
//-------------------------------------------------//

bytesMessage.writeBytes(textMessage);
bytesMessage.encoding = MQC.MQENC_INTEGER_NORMAL;
bytesMessage.format = "MQHSAP ";
*/



And using JMS:

//Test code
queue = session.createQueue("queue://" + manager + "/" + name + "?priority=5&persistence=2&targetClient=1&encoding=" +
MQC.MQENC_INTEGER_REVERSED + "&CCSID=819");

...

//Add the mandatory R3/Link header to our message
bytesMessage.writeBytes("SAPH".getBytes());
bytesMessage.writeInt(1);
bytesMessage.writeInt(108);
bytesMessage.writeInt(273);
bytesMessage.writeInt(819);
bytesMessage.writeBytes("MQSTR ".getBytes());

StringBuffer padding = new StringBuffer(80);
for(int i = 28; i < 108; i++)
padding.append(" ");

bytesMessage.writeBytes(padding.toString().getBytes());
//-------------------------------------------------//

bytesMessage.writeBytes("MQHSAP ".getBytes());
bytesMessage.writeBytes(textMessage.getBytes());

queueSender.send(bytesMessage);
Back to top
View user's profile Send private message
droussel
PostPosted: Fri Feb 21, 2003 8:40 am    Post subject: Reply with quote

Newbie

Joined: 19 Jul 2002
Posts: 3

I finally find the problem today, so I post the fix in case anybody runs into the same problem as me!

in fact, I've just been plain stupid and the R/3 Link error message were nothing to help me...

Using the MQseries classes for java, I was seeting the format this way:
bytesMessage.format = "MQHSAP ";

But when I converted the application to use JMS, I wrote
Code:
bytesMessage.writeBytes("MQHSAP ".getBytes());

So it would at least compile, telling myself that I would come back to it later to find the proper property string to use...
Well, I forgot about it and that is what was causing me problem... The idoc format was invalidated because of this.

The proper way of setting this property was to set it this way;
Code:
bytesMessage.setStringProperty("JMS_IBM_Format", "MQHSAP  ");


No need for a CCSID setting or to change the Integer encoding to another value then MQC.MQENC_INTEGER_REVERSED

So, hope this will be usefull to someone,

Cheers!
Daniel Roussel
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 » JMS, Windows 2000 and AIX... Conversion problems!
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.