Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8146351

java.lang.NoClassDefFoundError: sun/nio/cs/ext/MS1256$Decoder JIS_X_0201$Decoder

XMLWordPrintable

      FULL PRODUCT VERSION :
      java version "1.8.0_66"
      Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux wunderkund 3.2.0-61-generic #92-Ubuntu SMP Mon Mar 31 23:47:59 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

      A DESCRIPTION OF THE PROBLEM :
      The following error was generated using JRE 8u65, activation.jar 1.1, and javax.mail 1.5.2.

      java.lang.NoClassDefFoundError: sun/nio/cs/ext/MS1256$Decoder
          at sun.nio.cs.ext.MS1256.newDecoder(MS1256.java:43) ~[na:na]
          at sun.nio.cs.StreamDecoder.<init>(StreamDecoder.java:232) ~[na:1.8.0_66]
          at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:69) ~[na:1.8.0_66]
          at java.io.InputStreamReader.<init>(InputStreamReader.java:100) ~[na:1.8.0_66]
          at com.sun.mail.handlers.text_plain.getContent(text_plain.java:107) ~[javax.mail-1.5.2.jar:1.5.2]
          at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:795) ~[na:1.8.0_66]
          at javax.activation.DataHandler.getContent(DataHandler.java:542) ~[na:1.8.0_66]
          at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:657) ~[javax.mail-1.5.2.jar:1.5.2]

      It appears that Java is looking for the classes MS1256$Decoder and JIS_X_0201$Decoder. I do see JIS_X_0201.class and MS1256.class inside the charsets.jar, by they don't appear to have a Decoder inner class.

      jre64/jre/lib/sun/nio/cs/ext# ls *JIS_X_0201*
      JIS_X_0201.class

      jre64/jre/lib/sun/nio/cs/ext# ls *MS1256*
      MS1256.class

      Note: There may be others charsets that observe the same behaviour. These are the ones we have come across.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
       create an InputStreamReader using JIS_X_0201 or MS1256

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      We do not expect to see a java.lang.NoClassDefFoundError. This is a critical error and in some cases can cause servers to due completely.
      ACTUAL -

      java.lang.NoClassDefFoundError: sun/nio/cs/ext/MS1256$Decoder
      java.lang.NoClassDefFoundError: sun/nio/cs/ext/JIS_X_0201$Decoder

      ERROR MESSAGES/STACK TRACES THAT OCCUR :

      java.lang.NoClassDefFoundError: sun/nio/cs/ext/MS1256$Decoder
          at sun.nio.cs.ext.MS1256.newDecoder(MS1256.java:43) ~[na:na]
          at sun.nio.cs.StreamDecoder.<init>(StreamDecoder.java:232) ~[na:1.8.0_66]
          at sun.nio.cs.StreamDecoder.forInputStreamReader(StreamDecoder.java:69) ~[na:1.8.0_66]
          at java.io.InputStreamReader.<init>(InputStreamReader.java:100) ~[na:1.8.0_66]
          at com.sun.mail.handlers.text_plain.getContent(text_plain.java:107) ~[javax.mail-1.5.2.jar:1.5.2]
          at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.java:795) ~[na:1.8.0_66]
          at javax.activation.DataHandler.getContent(DataHandler.java:542) ~[na:1.8.0_66]
          at javax.mail.internet.MimeBodyPart.getContent(MimeBodyPart.java:657) ~[javax.mail-1.5.2.jar:1.5.2]

      REPRODUCIBILITY :
      This bug can be reproduced always.

            psonal Pallavi Sonal (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: