This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "NoClassDefFoundError" Watch "NoClassDefFoundError" New topic
Author

NoClassDefFoundError

Joybrata Chakraborty
Greenhorn

Joined: Nov 27, 2006
Posts: 29
Hi

I am getting one exception while try to start the Applet in any browser. Please help me.

basic: Exception: java.lang.NoClassDefFoundError: com/symantec/itools/javax/swing/models/StringTreeModel
java.lang.NoClassDefFoundError: com/symantec/itools/javax/swing/models/StringTreeModel


Here is java code.
import java.applet.Applet;
import com.symantec.itools.javax.swing.models.*;

public class MyApplet extends Applet {
public void init()
{
System.out.println("Hello");



String[] tempString = new String[22];
tempString[0] = "Order Service";
tempString[1] = " Frame Relay";
tempString[2] = " ATM";
tempString[3] = " Private Line";
tempString[4] = " IPL";
tempString[5] = " Local PL PME"; // 17107
tempString[6] = " Facility Order"; // 17107
tempString[7] = " Local PL "; // 17107
tempString[8] = " IP";
tempString[9] = " Rehome-IP";
tempString[10] = " IP Billing Migration";
tempString[11] = "Open Sales Order";
tempString[12] = "Profiles";
tempString[13] = " Customer";
tempString[14] = " User";
tempString[15] = " Location";
tempString[16] = "Inventory";
tempString[17] = "Reports";
tempString[18] = " Status & Tracking";
tempString[19] = " By Sales Order Name";
tempString[20] = " By Account";
tempString[21] = " Work Center Rejected Orders";
try
{
StringTreeModel stringTreeModel1 = new StringTreeModel();
stringTreeModel1.setItems(tempString);

System.out.print(stringTreeModel1.toString());
}
catch(Exception e)
{
System.out.print("haha");
e.printStackTrace();
}

}

}


What will be the correct html and setting(means class path). I tried all sort of combinations for those things. But failed.

I also found similar problems in the net but no solution was given. Please help....


Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41173
    
  45
The com directory hierarchy needs to be in the same directory where the applet code (and the HTML page) is. If it's in a jar file, then you need to add that jar file as part of an archive tag. See this page for details.
[ October 21, 2007: Message edited by: Ulf Dittmer ]

Ping & DNS - my free Android networking tools app
 
jQuery in Action, 2nd edition
 
subject: NoClassDefFoundError
 
Similar Threads
Applet working in appletviewer but no browser
Class compilation question
how can an applet read a file on the hard disk,when the applet is run in a browser?
Is Swing without plugin possible or not?
NoClassDefFoundError .. JButtonGroupPanel