Bad Magic Number

Questions? Suggestions? Need help? Talk about anything related to Yawcam...
Post Reply
bckucharik

Bad Magic Number

Post by bckucharik »

ok... i'm new at this and even searched the boards for this one...

I get an error when trying to load the my cam stream on a web server...

I copied this from another post
<APPLET CODE=YawApplet.class CODEBASE="_Address_to_computer_where_you_run_Yawcam_:8081" WIDTH="320" HEIGHT="240">
<param name="Host" value="_Address_to_computer_where_you_run_Yawcam_">
<param name="Port" value="8081">
</APPLET>
and placed it in my html, but the error i get is:

Exception: java.lang.ClassFormatError: YawwApplet (Bad magic number)

what does this mean and what can a I do?
malun
Site Admin
Posts: 1590
Joined: Sun Jan 04, 2004 1:29 pm

Post by malun »

I had to search for this one... I couldn't recall that I had written this error message, and I hadn't ;)
This is an error message that java generates when the class is corrupt or not completely downloaded.

Look at this answer I borrowed from the java forums:
The "bad magic number" indicates that the .class file is either corrupt or your server is sending some other data stream than the class format. The first bytes of a class file should be the magic number CA FE BA BE in hexadecimal.

Applets can be loaded from any HTML source as long as the applet .class, .jar or .cab file is correctly reurned to the browser.

Chuck
(http://forum.java.sun.com/thread.jspa?t ... eID=877285)

This means that your YawApplet.class file probably is not complete or that there occurs some transmission errors.
The first thing to do now, is to replace the .class file and see if this does the trick. Either reinstall Yawcam or just download the applet from here:
http://www.yawcam.com/newapplet/YawApplet.class

The .class file should be located in yawcam's stream directory (i.e. c:\program files\yawcam\stream)

Good Luck!
/malun
Post Reply