R
Rhino
I'm having an odd problem in a JApplet and I need some help.
The applet, which is written using Java 1.5.0, works perfectly in the
Eclipse 3.1.1 AppletViewer. However, it gives me an odd error when I am
running in IE6 on Windows XP (SP2). This is the output from the Java console
in IE6:
==============================================================
Java Plug-in 1.5.0_06
Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Rhino
java.lang.NoClassDefFoundError:
com/foo/resume/ResumeConstants$EmploymentHistoryFormats
at com.foo.resume.ResumeConstants.<clinit>(ResumeConstants.java:245)
at com.foo.resume.ResumeApplet.init(ResumeApplet.java:105)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-com.foo.resume.ResumeApplet.class"
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
==============================================================
This is line 105 of ResumeApplet, it is the first non-comment line in the
method and the class implements an interface named ResumeConstants:
getContentPane().setBackground(BEHIND_TAB_COLOR);
The ResumeApplet implements an interface named ResumeConstants and
BEHIND_TAB_COLOR is one of the constants in the interface.
This is line 245 of ResumeConstants:
static final EmploymentHistoryFormats DESIRED_EMPLOYMENT_HISTORY_FORMAT
= EmploymentHistoryFormats.LIST_FORMAT;
It is preceeded by this line:
static enum EmploymentHistoryFormats {LIST_FORMAT, PARAGRAPH_FORMAT};
I'm trying to figure out why an enum that is clearly present in
ResumeConstants would cause a ClassDefNotFound error in IE6 but not in the
AppletViewer. ResumeConstants.class is definitely present in the jar that
contains the ResumeApplet.
If anyone could shed some light on this, I would be very grateful!
The only glimmer of insight I've got is that the enum can be defined static
but not final in the interface; if I try to make it static _and_ final, I
get tis message: Illegal modifier for the member enum
EmploymentHistoryFormats; only public, protected, private, static, abstract
are permitted. This affects line 244 which possibly impacts line 245 but I'm
darned if I can see exactly how; after all, I've removed the final again and
now the interface is clean as whistle. I am not ignoring a single compiler
condition at all: every condition is set to either Error or Warning.
So, what am I doing wrong and why doesn't it affect the AppletViewer?
--
Just for interest sake, I just tried the applet in Mozilla Firefox 1.0
Preview and Opera 7.5.4.
Opera gave me the exact same error as IE6.
Firefox drew a puzzle symbol in the applet area with the words "Click here
to download plugin". I clicked it but the Plugin Finder Service quickly
reported that "No suitable plugins were found." I can't recall if I tested
this applet in Firefox or Opera before; I thought I did but I can't recall
since it was a while back.
I'm not sure if that gives anyone any further insight into my problem. This
is very puzzling; the applet was working fine in IE6 for quite some time.
I've made some minor changes recently, including the addition of lines 244
and 245 of the ResumeConstants interface, so I assume they are culprits; I
just don't see why they are messing things up....
The applet, which is written using Java 1.5.0, works perfectly in the
Eclipse 3.1.1 AppletViewer. However, it gives me an odd error when I am
running in IE6 on Windows XP (SP2). This is the output from the Java console
in IE6:
==============================================================
Java Plug-in 1.5.0_06
Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Rhino
java.lang.NoClassDefFoundError:
com/foo/resume/ResumeConstants$EmploymentHistoryFormats
at com.foo.resume.ResumeConstants.<clinit>(ResumeConstants.java:245)
at com.foo.resume.ResumeApplet.init(ResumeApplet.java:105)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-com.foo.resume.ResumeApplet.class"
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
==============================================================
This is line 105 of ResumeApplet, it is the first non-comment line in the
method and the class implements an interface named ResumeConstants:
getContentPane().setBackground(BEHIND_TAB_COLOR);
The ResumeApplet implements an interface named ResumeConstants and
BEHIND_TAB_COLOR is one of the constants in the interface.
This is line 245 of ResumeConstants:
static final EmploymentHistoryFormats DESIRED_EMPLOYMENT_HISTORY_FORMAT
= EmploymentHistoryFormats.LIST_FORMAT;
It is preceeded by this line:
static enum EmploymentHistoryFormats {LIST_FORMAT, PARAGRAPH_FORMAT};
I'm trying to figure out why an enum that is clearly present in
ResumeConstants would cause a ClassDefNotFound error in IE6 but not in the
AppletViewer. ResumeConstants.class is definitely present in the jar that
contains the ResumeApplet.
If anyone could shed some light on this, I would be very grateful!
The only glimmer of insight I've got is that the enum can be defined static
but not final in the interface; if I try to make it static _and_ final, I
get tis message: Illegal modifier for the member enum
EmploymentHistoryFormats; only public, protected, private, static, abstract
are permitted. This affects line 244 which possibly impacts line 245 but I'm
darned if I can see exactly how; after all, I've removed the final again and
now the interface is clean as whistle. I am not ignoring a single compiler
condition at all: every condition is set to either Error or Warning.
So, what am I doing wrong and why doesn't it affect the AppletViewer?
--
Just for interest sake, I just tried the applet in Mozilla Firefox 1.0
Preview and Opera 7.5.4.
Opera gave me the exact same error as IE6.
Firefox drew a puzzle symbol in the applet area with the words "Click here
to download plugin". I clicked it but the Plugin Finder Service quickly
reported that "No suitable plugins were found." I can't recall if I tested
this applet in Firefox or Opera before; I thought I did but I can't recall
since it was a while back.
I'm not sure if that gives anyone any further insight into my problem. This
is very puzzling; the applet was working fine in IE6 for quite some time.
I've made some minor changes recently, including the addition of lines 244
and 245 of the ResumeConstants interface, so I assume they are culprits; I
just don't see why they are messing things up....