JDK-4258198 : Can't display localized exception messages of the native method correctly
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.2.0,1.2.2,1.3.0,1.3.1_11
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS:
    solaris_2.6,solaris_8,solaris_9,windows_2000 solaris_2.6,solaris_8,solaris_9,windows_2000
  • CPU: x86,sparc
  • Submitted: 1999-07-29
  • Updated: 2009-06-25
  • Resolved: 2002-04-29
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other Other Other
1.3.1_13 13Fixed 1.4.0_02Fixed 1.4.1Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
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

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: 1.3.1_13 1.4.0_02 generic hopper FIXED IN: 1.3.1_13 1.4.0_02 hopper INTEGRATED IN: 1.3.1_13 1.4.0_02 hopper VERIFIED IN: 1.3.1_13
28-08-2004

EVALUATION We could add a new JNU_ThrowByNameWithMessage to take native platform string as error message, but leave the current one intact. ###@###.### 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. ###@###.### 2001-10-25
25-10-2001