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

JApplet and bad magic number error with netscape

0 views
Skip to first unread message

Cyril Boucher

unread,
Feb 24, 2000, 3:00:00 AM2/24/00
to
Hi,

I have an applet (a JApplet in fact) that uses some swing components
(swing 1.1) with Netscape 4.61 (same troubles with Netscape 4.7).
When I try to start the applet I get the following error message:

# Applet exception: error: java.lang.ClassFormatError: Bad magic number
java.lang.ClassFormatError: Bad magic number
at java.lang.ClassLoader.defineClass(Compiled Code)
........(see below for full message)

The strange thing is that it works if I shift reload the page or if I
use a file URL instead.
It's also fine with the appletviewer (jdk 1.1 or 1.2 with both http or
fileURL).
It seems to be ok with IE.

Am I doing something wrong?

-----applet source code
import javax.swing.*;


public class myJApplet extends JApplet
{
public void init(){
super.init();
JFrame jf = new JFrame("test frame");
jf .setVisible(true);
System.out.println("starting....");
}}

-----html source code
<html><body>
<applet code="myJApplet.class" ARCHIVE="swingall.jar" width=100
height=40></applet>
</body></html>

-----full error message
Netscape Communications Corporation -- Java 1.1.5
Type '?' for options.
Symantec Java! ByteCode Compiler Version 210.065
Copyright (C) 1996-97 Symantec Corporation
# 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 java.util.ResourceBundle.findBundle(Compiled Code)
at java.util.ResourceBundle.getBundle(Compiled Code)
at java.util.ResourceBundle.getBundle(Compiled Code)
at javax.swing.plaf.basic.BasicLookAndFeel.loadResourceBundle(Compiled
Code)
at
javax.swing.plaf.basic.BasicLookAndFeel.initComponentDefaults(Compiled
Code)
at
javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(Compiled
Code)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(Compiled Code)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(Compiled Code)
at javax.swing.UIManager.setLookAndFeel(Compiled Code)
at javax.swing.UIManager.setLookAndFeel(Compiled Code)
at javax.swing.UIManager.initializeDefaultLAF(Compiled Code)
at javax.swing.UIManager.initialize(Compiled Code)
at javax.swing.UIManager.maybeInitialize(Compiled Code)
at javax.swing.UIManager.getUI(Compiled Code)
at javax.swing.JPanel.updateUI(Compiled Code)
at javax.swing.JPanel.<init>(Compiled Code)
at javax.swing.JPanel.<init>(Compiled Code)
at javax.swing.JRootPane.createGlassPane(Compiled Code)
at javax.swing.JRootPane.<init>(Compiled Code)
at javax.swing.JApplet.createRootPane(Compiled Code)
* at javax.swing.JApplet.<init>(Compiled Code)
at myJApplet.<init>(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)

--
Castle Links Limited
2nd Floor Fox and Goose Inne
Parracombe - North Devon
EX31 4PE
United Kingdom
Tel: +44 (0)1598 763 267

0 new messages