Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.lang.NoClassDefFoundError

 
Teja Venkat
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Teja Venkat
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I changed the html file like that still i'm getting the same error NoClassDefFoundError: org/jfree/data/category/CategoryDataset
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42967
73
 
Teja Venkat
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved the Problem I included those jar files through Archivie in my HTML file and I got the required output
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic