NoClassDefFoundError

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Sam

NoClassDefFoundError

Post by Sam » Fri Jul 26, 2002 4:51 pm

I have created an Applet but I am not able to view it in a browser. It works fine with Applet Viewer. I create a jar file with all the .class files that are needed and also all the .class files are included in the directory with the browser page with their appropriate paths. The error I am getting is:

java.lang.NoClassDefFoundError

at com.jrefinery.chart.ChartFactory.createVerticalBarChart(ChartFactory.java:97)

at SwingApplet.setupGraph(SwingApplet.java:88)

at SwingApplet.init(SwingApplet.java:35)

at sun.applet.AppletPanel.run(AppletPanel.java:341)

at java.lang.Thread.run(Thread.java:536)


Can anyone help me out?

David Gilbert

Re: NoClassDefFoundError

Post by David Gilbert » Mon Jul 29, 2002 9:58 am

When it comes to applets, I'm not sure. I presume your browser supports Java 2 (required since JFreeChart makes use of the Java2D API).

Regards,

DG.

Jerry Cooper

Re: NoClassDefFoundError

Post by Jerry Cooper » Mon Jul 29, 2002 2:41 pm

I ran into the same problem using PieDatasets in an applet. The problem seems to be that the applet is looking for the JFreeChart classes in the JVM of the client browser.

To solve this I plaved the JFreeChart, and JCommon jars in the directory of the applet and included them in the archive property of the Applet HTML tag.

<APPLET CODE="" ARCHIVE="jcommon-0.6.4.jar,jfreechart-0.9.2.jar"></Applet>

I hope that helps.

Sam

Re: NoClassDefFoundError

Post by Sam » Mon Jul 29, 2002 7:17 pm

You are the man! That worked perfect. Thanks.

Locked