NoSuchMethodError - createCharMap

T

Tony Cooke

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)
 
V

viraj

This might happen with conflicting classes in classpath.
Make sure, class is referenced only once without any conflicts.

Viraj
 
R

Roedy Green

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"
 
T

Tony Cooke

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

Roedy Green said:
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"
 
T

Tony Cooke

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.
 
C

Chris Uppal

Tony said:
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
 
T

Tony Cooke

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top