First off, good year to all!!!
Second, I need some help for you!
In my swt application i want run a
"org.eclipse.birt.report.viewer.utilities.WebViewer" BIRT plugin
This is my snippet:
public class TestWebBrowser {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
shell.setText("BIRT Example");
final Browser browser;
try {
browser = new Browser(shell, SWT.NONE);
} catch (SWTError e) {
System.out.println("Could not instantiate Browser: " +
e.getMessage());
return;
}
WebViewer.startup(browser);
try {
WebViewer.display("C:\\birt\\prova.rptdesign",
WebViewer.HTML, browser, "frameset");
} catch (Exception e) {
// logger.error(e);
e.printStackTrace();
}
shell.open(); while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
When I run this snippet i received this error:
Exception in thread "main" java.lang.NullPointerException
at
org.eclipse.birt.report.viewer.ViewerPlugin.getResourceString(ViewerPlugin.java:159)
at
org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedResourceString(ViewerPlugin.java:181)
at
org.eclipse.birt.report.viewer.utilities.WebappAccessor.getWebappPath(WebappAccessor.java:152)
at
org.eclipse.birt.report.viewer.utilities.WebappAccessor.start(WebappAccessor.java:68)
at
org.eclipse.birt.report.viewer.utilities.WebViewer.startWebApp(WebViewer.java:369)
at
org.eclipse.birt.report.viewer.utilities.WebViewer.startup(WebViewer.java:410)
at it.cedacosrl.test.TestWebBrowser.main(TestWebBrowser.java:28)
Now, the problem ( I suppose ) is in the "WebappAccessor" class
where the row: "Bundle bundle = Platform.getBundle( pluginId );"
try to load the resource bundle of
"org.eclipse.birt.report.viewer.utilities.WebViewer".
Obviously the problem is in the osgi, where there is not load the
necessary bundle.
Somebody can have a idea to give me?
Thanks in advance.
Stefano