Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bad Magic Number

3 views
Skip to first unread message

Martijn

unread,
Mar 17, 2000, 3:00:00 AM3/17/00
to
Hi,

I have the following problem.
I made a jar-file from JBuilder 3. And am using the Sun Java Plugin 1.2.2 to
view the applet inside in Netscape, IE5 and Opera.

Because i need to write to the local hard-drive, and i don't want those
warning banners to show up, i'm signing the applet, and distributing the
certificate to a client and use policytool.

Now, when the jar-file is not signed, it runs fine. (however crippled)
When it IS signed, i get an error message in both Netscape and IE5.
In Opera, it will sometimes run, but not always.

The error message in the Plugin console:

Opening http://MyIP/vision/docs/Trivia/Trivia.jar no proxy
CacheHandler file name: C:\Program
Files\Netscape\Users\me\cache\MU13GVMV.JAR
Opening http://myIP/vision/docs/Trivia/Trivia/Trivia.class no proxy

CacheHandler file name: C:\Program
Files\Netscape\Users\me\cache\MVF5IG0E.CLA
java.lang.ClassFormatError: Trivia/Trivia (Bad magic number)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at sun.plugin.security.PluginClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Does anyone know what's going on here. I have no idea what i'm looking at
here.
Again, it DOES work when the applet is NOT signed!
Can anyone please help me?

Frank Garber

unread,
Mar 17, 2000, 3:00:00 AM3/17/00
to Martijn
Martijn,

I believe the 'Magic Number' pertains to the first 4 bytes in the class file
which must be 0xCAFE. Could your class files have become corrupt? Is the
brower thinking it's downloading class files when it really download a jar file?

Frank

Juergen Kreileder

unread,
Mar 19, 2000, 3:00:00 AM3/19/00
to
>>>>> Frank Garber writes:

Frank> I believe the 'Magic Number' pertains to the first 4 bytes
Frank> in the class file which must be 0xCAFE. Could your class
Frank> files have become corrupt? Is the brower thinking it's
Frank> downloading class files when it really download a jar file?

0xcafe are only two bytes :-) The first four bytes have to be
0xcafebabe.


Juergen

--
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html

0 new messages