[jdom-interest] Applets and JDOM again - Help.

J Graham jkgraham at plasmic360.com
Wed Mar 14 18:09:10 PST 2001


I've read through all of the jdom-interest archives and have tried the few
solutions provided, but none seem to work.  My small snippet of code works
as an application, but gives the following error when run
using appletviewer:

java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
        at GameStatsLive.start(GameStatsLive.java:26)
        at sun.applet.AppletPanel.run(AppletPanel.java:358)
        at java.lang.Thread.run(Thread.java:484)

Below is the code.  Simply comment out the "Applet Version" lines and
un-comment the "Stand alone version" lines to see it work fine as an
application.  Any help would be greatly appreciated!

Thanks much!
-Jonathan Graham



import java.net.*;
import java.io.*;
import org.jdom.*;
import org.jdom.input.*;

import java.applet.Applet;	// Applet Version

public class GameStatsLive extends Applet {  // Applet Version
//public class GameStatsLive	 {		   // Stand alone version

 public void start()  {					// Applet Version
 //public static void main ( String args[] )  {	// Stand alone version

   URL statsURL;

   try {
     statsURL = new URL("http://www.plasmic360.com/gamestats.xml");
   } catch (MalformedURLException e) {
     System.out.println("MalformedURL: " + e.getMessage());


     SAXBuilder builder = new SAXBuilder();
     Document doc = builder.build(statsURL);
     Element rootelm = doc.getRootElement();
     String vscore = rootelm.getChild("score")

     System.out.println("Visitor: " + vscore);

   } catch (Exception e)

     System.out.println("Caught Exception: " + e.getMessage());

More information about the jdom-interest mailing list