Page 1 of 1

Problems showing TeeChart in an Eclipse View - solved

Posted: Mon Sep 13, 2010 12:33 pm
by 15350969
Hi,

I try to use TeeChart in an Eclipse Plug-In, but I get the following erros when opening the view:

java.lang.ClassNotFoundException: org.eclipse.swt.widgets.Composite
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:188)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:580)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:550)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:481)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:469)
at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at java.lang.ClassLoader.loadClass(Unknown Source)
at de.gfuhamburg.ippl.editor.views.TeeChartView.createPartControl(TeeChartView.java:24)
at org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:375)
at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:229)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.Perspective.showView(Perspective.java:2245)
at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1071)
at org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.java:3822)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3819)
at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3795)
at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:162)
at org.eclipse.ui.handlers.ShowViewHandler.openOther(ShowViewHandler.java:106)
at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:74)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.ShowViewMenu$3.run(ShowViewMenu.java:144)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
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.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

What I have done the following steps:

1) Created a plug-in project from existing jar file with "TeeChart.SWT.jar".

2) Added this plug-in as required plug in into the plugin.xml of my project.

3) Added another view to the org.eclipse.ui.views.

4) Here is the code for the view-class:

package de.gfuhamburg.ippl.editor.views;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
//import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;

import com.steema.teechart.TChart;
import com.steema.teechart.drawing.Color;
import com.steema.teechart.styles.Bar;
import com.steema.teechart.styles.Series;

public class TeeChartView extends ViewPart {

public TeeChartView() {
}

@Override
public void createPartControl(Composite parent) {
/*
Text text = new Text(parent, SWT.BORDER);
text.setText("Hello World");
*/
TChart tChart1 = new TChart(parent, SWT.BORDER);
Series bar = new Bar(tChart1.getChart());
tChart1.getAxes().getBottom().setIncrement(1);
bar.add(400, "pears", Color.GREEN);
bar.add(500, "apples", Color.RED);
bar.add(400, "bananas", Color.YELLOW);
bar.add(200, "oranges", Color.ORANGE);

// tChart1.setVisible(true);

}

@Override
public void setFocus() {
// TODO Auto-generated method stub

}

}

5) Running my plugin in Eclipse works fine, opening the new view results in the above message.

Any suggestions?

Thanks in advance

Steffen

Re: Problems showing TeeChart in an Eclipse View

Posted: Fri Sep 17, 2010 1:18 pm
by yeray
Hi Steffen,

Excuse us for the delay. We are investigating the issue and we'll be back to you asap.

Re: Problems showing TeeChart in an Eclipse View

Posted: Tue Sep 21, 2010 8:12 am
by 15350969
Here is the solution:

There was a missing dependencie for the plug-in. The right way:

1. Create a plug-in project from a JAR file (http://www.vogella.de/articles/EclipseJ ... ticle.html)
2. Go to the MANIFEST.MF - DEPENDENCIES and add org.eclipse.swt - the missing one!

After that you can use TeeChart in a View.

Thanks

Steffen

Re: Problems showing TeeChart in an Eclipse View - solved

Posted: Wed Sep 22, 2010 9:42 am
by yeray
Hi Steffen,

I'm glad to hear you've found it.
Thanks for telling it to us and for sharing the solution!