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 » Charactersets and Encoding woes

Post new topic  Reply to topic
 Charactersets and Encoding woes « View previous topic :: View next topic » 
Author Message
rtgordon
PostPosted: Tue Jul 17, 2001 11:38 am    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2001
Posts: 34
Location: Lewisville, TX

We are attempting to web enable a mainframe query from NT running MQSeries 5.1 to VSE running 1.2.0 through an active server page running in IIS. I tested this page by creating a java program that does a put/get with waitInterval. In my test, I put to a remote definition which sent the message to a remote definition which shot the message back to me. I was able to get the message, and pass it back to the ASP page and display it no problem.

Now, when we added the mainframe functionality, my java program puts the message, waits, and gets the message, but apparently when I try to convert it and readString, it blows up.

Result: An Error occurred while trying to write to the message buffer:
java.io.UnsupportedEncodingException: 437 [Could not load class: sun.io.CharToByteCp437]

437 is the default Qmgr characterset on NT, and my application is using MQC_MQCCSI_Q_MGR.

I changed the application to run standalone from the command line. It returns the data that I am looking for no problem. This has me CornFused.

This is my Put logic:

MQMessage stocPutMessage = new MQMessage();
stocPutMessage.format = MQC.MQFMT_STRING;
stocPutMessage.messageType = MQC.MQMT_REQUEST;
stocPutMessage.encoding = MQC.MQENC_NATIVE;
stocPutMessage.characterSet = MQC.MQCCSI_Q_MGR;
stocPutMessage.writeString(msg);
stocPutMessage.replyToQueueName = "STOC.TXROS001.T";

MQPutMessageOptions pmo = new MQPutMessageOptions();
pmo.options = (MQC.MQPMO_NEW_MSG_ID
| MQC.MQPMO_NEW_CORREL_ID
| MQC.MQPMO_DEFAULT_CONTEXT
| MQC.MQPMO_FAIL_IF_QUIESCING);

PutQueue.put(stocPutMessage,pmo);

This is my get logic:

MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.options = (MQC.MQGMO_WAIT
| MQC.MQGMO_CONVERT
| MQC.MQGMO_FAIL_IF_QUIESCING);
gmo.waitInterval = 15000;
GetQueue.get(stocRetrievedMessage,
gmo,
1000);

int msgLength;
msgLength = stocRetrievedMessage.getTotalMessageLength();

String msgText = stocRetrievedMessage.readString(msgLength);
Back to top
View user's profile Send private message Send e-mail
kolban
PostPosted: Tue Jul 17, 2001 12:43 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Before the Java programs reads the message, what are the attributes of the message about to be read? What code-page is the returned message in? If you can capture these details using the amqsbcg.exe tool and post here, that would be a great place to start.
Back to top
View user's profile Send private message
rtgordon
PostPosted: Tue Jul 17, 2001 1:06 pm    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2001
Posts: 34
Location: Lewisville, TX

Voilá:


MQGET of message number 3
****Message descriptor****

StrucId : 'MD ' Version : 2
Report : 0 MsgType : 1
Expiry : -1 Feedback : 0
Encoding : 1208 CodedCharSetId : 500
Format : 'MQSTR '
Priority : 0 Persistence : 0
MsgId : X'414D51205458524F5354303120202020269E543B13700000'
CorrelId : X'414D51205458524F5354303120202020269E543B23700000'
BackoutCount : 0
ReplyToQ : 'STOC.TXROS001.T '
ReplyToQMgr : 'TXROST01 '
** Identity Context
UserIdentifier : 'mis '
AccountingToken :
X'0000000000000000000000000000000000000000000000000000000000000000
ApplIdentityData : ' '
** Origin Context
PutApplType : '10'
PutApplName : 'MISCICS STCK '
PutDate : '20010717' PutTime : '20382166'
ApplOriginData : ' '

GroupId : X'000000000000000000000000000000000000000000000000'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '0'
OriginalLength : '1000'

**** Message ****

length - 1000 bytes

00000000: D2C5 D4E3 F4F9 F1C1 F1F0 F5D2 F0F1 F6C1 '-++p(·±-±=)-=±÷-'
00000010: E240 4040 4040 4040 4040 4040 4040 405C 'G@@@@@@@@@@@@@@'
00000020: 5C40 D7C1 D9E3 40D2 C5D4 E3F4 F9F1 4040 '@+-+p@-++p(·±@@'
00000030: 4040 4040 4040 4040 4040 4040 4040 40E6 '@@@@@@@@@@@@@@@µ'
00000040: C1E2 40C5 D5E3 C5D9 C5C4 4040 4040 4040 '-G@++p+++-@@@@@@'
00000050: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000060: 4040 4040 4040 4040 4040 4040 40F1 E4C6 '@@@@@@@@@@@@@±S¦'
00000070: 4040 40F1 F6E5 40F1 F06C 40C1 4040 4040 '@@@±÷s@±=l@-@@@@'
00000080: 4040 4040 4040 4040 4040 40C4 4040 4040 '@@@@@@@@@@@-@@@@'
00000090: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000000A0: 4040 4040 4040 404B F0F9 F4F8 4040 4040 '@@@@@@@K=·(°@@@@'
000000B0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000000C0: 4040 4040 4040 4040 4040 D540 4040 4040 '@@@@@@@@@@+@@@@@'
000000D0: 4040 4040 4040 4040 4040 4040 4040 40E3 '@@@@@@@@@@@@@@@p'
000000E0: E740 4040 4040 4040 4040 4040 4040 4040 't@@@@@@@@@@@@@@@'
000000F0: 4040 4040 4040 4040 4040 E8F3 F0F7 4040 '@@@@@@@@@@F==˜@@'
00000100: 4040 40F0 F1F0 F1F7 F7F6 F0F8 F2F9 F0F0 '@@@=±=±˜˜÷=°=·=='
00000110: 4040 4040 4040 4040 4040 4040 40F1 F0F1 '@@@@@@@@@@@@@±=±'
00000120: F4F0 F0F0 4040 4040 4040 4040 4040 4040 '(===@@@@@@@@@@@@'
00000130: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000140: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000150: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000160: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000170: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000180: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000190: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000001A0: 4040 4040 4040 4040 4040 4040 40F1 F0F0 '@@@@@@@@@@@@@±=='
000001B0: 4040 4040 F1F0 F040 4040 40F7 F5F0 4040 '@@@@±==@@@@˜)=@@'
000001C0: 4040 F1F0 F040 4040 F2F4 F0F0 40F8 4040 '@@±==@@@=(==@°@@'
000001D0: F840 4040 F1F0 F040 4040 404B F4F8 F6F2 '°@@@±==@@@@K(°÷='
000001E0: 4040 40F1 F5F0 4040 4040 4BF3 F2F1 F440 '@@@±)=@@@@K==±(@'
000001F0: 4040 F2F0 F040 4040 404B F2F3 F740 4040 '@@===@@@@K==˜@@@'
00000200: 40F2 F5F0 4040 4040 4BF1 F8F9 F640 4040 '@=)=@@@@K±°·÷@@@'
00000210: F3F0 F040 4040 404B F1F5 F840 4040 40F4 '===@@@@K±)°@@@@('
00000220: F0F0 4040 4040 4BF1 F4F5 F840 4040 F5F0 '==@@@@K±()°@@@)='
00000230: F040 4040 404B F1F3 F5F4 4040 F1F0 F0F0 '=@@@@K±=)(@@±==='
00000240: 4040 4040 4BF1 F2F6 F440 D5D6 40C4 C1E3 '@@@@K±=÷(@++@--p'
00000250: C140 4040 4040 4040 4040 4040 4040 4040 '-@@@@@@@@@@@@@@@'

00000260: 4040 4040 C1E5 C1C9 D340 4040 4040 4040 '@@@@-s-++@@@@@@@'
00000270: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000280: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000290: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000002A0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000002B0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000002C0: 4040 4040 4040 D4C6 C740 D3F0 F9F1 F2F0 '@@@@@@+¦¦@+=·±=='
000002D0: F140 40E8 4040 4040 4040 4040 4040 4040 '±@@F@@@@@@@@@@@@'
000002E0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000002F0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000300: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000310: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000320: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000330: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000340: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000350: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000360: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000370: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000380: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
00000390: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000003A0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000003B0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000003C0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000003D0: 4040 4040 4040 4040 4040 4040 4040 4040 '@@@@@@@@@@@@@@@@'
000003E0: 4040 4040 4040 4040 '@@@@@@@@ '



No more messages
Back to top
View user's profile Send private message Send e-mail
rtgordon
PostPosted: Tue Jul 17, 2001 2:17 pm    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2001
Posts: 34
Location: Lewisville, TX

Although it says 1208, the original parameter 785 was changed to 1208 as part of our experimentation. During the program, we did a move 1208 to the encoding type variable before we did the put. So, what you are probably seeing is 785??? Because when I try and put a message with enc type 1208 it throws an unsupported encoding type on the mainframe.

gordon
Back to top
View user's profile Send private message Send e-mail
kolban
PostPosted: Tue Jul 17, 2001 5:00 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

Gordon, the error you are getting is a Java related error ... I did some digging. It would appear that you must add the i18n.jar file to your JVM CLASSPATH. This contains the missing class:

java.io.UnsupportedEncodingException: 437 [Could not load class: sun.io.CharToByteCp437]


What JVM release are you using? You should find i18n.jar in the lib directory of that JVM.

For those that like such things, i18n is internationalization - i-18 more characters n

Oy
Back to top
View user's profile Send private message
rtgordon
PostPosted: Wed Jul 18, 2001 5:18 am    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2001
Posts: 34
Location: Lewisville, TX

I added that to my classpath, and it still did not work. Remember, it works from the command line, but not through the web browser. How do I determine what JVM I am using? I am using the 1.2.2 JDK from Sun if that helps any.

Kolban, You are in Ft. Worth?? I work in North Ft. Worth (820@I-35)... Small world.

gordon


[ This Message was edited by: rtgordon on 2001-07-18 06:43 ]
Back to top
View user's profile Send private message Send e-mail
rtgordon
PostPosted: Wed Jul 18, 2001 7:22 am    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2001
Posts: 34
Location: Lewisville, TX

I got it! I guess that sun supports characterSet 437, but when run from IE 5 (which uses the Microsoft JVM), it doesn't support 437. I changed the Qmgr default to 819 (ISO 8859-1 / Latin / ibm819), and it works fine.

Now, are there any negative implications associated with changing from 437 to 819 (other than if any of the existing programs rely on this format)??

Thanks a bunch!
gordon




[ This Message was edited by: rtgordon on 2001-07-18 08:29 ]
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Charactersets and Encoding woes
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.