Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2006

Tip: Looking for answers? Try searching our database.

NoSuchMethodError - createCharMap

Thread view: 
Tony Cooke - 08 Feb 2006 03:11 GMT
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)
viraj - 08 Feb 2006 07:32 GMT
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
Roedy Green - 08 Feb 2006 07:46 GMT
>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"
Chris Uppal - 09 Feb 2006 12:30 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.