wood burning stoves 2.0*
The moose likes Applets and the fly likes java.lang.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 "java.lang.NoClassDefFoundError" Watch "java.lang.NoClassDefFoundError" New topic
Author

java.lang.NoClassDefFoundError

Teja Venkat
Greenhorn

Joined: Oct 30, 2012
Posts: 27
Hi every one... I'm trying to run a Web Application on Tomcat server
I've compiled the class files of Applet and Servlet properly and Placed the class file of Servlet in WEB-INF/classes folder and also written web.xml file for servlet mapping
Also written html file for Applet inorder to view it in browser... in WEB-INF/lib folder i copied all the required jar files... The applet imports JFreeChart so while compiling it I set the classpath for JFreeChart and JCommon... now while running it on Tomcat server I am getting the following error :

java.lang.NoClassDefFoundError : org/jfree/data/category/CategoryDataset

Please help me with this
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Applets can't access classes inside of WEB-INF; you'll need to put the JCommon and JFreeChart jar files in a public directory as well, where the applet can get at it. Then use the applet tag's archive attribute to point to the jar files.


Ping & DNS - my free Android networking tools app
Teja Venkat
Greenhorn

Joined: Oct 30, 2012
Posts: 27
Ulf Dittmer wrote:Applets can't access classes inside of WEB-INF; you'll need to put the JCommon and JFreeChart jar files in a public directory as well, where the applet can get at it. Then use the applet tag's archive attribute to point to the jar files.


Couldn't understand what you are saying... where shall I keep the jar files?
Teja Venkat
Greenhorn

Joined: Oct 30, 2012
Posts: 27


I changed the html file like that still i'm getting the same error NoClassDefFoundError: org/jfree/data/category/CategoryDataset
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Check the Java Console for other error messages; it may be that some of the files can't be accessed. Also check the server access logs to make sure those jar files are accessed and served properly.

Why are you including gnujaxp.jar and servlet.jar? What does the applet need those for?
Teja Venkat
Greenhorn

Joined: Oct 30, 2012
Posts: 27
Ulf Dittmer wrote:Check the Java Console for other error messages; it may be that some of the files can't be accessed. Why are you including gnujaxp.jar and servlet.jar? What does the applet need those for?


I included them by mistake... I removed them now...

Where can I find Java Console??

Is it ok with my archive statement in the applet code i.e., specifying path for jar files
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
The Java Console can be started from the Java Control Panel. Don't forget this part: "Also check the server access logs to make sure those jar files are accessed and served properly. "
Teja Venkat
Greenhorn

Joined: Oct 30, 2012
Posts: 27
Ulf Dittmer wrote:The Java Console can be started from the Java Control Panel. Don't forget this part: "Also check the server access logs to make sure those jar files are accessed and served properly. "


Java Console is not being shown even though I changed settings in My contraol panel

Where were the server access logs present?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Depends on the server. Tomcat keeps them in TOMCAT_HOME/logs, but you need to turn them on in server.xml.

Keep looking for how to turn on the Java Console; it's indispensible for applet development.
Teja Venkat
Greenhorn

Joined: Oct 30, 2012
Posts: 27
Ulf Dittmer wrote:Depends on the server. Tomcat keeps them in TOMCAT_HOME/logs, but you need to turn them on in server.xml.


Couldn't find the Server logs and also Java Console
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Are you using Tomcat? If so, have you turned them on like I said?

You need to do more than say "couldn't do this, didn't find that" - it's your problem, we can only try to help, but you need to solve it.
Teja Venkat
Greenhorn

Joined: Oct 30, 2012
Posts: 27
Ulf Dittmer wrote:Are you using Tomcat? If so, have you turned them on like I said?

You need to do more than say "couldn't do this, didn't find that" - it's your problem, we can only try to help, but you need to solve it.


Sorry for my reply... I just stuck with this from 2days..

I am using Tomcat

can you please explain me this "turn them on"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41137
    
  45
Here you go: http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve
Teja Venkat
Greenhorn

Joined: Oct 30, 2012
Posts: 27
I solved the Problem I included those jar files through Archivie in my HTML file and I got the required output
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.lang.NoClassDefFoundError
 
Similar Threads
NoClassDefFoundError
Applet notinted error when imbedded in servlet html output
Applet in J2EE application
iReport in Struts action
Weblogic