This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Problem in getting MQ message

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello people,

Facing a problem while getting a message with Japanese text in it. Would give you a brief background.
1. Application Server migrated from 9i (jdk 1.3) to 10g (jdk 1.5)
2. MQ server upgrade from 5 to 7.0.1

Using the below mentioned method to get the MQ message. The japanese characters are got correctly in 9i version but they give junk values in 10g. The CCSID for MQ server is 943 (Shift_JIS).

public String syncMQGet(String pstrGetQueueName, int pintWaitInterval, String pstrCorrelId) {
String strCorrelId = pstrCorrelId;
try {
connectGetQueue(pstrGetQueueName);
oGetMsgOpt = new MQGetMessageOptions();
oGetMsgOpt.options = MQC.MQGMO_FAIL_IF_QUIESCING | MQC.MQGMO_WAIT;
oGetMsgOpt.matchOptions = MQC.MQMO_MATCH_CORREL_ID;
oGetMsgOpt.waitInterval=pintWaitInterval*1000;
oGetMessage = new MQMessage();
oGetMessage.correlationId=strCorrelId.getBytes();;
oGetQueue.get(oGetMessage,oGetMsgOpt);
byte bResponse[] = new byte[oGetMessage.getDataLength()];
oGetMessage.readFully(bResponse);
str_Message = new String(bResponse); // also tried as str_Message = new String(bResponse,"Shift_JIS") without success
bResponse = null;
} catch(MQException m) {
if(m.reasonCode == 2033){
} else {
}
} catch(Exception e) {
}
return str_Message;
}

Please suggest. Have a sneaky feeling this has something to do with different jdk versions(I may be very wrong) but cannot pin point the issue.

Thanks.
 
Vins Ver
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guess not many are active so publishing this in General Java category too.

https://coderanch.com/t/483644/Java-General/java/getting-Junk-characters-Japanese-MQ

If anyone reads this.. please suggest.
 
Sheriff
Posts: 24654
58
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, probably you aren't getting an answer because Websphere configuration problems are extremely difficult to debug via forum messages. I will leave this post open, though. You never know, somebody may know something about that.

And by the way, I don't think your hunch about changing the Java version is right. You clearly have an encoding problem, so your remark about the CCSID is more likely to be the place to look.
 
Vins Ver
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Vins Ver wrote:Hello people,
Facing a problem while getting a message with Japanese text in it. Would give you a brief background.
1. Application Server migrated from 9i (jdk 1.3) to 10g (jdk 1.5)
2. MQ server upgrade from 5 to 7.0.1
3. AIX Server upgrade from Solaris 8 to Solaris 10.
Using the below mentioned method to get the MQ message. The japanese characters are got correctly in 9i version but they give junk values in 10g. The CCSID for MQ server is 943 (Shift_JIS).

Please suggest. Have a sneaky feeling this has something to do with different jdk versions(I may be very wrong) but cannot pin point the issue.

Thanks.


Also have tried quite a few charset values without success:

There is a difference in the junk characters being displayed with different charsets, thus may be it is a similar related issue. Any ideas?
 
I think I'll just lie down here for a second. And ponder this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!