Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Integrate ChartWizardLauncher in Java application
Integrate ChartWizardLauncher in Java application [message #1109297] Sun, 15 September 2013 06:41 Go to next message
Savitha Sundaramoorthi is currently offline Savitha SundaramoorthiFriend
Messages: 18
Registered: November 2012
Junior Member
Hi All,

I'm trying to integrate chartwizard in a standalone java application. I referred to chartwizard launcher example. But I don't want to run in standalone mode as I have extended my own chart. Following errors are thrown when I run in OSGI mode.

Exception in thread "main" java.lang.NullPointerException
at org.eclipse.birt.chart.ui.util.UIHelper.getURL(UIHelper.java:99)
at org.eclipse.birt.chart.ui.util.UIHelper.createImage(UIHelper.java:137)
at org.eclipse.birt.chart.ui.util.UIHelper.getImage(UIHelper.java:180)
at org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.<init>(ChartWizard.java:111)
at org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.<init>(ChartWizard.java:94)
at view.timeView.ChartWizardLauncher.launch(ChartWizardLauncher.java:249)
at view.timeView.ChartWizardLauncher.main(ChartWizardLauncher.java:344)

Kindly help me out.

Thanks,
Savitha
Re: Integrate ChartWizardLauncher in Java application [message #1111827 is a reply to message #1109297] Wed, 18 September 2013 19:54 Go to previous messageGo to next message
Savitha Sundaramoorthi is currently offline Savitha SundaramoorthiFriend
Messages: 18
Registered: November 2012
Junior Member
Hi ,

Can anybody point to some resources on how to run chartbuilder example in OSGI mode? Looks like ChartUIPlugin is not initialized and in turn throws the following exception.

Exception in thread "main" java.lang.NullPointerException
at org.eclipse.birt.chart.ui.util.UIHelper.getURL(UIHelper.java:99)
at org.eclipse.birt.chart.ui.util.UIHelper.createImage(UIHelper.java:137)
at org.eclipse.birt.chart.ui.util.UIHelper.getImage(UIHelper.java:180)
at org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.<init>(ChartWizard.java:111)
at org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.<init>(ChartWizard.java:94)
at view.timeView.ChartWizardLauncher.launch(ChartWizardLauncher.java:249)
at view.timeView.ChartWizardLauncher.main(ChartWizardLauncher.java:344)

Am not able to figure out solution for this. Kindly help me out.

Thanks,
Savitha
Re: Integrate ChartWizardLauncher in Java application [message #1111882 is a reply to message #1111827] Wed, 18 September 2013 21:40 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

Have you looked in the source? I believe there is an example of using the chart builder. Let me know.

Michael

Developer Evangelist, Silanis
Re: Integrate ChartWizardLauncher in Java application [message #1111951 is a reply to message #1111882] Thu, 19 September 2013 00:13 Go to previous messageGo to next message
Savitha Sundaramoorthi is currently offline Savitha SundaramoorthiFriend
Messages: 18
Registered: November 2012
Junior Member
Hi Michael,

I referred the ChartWizardLauncher example. It is working fine if I set up in "standalone mode".
But my java application is using extended chart plugins. So, I tried running in OSGI mode . It throws the above mentioned error. When I tried to debug, it looks like ChartUIPlugin.getDefault() in org.eclipse.birt.chart.ui is returning null. I'm not understanding why the ChartUIPlugin isn't getting initialised. I included the chart plugins and birt runtime plugins in my classpath.

Would be great if you could help me out.
Re: Integrate ChartWizardLauncher in Java application [message #1115128 is a reply to message #1109297] Mon, 23 September 2013 17:56 Go to previous message
Savitha Sundaramoorthi is currently offline Savitha SundaramoorthiFriend
Messages: 18
Registered: November 2012
Junior Member
Hi Michael,

I'm working on a java project where I need to integrate BIRT chart with simulator to plot TimeSeries graphs.
So, I did the following:

1) Developed TimeView plugin by extending BIRT to generate Time Series graphs. I used POJO runtime for this by adding BIRT runtime and TimeView plugins to the classpath. It works fine.
2) Wanted to integrate the chart wizard launcher for customising the TimeSeries plots. I found a simple example which works fine in standalone mode. But when I try to run the chartwizardlauncher in OSGI or POJO runtime, it throws the following errors:

at org.eclipse.birt.chart.ui.util.UIHelper.getURL(UIHelper.java:99)
at org.eclipse.birt.chart.ui.util.UIHelper.createImage(UIHelper.java:137)
at org.eclipse.birt.chart.ui.util.UIHelper.getImage(UIHelper.java:180)
at org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.<init>(ChartWizard.java:111)
at org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.<init>(ChartWizard.java:94)
at ChartWizardLauncher.launch(ChartWizardLauncher.java:287)
at ChartWizardLauncher.main(ChartWizardLauncher.java:396)

I went through the source code to find the source of the problem. It throws error in the following code snippet in org.eclipse.birt.chart.ui.UIHelper.

public static URL getURL( String sPluginRelativePath )
	{
		URL url = null;
		if ( isEclipseMode( ) )
		{
			try
			{
				url = new URL( ChartUIPlugin.getDefault( )
						.getBundle( )
						.getEntry( "/" ), sPluginRelativePath ); //$NON-NLS-1$
			}
			catch ( MalformedURLException e )
			{
				logger.log( e );
			}
		}
		else
		{
			url = UIHelper.class.getResource(  "/" + sPluginRelativePath ); //$NON-NLS-1$
			if ( url == null )
			{
				try

				{
					url = new URL( "file:///" + new File( sPluginRelativePath ).getAbsolutePath( ) ); //$NON-NLS-1$
				}
				catch ( MalformedURLException e )
				{
					logger.log( e );
				}
			}
			

		}
		

		return url;
	}


1) When I run in POJO runtime, it is in eclipse mode and tries to load the ChartUIbundle bundle and throws null pointer exception.

2) So, I tried running in OSGi mode by setting BIRT home and including both the chart and runtime plugins in the plugins folder. But still it couldn't load the ChartUI bundle.

Am not sure, what am missing here. Or the chartwizard launcher can run only in standalone mode outside RCP environment?

Should I include any other plugins apart from chart and runtime plugins in the report engine plugin folder?

It would be great if you could clarify my doubts . If you have IRC channel for BIRT to clarify the doubts, kindly let me know.

Thanks,
Savitha

[Updated on: Tue, 24 September 2013 23:19]

Report message to a moderator

Previous Topic:Code Cache Full
Next Topic:Cannot create a Dynamic Report Parameter (greyed out)
Goto Forum:
  


Current Time: Thu Apr 18 16:16:20 GMT 2024

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

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

Back to the top