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

NoClassDefFoundError in applet when extra classes are added

1 view
Skip to first unread message

Zyryab

unread,
Feb 28, 2006, 7:46:49 PM2/28/06
to
Hello, all.

I'm using NetBeans 4.1 on winXP to build my very first applet, and i
think I'm missing a very basic concept about the way applets are
deployed.

My applet was running fine in the browser until I added some Java
Imaging Utilities (JIU) classes to my project. Now, while the applet
still compiles and runs in the NetBeans environment, I can't get it to
run inside the browser.

I get the following errors in the java console:

Java Plug-in 1.5.0_06
Using JRE version 1.5.0_06 Java HotSpot(TM) Client VM
-------------------------
java.lang.NoClassDefFoundError: net/sourceforge/jiu/data/PixelImage
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(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)
Exception in thread "Thread-4" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletStatus(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-ImageViewer.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)
-------------------------

My main applet class is in a directory called "classes", and I've
placed the entire JIU directory tree in the same directory
(classes/net/sourceforge/jiu/...)

The code and a screenshot of the directory structure can be found at:
http://radiologycasefiles.com/code.html
Please be gentle. I know it's ugly and probably breaks a lot of
conventions and rules.

Any help would be greatly appreciated.

-Z

kly...@comcast.net

unread,
Feb 28, 2006, 9:03:32 PM2/28/06
to
You need to include the .jar file containing those classes as an
archive when you load the applet.

Zyryab

unread,
Feb 28, 2006, 9:46:52 PM2/28/06
to
D'oh. Thanks a million. This fixed everything.

<APPLET codebase="classes/" code="ImageViewer.class" archive="jiu.jar"
width=500 height=530></APPLET>

0 new messages