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

What's a bad magic number????

3 views
Skip to first unread message

Keith Stacks

unread,
Aug 19, 1998, 3:00:00 AM8/19/98
to
I'm trying to run my applet and am receiving the following error:

# Applet exception: error: java.lang.ClassFormatError: Bad magic number
java.lang.ClassFormatError: Bad magic number
at java.lang.ClassLoader.defineClass(Compiled Code)
at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
at netscape.applet.AppletClassLoader.findClass(Compiled Code)
at netscape.applet.AppletClassLoader.loadClass1(Compiled Code)
* at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
at
netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
Code)
at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
Code)
at java.awt.EventDispatchThread.run(Compiled Code)
at
netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
Code)


Any suggestions??

Thanks

Keith Stacks


wavy...@my-dejanews.com

unread,
Aug 20, 1998, 3:00:00 AM8/20/98
to
In article <35DB022A...@xmission.com>,

This could mean one of two things:
1, The class file you specify is corrupted,
or, more likely,
2, You aren't specifying the class file and instead are specifying
the source file or something else by mistake.

The 'magic number' is an identifier at the start of a java .class
file that says 'yes, I really am a class file' (I think the value
is 0xCAFEBABE in hex :-). The class loader uses this to check you
specify a valid file.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum

Nathan Fiedler

unread,
Aug 20, 1998, 3:00:00 AM8/20/98
to
I believe a common cause for this problem is that you're uploading your class
files as text files instead of binary.

nathan


wavy...@my-dejanews.com wrote:
> Keith Stacks <kst...@xmission.com> wrote:
> > I'm trying to run my applet and am receiving the following error:
> >
> > # Applet exception: error: java.lang.ClassFormatError: Bad magic number
> > java.lang.ClassFormatError: Bad magic number
> > at java.lang.ClassLoader.defineClass(Compiled Code)
> > at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
> > at netscape.applet.AppletClassLoader.findClass(Compiled Code)
> > at netscape.applet.AppletClassLoader.loadClass1(Compiled Code)
> > * at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
> > at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
> > at
> > netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
> > Code)
> > at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
> > Code)
> > at java.awt.EventDispatchThread.run(Compiled Code)
> > at
> > netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
> > Code)
>

0 new messages