Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4258198
Votes 9
Synopsis Can't display localized exception messages of the native method correctly
Category java:runtime
Reported Against 1.2 , 1.3 , 1.2.2 , 1.3.1_11
Release Fixed 1.3.1_13
State 10-Fix Delivered, Verified, bug
Priority: 4-Low
Related Bugs 4216927 , 4631430 , 4745013
Submit Date 29-JUL-1999
Description




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  xxxxx@xxxxx  -- submitting as-is
(Review ID: 88238) 
======================================================================


 xxxxx@xxxxx  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
Work Around
N/A
Evaluation
We could add a new JNU_ThrowByNameWithMessage to take native platform string as error message, but leave the current one intact.

 xxxxx@xxxxx  1999-08-10

This bug has been closed as "Will Not Fix" due to a strategic
redirection of resources to Java 1.4. If bug needs to be fixed
in an old release then an escalation will need to be filed. At
that time the JPSE will take this bug over. Bugs which
are escalations from external customers will continue to be
addressed by the support team.  Internal customers may escalate
bugs by filing them as priority 1 (P1) bugs.


 xxxxx@xxxxx  2001-10-25

Comments
  
  Include a link with my name & email   

Submitted On 21-DEC-2001
atsushi071
It is better to fix this. Because UTF-8 encoding is not popular, and most people use EUC_J 
encoding in Japan, and they can not read the message.
To workaround: 
Use UTF-8 encoding instead of EUC_J
LANG=ja_JP.UTF-8



PLEASE NOTE: JDK6 is formerly known as Project Mustang