NoSuchMethodError - createCharMap

Discussion in 'Java' started by Tony Cooke, Feb 8, 2006.

  1. Tony Cooke

    Tony Cooke Guest

    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)
    Tony Cooke, Feb 8, 2006
    #1
    1. Advertising

  2. Tony Cooke

    viraj Guest

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

    Viraj
    viraj, Feb 8, 2006
    #2
    1. Advertising

  3. Tony Cooke

    Roedy Green Guest

    On Wed, 8 Feb 2006 13:41:22 +1030, "Tony Cooke" <>
    wrote, quoted or indirectly quoted someone who 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"
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Java custom programming, consulting and coaching.
    Roedy Green, Feb 8, 2006
    #3
  4. Tony Cooke

    Tony Cooke Guest

    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" <> wrote in
    message news:...
    > On Wed, 8 Feb 2006 13:41:22 +1030, "Tony Cooke" <>
    > wrote, quoted or indirectly quoted someone who 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"
    > --
    > Canadian Mind Products, Roedy Green.
    > http://mindprod.com Java custom programming, consulting and coaching.
    Tony Cooke, Feb 9, 2006
    #4
  5. Tony Cooke

    Tony Cooke Guest

    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.

    "viraj" <> wrote in message
    news:...
    > This might happen with conflicting classes in classpath.
    > Make sure, class is referenced only once without any conflicts.
    >
    > Viraj
    >
    Tony Cooke, Feb 9, 2006
    #5
  6. Tony Cooke

    Chris Uppal Guest

    Tony Cooke wrote:

    > 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
    Chris Uppal, Feb 9, 2006
    #6
  7. Tony Cooke

    Tony Cooke Guest

    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

    "Chris Uppal" <-THIS.org> wrote in message
    news:43eb35f4$0$1171$...
    > Tony Cooke wrote:
    >
    >> 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, Feb 10, 2006
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page