Hi all.
I have the following exception and for the life of me I don't know what's
going on.
I believe I have included all the relevent jars in the classpath but I still
get the error.
Basically I get a message from WebSphereMQ on a Windows box where the
message originated from an iSeries box (in EBCIDIC format). I believe it
converts it to unicode but the character mapping fails. I just don't know
why.
Any help would be appreciated.
All the best,
Tony
Exception in thread "Thread-0" java.lang.NoSuchMethodError:
sun.io.ByteToCharSingleByte.createCharMap(Ljava/lang/String;Z)[C
at sun.io.ByteToCharCp037.<clinit>(ByteToCharCp037.java:85)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at sun.io.Converters.getConverterClass(Unknown Source)
at sun.io.Converters.newConverter(Unknown Source)
at sun.io.ByteToCharConverter.getConverter(Unknown Source)
at sun.nio.cs.StreamDecoder$ConverterSD.<init>(Unknown Source)
at sun.nio.cs.StreamDecoder$ConverterSD.<init>(Unknown Source)
at sun.nio.cs.StreamDecoder.forInputStreamReader(Unknown Source)
at java.io.InputStreamReader.<init>(Unknown Source)
at com.ibm.mq.MQMessage.readConvertedString(MQMessage.java:2061)
at com.ibm.mq.MQMessage.readStringOfCharLength(MQMessage.java:632)
at com.elders.sca.commands.MQServerCommand.execute(MQServerCommand.java:52)
at com.elders.sca.commands.CommandImpl.perform(CommandImpl.java:33)
at com.elders.sca.control.EventHandler.handle(EventHandler.java:132)
at com.elders.sca.control.Mediator.post(Mediator.java:111)
at com.elders.sca.control.Mediator.start(Mediator.java:149)
at com.elders.sca.business.BusinessFunction.run(BusinessFunction.java:51)
at java.lang.Thread.run(Unknown Source)
This might happen with conflicting classes in classpath.
Make sure, class is referenced only once without any conflicts.
Viraj
Tony Cooke - 09 Feb 2006 05:13 GMT
I believe the classes are correct and are only being referenced once.
The thing is it's an issue within the sun.io package. Thats why I don't
understand it.
> This might happen with conflicting classes in classpath.
> Make sure, class is referenced only once without any conflicts.
>
> Viraj
>sun.io.ByteToCharSingleByte.createCharMap(Ljava/lang/String;Z)[C
> at sun.io.ByteToCharCp037.<clinit>(ByteToCharCp037.java:85)
one hint. that encoding has a new official name "IBM037"

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
Tony Cooke - 09 Feb 2006 05:11 GMT
Hi Roedy.
I checked up and you are right. It now has the encoding IBM037 but it also
has the old encoding too, so it still should work.
All the best,
Tony
>>sun.io.ByteToCharSingleByte.createCharMap(Ljava/lang/String;Z)[C
>> at sun.io.ByteToCharCp037.<clinit>(ByteToCharCp037.java:85)
>
> one hint. that encoding has a new official name "IBM037"
> I have the following exception and for the life of me I don't know what's
> going on.
> at sun.io.ByteToCharCp037.<clinit>(ByteToCharCp037.java:85)
It may be worth noting that in a Sun 1.4.2 JRE the sun.io.ByteToCharCp037 does
not have any static initialisation ("<cinit>") at all, and in a Sun 1.5.0 JRE
there is a class initialiser but it does not call
sun.io.ByteToCharSingleByte.createCharMap(). Nor, come to that, does the
source for that class have a line 85.
Similarly, on either Sun platform, the class sun.io.ByteToCharSingleByte does
exist, but it does not have a method createCharMap().
So, I suggest that you either have a buggy non-Sun platform, or that you are
mixing code from two different platforms. E.g. using a definition of
sun.io.ByteToCharCp037 (which is normally in charsets.jar for a Sun JVM), which
intended to execute on some non-Sun platform on a Sun-supplied (or Sun-alike)
JVM. How you are doing this, /if/ you are doing it, I don't know . Classpath
screwup ? Classloader tangle ? Illegitimate copying of platform classfiles ?
-- chris
Tony Cooke - 10 Feb 2006 00:40 GMT
Hi Chris.
In actual fact it turned out to be a problem with the JRE I had loaded.
JRE 1.5.0_04 had these faults but upgrading to JRE 1.5.0_06 fix them.
Weird but there must have been an issue with the 04 version that was fixed.
Thanks for your help.
All the best,
Tony
>> I have the following exception and for the life of me I don't know what's
>> going on.
[quoted text clipped - 26 lines]
>
> -- chris