• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

java.lang.NoClassDefFoundError

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here you go: http://tomcat.apache.org/tomcat-7.0-doc/config/valve.html#Access_Log_Valve
 
Teja Venkat
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Joel Salatin has signs on his property that say "Trespassers will be Impressed!" Impressive tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic