Troubleshooting
Problem
You are using a Linux system and you have installed the WebSphere MQ V7 Bridge for HTTP servlet in an application server. Then you run the HTTPPOST sample using English characters and it works fine. However, when you run it again and try to enter accented characters (áÁ-ñ-ü-¡!-¿?), you get an error:
Symptom
$ cd /opt/mqm/java/http/samples
$ java -classpath . HTTPPOST HTTPTESTQ hostname.x.com:9080 mq
HTTP POST Sample start
Target server is 'hostname.x.com:9080'
Target queue is 'HTTPTESTQ'
Target context-root is 'mq'
áÁ-ñ-ü-¡!-¿?
Failed to POST a message to http://hostname.x.com:9080/mq/msg/queue/HTTPTESTQ
sun.io.MalformedInputException
at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java(Compiled Code))
at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:287)
at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:337)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)
at java.io.InputStreamReader.read(InputStreamReader.java:208)
at java.io.BufferedReader.fill(BufferedReader.java:153)
at java.io.BufferedReader.readLine(BufferedReader.java:316)
at java.io.BufferedReader.readLine(BufferedReader.java:379)
at HTTPPOST.readLine(Unknown Source)
at HTTPPOST.sendMessagesFromConsole(Unknown Source)
at HTTPPOST.main(Unknown Source)
Cause
You are using Java™ 1.4.2 and the locale is: en_US.UTF-8:
$ java -version
java version "1.4.2"
$ locale
LANG=en_US.UTF-8
Resolving The Problem
This section offers a workaround and a permanent solution:
a) Workaround - you can keep Java 1.4.2, but you have to modify the locale as follows:
$ export LANG=en_US
$ locale
LANG=en_US
b) Permanent solution: you need to upgrade your Java from 1.4.2 to a most recent version, such as 1.6.
To download the IBM Java, visit:
http://www.ibm.com/developerworks/java/jdk/
IBM developer kits
+ Running the sample without exceptions
$ java -classpath . HTTPPOST HTTPTESTQ hostname.x.com:9080 mq
HTTP POST Sample start
Target server is 'hostname.x.com:9080'
Target queue is 'HTTPTESTQ'
Target context-root is 'mq'
áÁ-ñ-ü-¡!-¿?
HTTP POST Sample end
Product Synonym
IBMMQ WebSphere MQ WMQ
Was this topic helpful?
Document Information
Modified date:
15 June 2018
UID
swg21567375