Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » NullPointerException when running com.ibm.examples.chart RCP application(BIRT API)
icon5.gif  NullPointerException when running com.ibm.examples.chart RCP application [message #544744] Mon, 05 July 2010 12:03 Go to next message
No real name is currently offline No real nameFriend
Messages: 13
Registered: June 2010
Junior Member
Hello everyone,

I am trying to use the BIRT API, and am having the following problem:


!SESSION 2010-07-05 13:40:20.882 -----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_20
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
Framework arguments: -application com.ibm.examples.chart.application
Command-line arguments: -application com.ibm.examples.chart.application -data C:\somedir\workspaces\BirtHelios/../runtime-com.ibm.examples .chart.application -dev file:C:/somedir/workspaces/BirtHelios/.metadata/.plugins/org .eclipse.pde.core/com.ibm.examples.chart.application/dev.pro perties -os win32 -ws win32 -arch x86 -consoleLog

!ENTRY org.eclipse.ui 4 0 2010-07-05 13:40:29.162
!MESSAGE Unable to create editor ID com.ibm.examples.chart.editors.SampleEditor: An unexpected exception was thrown.
!STACK 0
java.lang.NullPointerException
at org.eclipse.birt.chart.device.swt.SwtTextMetrics.getHeight(S wtTextMetrics.java:178)
at org.eclipse.birt.chart.computation.Methods.computeFontHeight (Methods.java:1247)
at org.eclipse.birt.chart.computation.BIRTChartComputation.comp uteFontHeight(BIRTChartComputation.java:30)
at org.eclipse.birt.chart.computation.EllipsisHelper$SimpleTest er. <init>(EllipsisHelper.java:213)
at org.eclipse.birt.chart.computation.EllipsisHelper.createSimp leTester(EllipsisHelper.java:176)
at org.eclipse.birt.chart.computation.EllipsisHelper.simpleInst ance(EllipsisHelper.java:183)
at org.eclipse.birt.chart.computation.LabelLimiter.limitLabelSi ze(LabelLimiter.java:256)
at org.eclipse.birt.chart.computation.LabelLimiter.limitLabelSi ze(LabelLimiter.java:211)
at org.eclipse.birt.chart.model.layout.impl.TitleBlockImpl.comp uteBox(TitleBlockImpl.java:112)
at org.eclipse.birt.chart.model.layout.impl.LabelBlockImpl.getP referredSize(LabelBlockImpl.java:266)
at org.eclipse.birt.chart.internal.layout.LayoutManager$ChartLa yout. <init>(LayoutManager.java:111)
at org.eclipse.birt.chart.internal.layout.LayoutManager.doLayou t_tmp(LayoutManager.java:1145)
at org.eclipse.birt.chart.internal.layout.LayoutManager.doLayou t(LayoutManager.java:1310)
at org.eclipse.birt.chart.factory.Generator.build(Generator.jav a:1092)
at com.ibm.examples.chart.widget.ChartCanvas.buildChart(ChartCa nvas.java:127)
at com.ibm.examples.chart.widget.ChartCanvas.access$1(ChartCanv as.java:120)
at com.ibm.examples.chart.widget.ChartCanvas$2.controlResized(C hartCanvas.java:111)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe ner.java:228)
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.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
at org.eclipse.swt.widgets.Control.WM_SIZE(Control.java:4813)
at org.eclipse.swt.widgets.Scrollable.WM_SIZE(Scrollable.java:2 91)
at org.eclipse.swt.widgets.Composite.WM_SIZE(Composite.java:165 3)
at org.eclipse.swt.widgets.Canvas.WM_SIZE(Canvas.java:454)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4234 )
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873 )
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454 )
at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable .java:80)
at org.eclipse.swt.widgets.Control.WM_WINDOWPOSCHANGED(Control. java:4970)
at org.eclipse.swt.widgets.Canvas.WM_WINDOWPOSCHANGED(Canvas.ja va:460)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4244 )
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873 )
at org.eclipse.swt.internal.win32.OS.SetWindowPos(Native Method)
at org.eclipse.swt.widgets.Widget.SetWindowPos(Widget.java:1456 )
at org.eclipse.swt.widgets.Control.setBounds(Control.java:2816)
at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1 018)
at org.eclipse.swt.widgets.Control.setBounds(Control.java:2777)
at org.eclipse.swt.widgets.Control.setSize(Control.java:3291)
at com.ibm.examples.chart.editors.SampleEditor.createPartContro l(SampleEditor.java:138)
at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi torReference.java:670)
at org.eclipse.ui.internal.EditorReference.createPart(EditorRef erence.java:465)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb enchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:31 3)
at org.eclipse.ui.internal.presentations.PresentablePart.setVis ible(PresentablePart.java:180)
at org.eclipse.ui.internal.presentations.util.PresentablePartFo lder.select(PresentablePartFolder.java:270)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd er.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresen tation.selectPart(TabbedStackPresentation.java:473)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelecti on(PartStack.java:1254)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1207)
at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 06)
at org.eclipse.ui.internal.PartStack.add(PartStack.java:497)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
at org.eclipse.ui.internal.PartStack.add(PartStack.java:483)
at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
at org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor SashContainer.java:63)
at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA reaHelper.java:225)
at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre aHelper.java:213)
at org.eclipse.ui.internal.EditorManager.createEditorTab(Editor Manager.java:778)
at org.eclipse.ui.internal.EditorManager.openEditorFromDescript or(EditorManager.java:677)
at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag er.java:638)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched( WorkbenchPage.java:2860)
at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben chPage.java:2768)
at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag e.java:2760)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2711)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2707)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2691)
at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa ge.java:2674)
at com.ibm.examples.chart.actions.SampleAction.run(SampleAction .java:55)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEven t(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.ja va:4066)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
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(Work bench.java:663)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at com.ibm.examples.chart.Application.run(Application.java:30)
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.internal.app.EclipseAppContainer.callMet hodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:198)
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(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.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)


I am using BIRT 2.6, Eclipse 3.6, am running Windows XP and have installed the following birt features (only!) BIRT Advanced XML Editor Plug-in, BIRT Chart Framework, and Business Intelligence and Reporting Tools.

I am trying to run com.ibm.examples.chart (downloaded from http://www.eclipse.org/articles/Article-BIRTChartEngine/com. ibm.examples.chart.zip). The Exception is thrown (for example) when selecting "Bar Chart" from the Sample menu.

Any insights?

Is it because Eclipse 3.6 is too new for the example? If so, is there a more current example which shows how to use the BIRT API in Eclipse 3.6? The "Simple Chart API Examples" bullet on http://wiki.eclipse.org/Integration_Examples_%28BIRT%29 seems suspiciously non-clickable...

Thanks!

Karin
Re: NullPointerException when running com.ibm.examples.chart RCP application [message #545048 is a reply to message #544744] Tue, 06 July 2010 14:09 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Karin,

As a test can you download the allinone BIRT download and then import
the projects from this
download:http://www.birt-exchange.org/org/devshare/deploying -birt-reports/1187-eclipsecon-2010-birt-metal-ppt/

There are three rcp examples that use the 1) BIRT API, 2) Chart API, 3)
BIRT Viewer in rcp applications.

Jason


On 7/5/2010 8:03 AM, karins.spam@gmail.com wrote:
> Hello everyone,
>
> I am trying to use the BIRT API, and am having the following problem:
>
>
> !SESSION 2010-07-05 13:40:20.882
> -----------------------------------------------
> eclipse.buildId=unknown
> java.version=1.6.0_20
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE
> Framework arguments: -application com.ibm.examples.chart.application
> Command-line arguments: -application com.ibm.examples.chart.application
> -data C:\somedir\workspaces\BirtHelios/../runtime-com.ibm.examples
> .chart.application -dev
> file:C:/somedir/workspaces/BirtHelios/.metadata/.plugins/org
> .eclipse.pde.core/com.ibm.examples.chart.application/dev.pro perties -os
> win32 -ws win32 -arch x86 -consoleLog
>
> !ENTRY org.eclipse.ui 4 0 2010-07-05 13:40:29.162
> !MESSAGE Unable to create editor ID
> com.ibm.examples.chart.editors.SampleEditor: An unexpected exception was
> thrown.
> !STACK 0
> java.lang.NullPointerException
> at org.eclipse.birt.chart.device.swt.SwtTextMetrics.getHeight(S
> wtTextMetrics.java:178)
> at org.eclipse.birt.chart.computation.Methods.computeFontHeight
> (Methods.java:1247)
> at org.eclipse.birt.chart.computation.BIRTChartComputation.comp
> uteFontHeight(BIRTChartComputation.java:30)
> at org.eclipse.birt.chart.computation.EllipsisHelper$SimpleTest er.
> <init>(EllipsisHelper.java:213)
> at org.eclipse.birt.chart.computation.EllipsisHelper.createSimp
> leTester(EllipsisHelper.java:176)
> at org.eclipse.birt.chart.computation.EllipsisHelper.simpleInst
> ance(EllipsisHelper.java:183)
> at org.eclipse.birt.chart.computation.LabelLimiter.limitLabelSi
> ze(LabelLimiter.java:256)
> at org.eclipse.birt.chart.computation.LabelLimiter.limitLabelSi
> ze(LabelLimiter.java:211)
> at org.eclipse.birt.chart.model.layout.impl.TitleBlockImpl.comp
> uteBox(TitleBlockImpl.java:112)
> at org.eclipse.birt.chart.model.layout.impl.LabelBlockImpl.getP
> referredSize(LabelBlockImpl.java:266)
> at org.eclipse.birt.chart.internal.layout.LayoutManager$ChartLa yout.
> <init>(LayoutManager.java:111)
> at org.eclipse.birt.chart.internal.layout.LayoutManager.doLayou
> t_tmp(LayoutManager.java:1145)
> at org.eclipse.birt.chart.internal.layout.LayoutManager.doLayou
> t(LayoutManager.java:1310)
> at org.eclipse.birt.chart.factory.Generator.build(Generator.jav a:1092)
> at com.ibm.examples.chart.widget.ChartCanvas.buildChart(ChartCa
> nvas.java:127)
> at com.ibm.examples.chart.widget.ChartCanvas.access$1(ChartCanv
> as.java:120)
> at com.ibm.examples.chart.widget.ChartCanvas$2.controlResized(C
> hartCanvas.java:111)
> at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListe
> ner.java:228)
> 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.Widget.sendEvent(Widget.java:1077)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
> at org.eclipse.swt.widgets.Control.WM_SIZE(Control.java:4813)
> at org.eclipse.swt.widgets.Scrollable.WM_SIZE(Scrollable.java:2 91)
> at org.eclipse.swt.widgets.Composite.WM_SIZE(Composite.java:165 3)
> at org.eclipse.swt.widgets.Canvas.WM_SIZE(Canvas.java:454)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:4234 )
> at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873 )
> at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
> at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2454 )
> at org.eclipse.swt.widgets.Scrollable.callWindowProc(Scrollable .java:80)
> at org.eclipse.swt.widgets.Control.WM_WINDOWPOSCHANGED(Control. java:4970)
> at org.eclipse.swt.widgets.Canvas.WM_WINDOWPOSCHANGED(Canvas.ja va:460)
> at org.eclipse.swt.widgets.Control.windowProc(Control.java:4244 )
> at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
> at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873 )
> at org.eclipse.swt.internal.win32.OS.SetWindowPos(Native Method)
> at org.eclipse.swt.widgets.Widget.SetWindowPos(Widget.java:1456 )
> at org.eclipse.swt.widgets.Control.setBounds(Control.java:2816)
> at org.eclipse.swt.widgets.Composite.setBounds(Composite.java:1 018)
> at org.eclipse.swt.widgets.Control.setBounds(Control.java:2777)
> at org.eclipse.swt.widgets.Control.setSize(Control.java:3291)
> at com.ibm.examples.chart.editors.SampleEditor.createPartContro
> l(SampleEditor.java:138)
> at org.eclipse.ui.internal.EditorReference.createPartHelper(Edi
> torReference.java:670)
> at org.eclipse.ui.internal.EditorReference.createPart(EditorRef
> erence.java:465)
> at org.eclipse.ui.internal.WorkbenchPartReference.getPart(Workb
> enchPartReference.java:595)
> at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:31 3)
> at org.eclipse.ui.internal.presentations.PresentablePart.setVis
> ible(PresentablePart.java:180)
> at org.eclipse.ui.internal.presentations.util.PresentablePartFo
> lder.select(PresentablePartFolder.java:270)
> at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrd
> er.select(LeftToRightTabOrder.java:65)
> at org.eclipse.ui.internal.presentations.util.TabbedStackPresen
> tation.selectPart(TabbedStackPresentation.java:473)
> at org.eclipse.ui.internal.PartStack.refreshPresentationSelecti
> on(PartStack.java:1254)
> at org.eclipse.ui.internal.PartStack.setSelection(PartStack.jav a:1207)
> at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:16 06)
> at org.eclipse.ui.internal.PartStack.add(PartStack.java:497)
> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103 )
> at org.eclipse.ui.internal.PartStack.add(PartStack.java:483)
> at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112 )
> at org.eclipse.ui.internal.EditorSashContainer.addEditor(Editor
> SashContainer.java:63)
> at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorA
> reaHelper.java:225)
> at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAre
> aHelper.java:213)
> at org.eclipse.ui.internal.EditorManager.createEditorTab(Editor
> Manager.java:778)
> at org.eclipse.ui.internal.EditorManager.openEditorFromDescript
> or(EditorManager.java:677)
> at org.eclipse.ui.internal.EditorManager.openEditor(EditorManag
> er.java:638)
> at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(
> WorkbenchPage.java:2860)
> at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(Workben
> chPage.java:2768)
> at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPag
> e.java:2760)
> at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.j ava:2711)
> at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:70)
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
> ge.java:2707)
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
> ge.java:2691)
> at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPa
> ge.java:2674)
> at com.ibm.examples.chart.actions.SampleAction.run(SampleAction .java:55)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
> at org.eclipse.jface.action.ActionContributionItem.handleWidget
> Selection(ActionContributionItem.java:584)
> at org.eclipse.jface.action.ActionContributionItem.access$2(Act
> ionContributionItem.java:501)
> at org.eclipse.jface.action.ActionContributionItem$5.handleEven
> t(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.ja va:4066)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3657)
> at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2629)
> at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)
> at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:24 27)
> 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(Work
> bench.java:663)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
> at com.ibm.examples.chart.Application.run(Application.java:30)
> 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.internal.app.EclipseAppContainer.callMet
> hodWithException(EclipseAppContainer.java:587)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips
> eAppHandle.java:198)
> 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(EclipseS
> tarter.java:369)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.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)
>
> I am using BIRT 2.6, Eclipse 3.6, am running Windows XP and have
> installed the following birt features (only!) BIRT Advanced XML Editor
> Plug-in, BIRT Chart Framework, and Business Intelligence and Reporting
> Tools.
> I am trying to run com.ibm.examples.chart (downloaded from
> http://www.eclipse.org/articles/Article-BIRTChartEngine/com. ibm.examples.chart.zip).
> The Exception is thrown (for example) when selecting "Bar Chart" from
> the Sample menu.
>
> Any insights?
>
> Is it because Eclipse 3.6 is too new for the example? If so, is there a
> more current example which shows how to use the BIRT API in Eclipse 3.6?
> The "Simple Chart API Examples" bullet on
> http://wiki.eclipse.org/Integration_Examples_%28BIRT%29 seems
> suspiciously non-clickable...
>
> Thanks!
>
> Karin
>
Re: NullPointerException when running com.ibm.examples.chart RCP application [message #557779 is a reply to message #544744] Wed, 08 September 2010 21:32 Go to previous message
Dinne Bosman is currently offline Dinne BosmanFriend
Messages: 1
Registered: September 2010
Junior Member
Karin,

I have just managed to get the (modified) ibm example you mentioned working in eclipse 3.6.

The problem in the ibm example is that a SWT GC reference in the SWT renderer is NULL.

I added the following to ChartCanvas:

            
public void paintControl(PaintEvent e) {

                Composite co = (Composite) e.getSource();
                final Rectangle rect = co.getClientArea();

                // Add this....
                render.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, e.gc);
                // ....

                if (cachedImage == null) {
                    buildChart();
                    drawToCachedImage(rect);
                }


And:

            
            public void controlResized(ControlEvent e) {
// add this....
            	render.setProperty(IDeviceRenderer.GRAPHICS_CONTEXT, new GC(ChartCanvas.this));
// .....
                buildChart();



regards,
Dinne
Previous Topic:java.sql.SQLException: Unknown character set index for field '1075' received from server.
Next Topic:customized report by windows folder files
Goto Forum:
  


Current Time: Fri Nov 28 01:54:36 GMT 2014

Powered by FUDForum. Page generated in 0.02038 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software