JDK-4288795 : Bad Magic Number exception using ResourceBundle class
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.2.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1999-11-08
  • Updated: 2000-02-08
  • Resolved: 2000-02-08
Related Reports
Duplicate :  

Name: dbT83986			Date: 11/07/99

java version "1.2.2"
Classic VM (build JDK-1.2.2-W, native threads, symcjit)
The problem, that occurs is already described in Bug Report #4191520, but the
bug still is not fixed correctly.
When I try to load a string from a resource class, using

ResourceBundle res = ResourceBundle.getBundle("search.Res");

in some occasions I get the following error:

java.lang.ClassFormatError: search/Res_en_US (Bad magic number)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:403)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:101)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:144)
at java.lang.ClassLoader.loadClass(ClassLoader.java:280)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:110)
at java.lang.ClassLoader.loadClass(ClassLoader.java:237)
at java.util.ResourceBundle.findBundle(Compiled Code)
at java.util.ResourceBundle.getBundle(Compiled Code)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:334)

The error occurs if the Web server used is an Internet Information Server
version 4 (version 3 seems to work right) and for the locale used there is no
corresponding Res_xxx class existing. E.g. the locale is en_US (as seen above),
but there's only a Res and a Res_de class existing.
Instead of trying to load Res_en_US, then Res_en and finally Res, the bad magic
number exception occurs.
In the Bug Report #4191520 some people noted, that the IIS 4 doesn't include
a "Connection:close" header in it's 404 (Not found) error, maybe this helps.

(Review ID: 97459) 

WORK AROUND Name: dbT83986 Date: 11/07/99 None ======================================================================

EVALUATION This is a duplicate of 4181520, and it has been fixed in Kestrel beta. I will close this bug as duplicate. stanley.ho@Eng 2000-02-07