Author |
Message
|
atheek |
Posted: Mon Dec 03, 2007 12:30 am Post subject: Java Unsupported Encoding exception |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
Hi all,
I am using a MQ java program to read messages from a mainframe. The messages are in ebcdic format.:
MQMD Headers:
Encoding : 785 CodedCharSetId : 500
Format : 'MQIMS '
And I am using MQGMO_CONVERT option in the get call. Its throwing a java.io.UnsupportedEncoding exception : cp500.
I have raised the issue with the middleware team to turn on the channel conversion at mainframe side. But I am trying to figure out whether any other option is there.
I Know this is a java issue, but still want to know if such ebcdic-ascii conversion is possible in distributed systems. I have read from another thread its possible , including in the windows NT Platform ( My PF). But like to know any tweaks for gettin this done from java side and if anybody has already done so..My java version is jdk150_04
Regards,
Atheek |
|
Back to top |
|
 |
Gert-Jan |
Posted: Mon Dec 03, 2007 2:20 am Post subject: |
|
|
Newbie
Joined: 30 Sep 2004 Posts: 5 Location: The Netherlands
|
Do you have these jar files installed with your Java version?
charsets.jar
ext\localedata.jar |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Dec 03, 2007 8:31 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Did you download the US English or international release of the JDK or JRE?
I have found that the US English release of both the JDK or JRE are missing support for cp500 (and other code pages).
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
atheek |
Posted: Tue Dec 04, 2007 9:52 pm Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
thanks to all for the replies. I made it to work by using a different jdk.
I tried the same with a mq jms program. But I am not able to do the conversion. the application is picking the data in ebcdic format itself.
So my question is :
If I want to retrieve message in the format:
Format : MQIMS
CCSID : 500
Encoding : 785
will mq jms do the data conversion to qmgr ccsid and encoding?
I tried by even setting the ccsid and encoding in jndi..still not working
Any help will be highly appreciated!!
-Atheek |
|
Back to top |
|
 |
EddieA |
Posted: Wed Dec 05, 2007 9:07 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Is the MQIMS header like the CICS one, in that it can only be converted on the mainframe. In which case, you'll have to use the Channel Conversion.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
atheek |
Posted: Wed Dec 05, 2007 11:18 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
But the conversion worked on windows side with a mq java program..without even specifying a convert option! But not with a mqjms program!!! |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 05, 2007 4:44 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
atheek wrote: |
But the conversion worked on windows side with a mq java program..without even specifying a convert option! But not with a mqjms program!!! |
That might be because your java base program was written to ignore any extra header...
JMS won't do this and will give you an error message....
By the way what tool did you use to check the encoding value on the IMS header?? _________________ MQ & Broker admin |
|
Back to top |
|
 |
atheek |
Posted: Wed Dec 05, 2007 10:08 pm Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
Quote: |
That might be because your java base program was written to ignore any extra header... |
No, the java program even converted the IIH headers.!!
This IIH header specified the Format to be MQSTR. I read this value from the java output. But when tried with jms its just returning the byte array.
-Atheek |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Dec 06, 2007 4:52 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
atheek wrote: |
Quote: |
That might be because your java base program was written to ignore any extra header... |
No, the java program even converted the IIH headers.!!
This IIH header specified the Format to be MQSTR. I read this value from the java output. But when tried with jms its just returning the byte array.
-Atheek |
Encoding has nothing to do with the coded Char set Id (CCSID).
It determins whether your numbers are little or big endian...
Again what encoding is on the IMS header for the message? _________________ MQ & Broker admin |
|
Back to top |
|
 |
atheek |
Posted: Fri Dec 07, 2007 1:45 am Post subject: |
|
|
 Partisan
Joined: 01 Jun 2006 Posts: 327 Location: Sydney
|
Encoding in IMS Header was 785
CCSID in IMS Header was 0 |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 07, 2007 3:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
atheek wrote: |
Encoding in IMS Header was 785
CCSID in IMS Header was 0 |
Ok the encoding is fine. But JMS cannot render the message because a CCSID of 0 is only valid if the qmgr replaces it with it's own....
So you have to make sure that the CCSID of the IMS header acuratly describes the CCSID of the data that comes after it....
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|