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 » UnsupportedEncodingException cp437 - Fixed.

Post new topic  Reply to topic
 UnsupportedEncodingException cp437 - Fixed. « View previous topic :: View next topic » 
Author Message
damianharvey
PostPosted: Thu Mar 18, 2004 5:20 pm    Post subject: UnsupportedEncodingException cp437 - Fixed. Reply with quote

Acolyte

Joined: 05 Aug 2003
Posts: 59
Location: Sydney, Australia

A little tip for all those as stoopid as myself.

I have 2 machines : 1 is my laptop running XP with Java 1.4.2_04 and the other is a server running W2k also with Java 1.4.2_04.

I have some code which does a very basic GET from a Queue :

MQMessage mqmessage = new MQMessage();
MQGetMessageOptions mqgetmessageoptions = new MQGetMessageOptions();
m_queue.get(mqmessage, mqgetmessageoptions);
s = mqmessage.readString(mqmessage.getMessageLength());

On my laptop this runs fine. On the server I get :
java.io.UnsupportedEncodingException: Cp437 when it gets to the readString() method.

I tried adding i18n.jar and even rt.jar to the classpath to no avail. I tried changing the JVM (went from 1.4.1. to 1.4.2). It wasn't until a recalled that the MQClient libs were designed for Java 1.3 that I tried that. Installed the 1.3.1_10 JRE and started the class with the Java from that.

What do you know? It worked.

I still think it's odd that it worked with the same JVM on XP.
Back to top
View user's profile Send private message
EddieA
PostPosted: Fri Mar 19, 2004 7:00 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

What version of the MQ Java classes are you running.

I had a 'long' discussion with someone at Hursley about this a couple of years ago, and it turned out to be a JVM problem. I thought they did a 'work around' in a later version of MQ Java.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
damianharvey
PostPosted: Sun Mar 21, 2004 2:39 pm    Post subject: Reply with quote

Acolyte

Joined: 05 Aug 2003
Posts: 59
Location: Sydney, Australia

Whatever comes with MQ 5.3 - the DLL's have version 5.304.0.3269
Back to top
View user's profile Send private message
dnaren
PostPosted: Sat Mar 27, 2004 11:36 pm    Post subject: Reply with quote

Apprentice

Joined: 10 Aug 2001
Posts: 45
Location: Charlotte, NC

Wrong solution.. You shouldn't say "Fixed" in the title.

Going back to Java 1.3 is a not a solution to your problem. I used MQ Java classes that came with MA88 (for MQ 5.2) and MQ 5.3 with Java 1.4.* with no problems at all (on Windows 2000 and XP).

437 is the standard encoding supported by Windows. If you use MQ Explorer and "post a test message" to any queue, your message is encoded with 437.

your call
mqmessage.readString(mqmessage.getMessageLength()) is using the default/native encoding (which is 437 on Windows) of the queue manager to interpret the bytes and create a String.
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
damianharvey
PostPosted: Sun Mar 28, 2004 3:17 pm    Post subject: Reply with quote

Acolyte

Joined: 05 Aug 2003
Posts: 59
Location: Sydney, Australia

Ok, however if anyone has the same problem that I had, I can recomend going back to Java 1.3 to stop the problem occurring (if not fixing it??).
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 » UnsupportedEncodingException cp437 - Fixed.
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.