java.lang.NoClassDefFoundError in eclipse RCP
-
- Posts: 4
- Joined: Tue Mar 20, 2007 9:52 am
java.lang.NoClassDefFoundError in eclipse RCP
Hi,
I'm hoping someone can help me. I am testing the use of JFreeChart for use in an eclipseRCP app, but kept getting NoClassDefFound errors in the View I was trying to render it in; even though running as a standalone bean the code worked fine.
To remove our target platform from being a concern I have built a brand new stand alone UI plugin (used the wizard to auto-generate the standard example, single view plugin) but get the same result.
I have tried referencing the JAR files (all those in the lib dir of jfreechart and combinations, even tried replacing the jcommon that comes with the jfreechart download with that in the stand alone jcommon download) directly on the build path in eclipse, as jar files in a plugin set as a dependency and as an exploded plugin as a dependent plugin.
All of these methods allow compilation in the IDE and all allow the View to run as a stand alone bean, but all result in NoClassDefFoundError.
Any ideas?
Matt.
I'm hoping someone can help me. I am testing the use of JFreeChart for use in an eclipseRCP app, but kept getting NoClassDefFound errors in the View I was trying to render it in; even though running as a standalone bean the code worked fine.
To remove our target platform from being a concern I have built a brand new stand alone UI plugin (used the wizard to auto-generate the standard example, single view plugin) but get the same result.
I have tried referencing the JAR files (all those in the lib dir of jfreechart and combinations, even tried replacing the jcommon that comes with the jfreechart download with that in the stand alone jcommon download) directly on the build path in eclipse, as jar files in a plugin set as a dependency and as an exploded plugin as a dependent plugin.
All of these methods allow compilation in the IDE and all allow the View to run as a stand alone bean, but all result in NoClassDefFoundError.
Any ideas?
Matt.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: java.lang.NoClassDefFoundError in eclipse RCP
None at all. But if you post the stack trace from the exception, someone familiar with Eclipse RCP might be able to spot the problem.matthew.bain wrote:Any ideas?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 4
- Joined: Tue Mar 20, 2007 9:52 am
Stack Trace & View Code
Stack Trace
java.lang.NoClassDefFoundError: org/eclipse/swt/events/SelectionListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:160)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:498)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:468)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:427)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:334)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:37)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:383)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at jfreecharttest.View.createPartControl(View.java:32)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:332)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:197)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:290)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:525)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:394)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1144)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1097)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1311)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:601)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:532)
at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:562)
at org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:244)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:815)
at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:2436)
at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindow.java:2616)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:2597)
at org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.java:658)
at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:795)
at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1437)
at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1388)
at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:190)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:708)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at jfreecharttest.Application.run(Application.java:18)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
View Code
java.lang.NoClassDefFoundError: org/eclipse/swt/events/SelectionListener
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:160)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:498)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:468)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:427)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:334)
at org.eclipse.osgi.framework.internal.core.SingleSourcePackage.loadClass(SingleSourcePackage.java:37)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:383)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:347)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at jfreecharttest.View.createPartControl(View.java:32)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:332)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:197)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:290)
at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:525)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:394)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1144)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1097)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1311)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:601)
at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:532)
at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:562)
at org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:244)
at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:815)
at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:2436)
at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindow.java:2616)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:2597)
at org.eclipse.ui.internal.WorkbenchWindow.busyOpenPage(WorkbenchWindow.java:658)
at org.eclipse.ui.internal.Workbench.busyOpenWorkbenchWindow(Workbench.java:795)
at org.eclipse.ui.internal.Workbench.doOpenFirstTimeWindow(Workbench.java:1437)
at org.eclipse.ui.internal.Workbench.openFirstTimeWindow(Workbench.java:1388)
at org.eclipse.ui.internal.WorkbenchConfigurer.openFirstTimeWindow(WorkbenchConfigurer.java:190)
at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:708)
at org.eclipse.ui.internal.Workbench.init(Workbench.java:1085)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1847)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at jfreecharttest.Application.run(Application.java:18)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
View Code
Code: Select all
package jfreecharttest;
import java.awt.Color;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.experimental.chart.swt.ChartComposite;
public class View extends ViewPart {
public static final String ID = "JFreeChartTest.view";
private TableViewer viewer;
/**
* This is a callback that will allow us to create the viewer and initialize
* it.
*/
public void createPartControl(Composite parent) {
JFreeChart chart = createChart(createDataset());
final ChartComposite frame = new ChartComposite(parent, SWT.NONE, chart,
true);
frame.pack();
}
/**
* Passing the focus request to the viewer's control.
*/
public void setFocus() {
viewer.getControl().setFocus();
}
/**
* Returns a sample dataset.
*
* @return The dataset.
*/
private static CategoryDataset createDataset() {
// row keys...
String series1 = "First";
String series2 = "Second";
String series3 = "Third";
// column keys...
String category1 = "Category 1";
String category2 = "Category 2";
String category3 = "Category 3";
String category4 = "Category 4";
String category5 = "Category 5";
// create the dataset...
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(1.0, series1, category1);
dataset.addValue(4.0, series1, category2);
dataset.addValue(3.0, series1, category3);
dataset.addValue(5.0, series1, category4);
dataset.addValue(5.0, series1, category5);
dataset.addValue(5.0, series2, category1);
dataset.addValue(7.0, series2, category2);
dataset.addValue(6.0, series2, category3);
dataset.addValue(8.0, series2, category4);
dataset.addValue(4.0, series2, category5);
dataset.addValue(4.0, series3, category1);
dataset.addValue(3.0, series3, category2);
dataset.addValue(2.0, series3, category3);
dataset.addValue(3.0, series3, category4);
dataset.addValue(6.0, series3, category5);
return dataset;
}
/**
* Creates a sample chart.
*
* @param dataset the dataset.
*
* @return The chart.
*/
private static JFreeChart createChart(CategoryDataset dataset) {
// create the chart...
JFreeChart chart = ChartFactory.createBarChart(
"Bar Chart Demo", // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips?
false // URLs?
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
// set the background color for the chart...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.white);
// set the range axis to display integers only...
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// disable bar outlines...
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(
CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 6.0)
);
// OPTIONAL CUSTOMISATION COMPLETED.
return chart;
}
}
Re: java.lang.NoClassDefFoundError in eclipse RCP
Are you sure that the Jfreechart-jar is added to the plugin.xml ?matthew.bain wrote: Any ideas?
I (vaguely) remember a simular error, and this was solved after i added jfreechart to the plugin.xml.
HTH,
- scar -
-
- Posts: 4
- Joined: Tue Mar 20, 2007 9:52 am
I've used nearly the same code in a small RCP-application (just 1 PDE-project, no dependencies on other non-eclipse plugins) for testing purposes.
Here's my code and configuration:
Configuration: the jars (jcommon, jfreechart, jfreechart-swt and jfreechart-experimental) are in the application-classpath [plugin.xml: tab runtime, section classpath] (and in the project buildpath ofcourse).
Running the RCP-application with this configuration is fine, no errors.
When I remove the jars from the application-classpath I get a NoClassDefFoundError like you did:
HTH,
-scar
Here's my code and configuration:
Code: Select all
package chartdemo.barchart;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.jfree.chart.JFreeChart;
import org.jfree.experimental.chart.swt.ChartComposite;
public class BarChartView extends ViewPart {
public static final String ID = "ChartDemo.barchart";
public BarChartView() {
}
/**
* This is a callback that will allow us to create the viewer and
* initialize it.
*/
@Override
public void createPartControl(Composite parent) {
createAndShowBarChart(parent);
}
/**
* Passing the focus request to the viewer's control.
*/
@Override
public void setFocus() {
}
private void createAndShowBarChart(Composite parent) {
JFreeChart chart = BarChart.createChart();
ChartComposite frame = new ChartComposite(parent, SWT.NONE, chart, true);
frame.pack();
}
}
Code: Select all
package chartdemo.barchart;
import java.awt.Color;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.data.category.CategoryDataset;
import org.jfree.data.category.DefaultCategoryDataset;
public class BarChart {
/**
* Returns a sample dataset.
*
* @return The dataset.
*/
private static CategoryDataset createDataset() {
// row keys...
String series1 = "First";
String series2 = "Second";
String series3 = "Third";
// column keys...
String category1 = "Category 1";
String category2 = "Category 2";
String category3 = "Category 3";
String category4 = "Category 4";
String category5 = "Category 5";
// create the dataset...
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(1.0, series1, category1);
dataset.addValue(4.0, series1, category2);
dataset.addValue(3.0, series1, category3);
dataset.addValue(5.0, series1, category4);
dataset.addValue(5.0, series1, category5);
dataset.addValue(5.0, series2, category1);
dataset.addValue(7.0, series2, category2);
dataset.addValue(6.0, series2, category3);
dataset.addValue(8.0, series2, category4);
dataset.addValue(4.0, series2, category5);
dataset.addValue(4.0, series3, category1);
dataset.addValue(3.0, series3, category2);
dataset.addValue(2.0, series3, category3);
dataset.addValue(3.0, series3, category4);
dataset.addValue(6.0, series3, category5);
return dataset;
}
/**
* Creates a sample chart.
*
* @param dataset
* the dataset.
*
* @return The chart.
*/
public static JFreeChart createChart() {
CategoryDataset dataset = createDataset();
// create the chart...
JFreeChart chart = ChartFactory.createBarChart("Bar Chart Demo", // title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips
false // URLs
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
// set the background color for the chart...
chart.setBackgroundPaint(Color.white);
// get a reference to the plot for further customisation...
CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.white);
// set the range axis to display integers only...
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// disable bar outlines...
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setCategoryLabelPositions(CategoryLabelPositions
.createUpRotationLabelPositions(Math.PI / 6.0));
// OPTIONAL CUSTOMISATION COMPLETED.
return chart;
}
}
Running the RCP-application with this configuration is fine, no errors.
When I remove the jars from the application-classpath I get a NoClassDefFoundError like you did:
Code: Select all
java.lang.NoClassDefFoundError: org/jfree/data/category/CategoryDataset
at chartdemo.barchart.BarChartView.createAndShowBarChart(BarChartView.java:36)
at chartdemo.barchart.BarChartView.createPartControl(BarChartView.java:24)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:332)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:197)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:566)
at org.eclipse.ui.internal.Perspective.showView(Perspective.java:1675)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:987)
at org.eclipse.ui.internal.WorkbenchPage.access$13(WorkbenchPage.java:968)
at org.eclipse.ui.internal.WorkbenchPage$13.run(WorkbenchPage.java:3514)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3511)
at chartdemo.barchart.OpenBarChartViewAction.run(OpenBarChartViewAction.java:32)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:499)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at chartdemo.Application.run(Application.java:18)
at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336)
at org.eclipse.core.launcher.Main.basicRun(Main.java:280)
at org.eclipse.core.launcher.Main.run(Main.java:977)
at org.eclipse.core.launcher.Main.main(Main.java:952)
HTH,
-scar
I was faced with the same problem, and tried the methods above, but all didn't work out.matthew.bain wrote:It's not in the plugin itself, it is in a plugin that this one is dependent on, although I have tried it with them directly in this plugin as well with the same result.
BUT, finally i found a rather stupid way to solve it,
THAT IS, import all the source code of JFreeChart into workspace(JFreeChart, JCommon, experimental....), and then run it again.
All DONE!
P.R.China, now working with the Grid Project(http://www.crown.org.cn/en/).
-
- Posts: 59
- Joined: Fri Oct 13, 2006 11:35 am
- Contact:
java.lang.NoClassDefFoundError
Hi all,
I'm also trying to run a RCP application using the jfreechart package, though I am facing similar problems like those from above. If I add all the jars in the runtime tab classpath under Eclipse I get the following java.lang.NoClassDefFoundError:
java.lang.NoClassDefFoundError: javax.swing.event.EventListenerList
at org.jfree.data.general.AbstractDataset.<init>(AbstractDataset.java:94)
at org.jfree.data.general.DefaultPieDataset.<init>(DefaultPieDataset.java:84)
at jfreechart.test.View.createDataset(View.java:34)
at jfreechart.test.View.createPartControl(View.java:18)
...
...
...
when trying to initialize the DataSet:
DefaultPieDataset dataset = new DefaultPieDataset();
Although in that case the error code refers to the javax.swing.event.EventListenerList class, I still think that the jfree jars are causing the problems.
I'd really appreciate any help, thanks in advance!
I'm also trying to run a RCP application using the jfreechart package, though I am facing similar problems like those from above. If I add all the jars in the runtime tab classpath under Eclipse I get the following java.lang.NoClassDefFoundError:
java.lang.NoClassDefFoundError: javax.swing.event.EventListenerList
at org.jfree.data.general.AbstractDataset.<init>(AbstractDataset.java:94)
at org.jfree.data.general.DefaultPieDataset.<init>(DefaultPieDataset.java:84)
at jfreechart.test.View.createDataset(View.java:34)
at jfreechart.test.View.createPartControl(View.java:18)
...
...
...
when trying to initialize the DataSet:
DefaultPieDataset dataset = new DefaultPieDataset();
Although in that case the error code refers to the javax.swing.event.EventListenerList class, I still think that the jfree jars are causing the problems.
I'd really appreciate any help, thanks in advance!
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
I don't really know what is happening here, but usually (in my experience) NoClassDefFoundErrors that make no sense are a result of having multiple versions of a jar file on the classpath.
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


Re: java.lang.NoClassDefFoundError in eclipse RCP
The chart is looking for the PaintListener class, so you need to add 'org.eclipse.swt' as a dependency in your plugin for JFreechart.
Ashwati Sadanandan
Ashwati Sadanandan