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

Can't display localized exception messages of the native method correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 1.3.1_13
    • 1.2.0, 1.2.2, 1.3.0, 1.3.1_11
    • hotspot
    • 13
    • x86, sparc
    • solaris_2.6, solaris_8, solaris_9, windows_2000
    • Verified

    Backports

      Description



        Name: krT82822 Date: 07/29/99


        On solaris 2.6, a strerror() function of C language is internationalized and returns messages in the native language. But the JDK 1.2.2 can't display many localized messages of native methods correctly. For example, JWS produces many bogus error messages related to the network codes in "ja" locale.

        In JDK 1.2 source code, many native methods use JNU_ThrowByName() (jni_util.c) function to throw exceptions and pass the localized message which strerror() returns. But it doesn't convert localized messages encoded in the platform default encoding to UTF-8 (ie. JNU_ThrowByNameWithLastError function convert by using JNU_NewStringPlatform()).

        For example, the following program can't display the localized message in "ja" locale ("connection refused" is displayed in "en" locale).

        import java.net.Socket;

        public class ExceptionTest {
            public static void main( String[] argv ) {
        try {
        Socket s = new Socket("localhost", 1000);
        } catch (Exception e) {
        e.printStackTrace();
        }
            }
        }

        -----------

        7/29/99 kevin.ryan@eng -- submitting as-is
        (Review ID: 88238)
        ======================================================================


        ###@###.### 2004-04-20

        BEA has run into this bug in jdk release 1.3.1_x.
        This is preventing BEA from squelching harmless exceptions
        in non english locales.


        BEA needs a fix in j2se 1.3.1_x release

        Attachments

          Issue Links

            Activity

              People

                poonam Poonam Bajaj Parhar
                kryansunw Kevin Ryan (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: