-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta
-
generic
-
generic
-
Verified
Tested with Merlin build 1.4.0-beta-b46 on Japanese Solaris7 and 8 Sparc, Solaris8 X86 and Windows2000.
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b46)
Java HotSpot(TM) Client VM (build 1.4beta-B45, mixed mode)
URLClassLoader.loadClass can not handle the classes in which japanese characters are used for class name or variable name.
The exception below is throws;
(* I describe "XXXX" in 1st line of Exception in place of japanese Kanji characters for avoiding a trouble in notification mail)
Exception in thread "main" java.lang.ClassFormatError: XXXX (Bad magic number)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:494)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:110)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:303)
at java.lang.ClassLoader.loadClass(ClassLoader.java:259)
at URLClassLoaderTest.run(URLClassLoaderTest.java:71)
at URLClassLoaderTest.main(URLClassLoaderTest.java:18)
This is not seen Merlin build 1.4.0-beta-b44.
To reproduce,
1. Compile URLClassLoaderTest.java
(On solaris, please specify "-encoding SJIS" option)
2. Excute URLClassLoaderTes specifying tesing URL for its argument like below;
java URLClassLoaderTest http://javasoft.japan/~tokunaga/test/URLtestsite/
3. You can see the results;
English classes can loaded without error.
ClassFormatError occurs in loading japanese class.
I attach the programs for reproducing this bug;
URLClassLoaderTest.java
Test.class
Status.class
I also attach the programs for the japanese classes located at the testing URL, http://javasoft.japan/~tokunaga/test/URLtestsite/;
ClassForLoad.tar
======================================================================
The URL described in steps to reproduce above is not suitable for all platforms.
URLClassLoader seemes to need class files which are compiled with the same encoding as client machine and which are named in the same encoding.
The class files on the URL above are euc encoding.
So for example, if the steps above are excuted on Windows Japanese, the japanese class files can not be recognized and ClassNotFoundException occurs.
Therefore, I prepared new testing URLs for both of EUC and SJIS/PCK.
For Windows/Solairis PCK: http://javasoft.japan/~tokunaga/test/URLClassLoaderTest_sjis/
For Solaris EUC : http://javasoft.japan/~tokunaga/test/URLClassLoaderTest_euc/
Sorry for confusion.
miki.tokunaga@japan 2001-01-29
======================================================================
This is reproducible with b55.
Which build is this bug fix integrated into?
b55 or b56?
miki.tokunaga@japan 2001-03-12
-------------------------------------------------------
The fix has been integrated into the master workspace
and will be in the next promoted build, which is b56.
michael.mcmahon@ireland 2001-03-12
-------------------------------------------------------
The fix is verified with merlin-beta b56.
miki.tokunaga@japan 2001-03-21
-------------------------------------------------------
- duplicates
-
JDK-4424332 ImageIcon with URL can't handle directries or iamge files named in Japanese
- Closed