Integrate ChartWizardLauncher in Java application [message #1109297] |
Sun, 15 September 2013 02:41  |
Eclipse User |
|
|
|
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 #1115128 is a reply to message #1109297] |
Mon, 23 September 2013 13:56  |
Eclipse User |
|
|
|
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 19:19] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05446 seconds