Skip to main content



      Home
Home » Archived » BIRT » org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application
org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application [message #264267] Thu, 10 January 2008 03:42 Go to next message
Eclipse UserFriend
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.getResourceStrin g(ViewerPlugin.java:159)
at
org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(ViewerPlugin.java:181)
at
org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(WebappAccessor.java:152)
at
org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(WebappAccessor.java:68)
at
org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(WebViewer.java:369)
at
org.eclipse.birt.report.viewer.utilities.WebViewer.startup(W ebViewer.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
Re: org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application [message #264356 is a reply to message #264267] Fri, 11 January 2008 13:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Stefano,

Do you have all the plugins that the viewer requires in your plugins
directory and did you add the viewer plugin to your project dependecies?

Jason

Stefano Zaccaria wrote:
> 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.getResourceStrin g(ViewerPlugin.java:159)
>
> at
> org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(ViewerPlugin.java:181)
>
> at
> org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(WebappAccessor.java:152)
>
> at
> org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(WebappAccessor.java:68)
>
> at
> org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(WebViewer.java:369)
>
> at
> org.eclipse.birt.report.viewer.utilities.WebViewer.startup(W ebViewer.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
Re: org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application [message #264389 is a reply to message #264356] Sat, 12 January 2008 08:57 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Jason for you replay.

First off, I want to be sure that you understand that my application
don't have the rcp style, I want run this plugin inside my swt
application where I use some jface class. So my application don't use
the rcp framework and as you can see from my snippet i want to test the
use of webviewer plugin with the swt browser class.

Now, I put some plugin in the class path of this application ( I saw
that the vm trows some null pointer exception and so I try to meet its
request ;-) ), but I suppose that the problem is inside the osgi
framework, because it not be instantiate by my snippet.

Thanks thousand!



> Stefano,
>
> Do you have all the plugins that the viewer requires in your plugins
> directory and did you add the viewer plugin to your project dependecies?
>
> Jason
>
> Stefano Zaccaria wrote:
>> 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.getResourceStrin g(ViewerPlugin.java:159)
>>
>> at
>> org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(ViewerPlugin.java:181)
>>
>> at
>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(WebappAccessor.java:152)
>>
>> at
>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(WebappAccessor.java:68)
>>
>> at
>> org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(WebViewer.java:369)
>>
>> at
>> org.eclipse.birt.report.viewer.utilities.WebViewer.startup(W ebViewer.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
Re: org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application [message #264466 is a reply to message #264389] Mon, 14 January 2008 10:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Stefano,

Can you email me the project or explain how you setup the project?
When you call the startup for the WebViewer this should start the
required plugins for BIRT.

Jason

Stefano Zaccaria wrote:
> Thanks Jason for you replay.
>
> First off, I want to be sure that you understand that my application
> don't have the rcp style, I want run this plugin inside my swt
> application where I use some jface class. So my application don't use
> the rcp framework and as you can see from my snippet i want to test the
> use of webviewer plugin with the swt browser class.
>
> Now, I put some plugin in the class path of this application ( I saw
> that the vm trows some null pointer exception and so I try to meet its
> request ;-) ), but I suppose that the problem is inside the osgi
> framework, because it not be instantiate by my snippet.
>
> Thanks thousand!
>
>
>
>> Stefano,
>>
>> Do you have all the plugins that the viewer requires in your plugins
>> directory and did you add the viewer plugin to your project dependecies?
>>
>> Jason
>>
>> Stefano Zaccaria wrote:
>>> 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.getResourceStrin g(ViewerPlugin.java:159)
>>>
>>> at
>>> org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(ViewerPlugin.java:181)
>>>
>>> at
>>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(WebappAccessor.java:152)
>>>
>>> at
>>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(WebappAccessor.java:68)
>>>
>>> at
>>> org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(WebViewer.java:369)
>>>
>>> at
>>> org.eclipse.birt.report.viewer.utilities.WebViewer.startup(W ebViewer.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
Re: org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application [message #264578 is a reply to message #264466] Tue, 15 January 2008 17:26 Go to previous messageGo to next message
Eclipse UserFriend
Oh, Jason, how much patience!

Thanks again for you answers,
I'm sorry for my bad English...
Ok, I try again to explain my project. I want to use the birt viewer
plugin in my swt application. My swt application is not a rcp
application neither a plugin project, it only a simple swt application
as you can see in my last snippet. I put in the class path of my
application the plugin that contain
org.eclipse.birt.report.viewer.utilities.WebViewer
and com.ibm.icu

I hope that this could help you... then me :-)

Thanks!

> Stefano,
>
> Can you email me the project or explain how you setup the project?
> When you call the startup for the WebViewer this should start the
> required plugins for BIRT.
>
> Jason
>
> Stefano Zaccaria wrote:
>> Thanks Jason for you replay.
>>
>> First off, I want to be sure that you understand that my application
>> don't have the rcp style, I want run this plugin inside my swt
>> application where I use some jface class. So my application don't use
>> the rcp framework and as you can see from my snippet i want to test
>> the use of webviewer plugin with the swt browser class.
>>
>> Now, I put some plugin in the class path of this application ( I saw
>> that the vm trows some null pointer exception and so I try to meet its
>> request ;-) ), but I suppose that the problem is inside the osgi
>> framework, because it not be instantiate by my snippet.
>>
>> Thanks thousand!
>>
>>
>>
>>> Stefano,
>>>
>>> Do you have all the plugins that the viewer requires in your plugins
>>> directory and did you add the viewer plugin to your project dependecies?
>>>
>>> Jason
>>>
>>> Stefano Zaccaria wrote:
>>>> 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.getResourceStrin g(ViewerPlugin.java:159)
>>>>
>>>> at
>>>> org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(ViewerPlugin.java:181)
>>>>
>>>> at
>>>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(WebappAccessor.java:152)
>>>>
>>>> at
>>>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(WebappAccessor.java:68)
>>>>
>>>> at
>>>> org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(WebViewer.java:369)
>>>>
>>>> at
>>>> org.eclipse.birt.report.viewer.utilities.WebViewer.startup(W ebViewer.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
Re: org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application [message #264595 is a reply to message #264578] Wed, 16 January 2008 00:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Stefano,

I believe I understand and I do not think the viewer plugin can work
this way. One way may be to use the BIRT runtime and copy the viewer
plugin and its required plugins to birt runtime plugins directory and
then do a platform startup. I have not tried this though.

Jason

Stefano Zaccaria wrote:
> Oh, Jason, how much patience!
>
> Thanks again for you answers,
> I'm sorry for my bad English...
> Ok, I try again to explain my project. I want to use the birt viewer
> plugin in my swt application. My swt application is not a rcp
> application neither a plugin project, it only a simple swt application
> as you can see in my last snippet. I put in the class path of my
> application the plugin that contain
> org.eclipse.birt.report.viewer.utilities.WebViewer
> and com.ibm.icu
>
> I hope that this could help you... then me :-)
>
> Thanks!
>
>> Stefano,
>>
>> Can you email me the project or explain how you setup the project?
>> When you call the startup for the WebViewer this should start the
>> required plugins for BIRT.
>>
>> Jason
>>
>> Stefano Zaccaria wrote:
>>> Thanks Jason for you replay.
>>>
>>> First off, I want to be sure that you understand that my application
>>> don't have the rcp style, I want run this plugin inside my swt
>>> application where I use some jface class. So my application don't use
>>> the rcp framework and as you can see from my snippet i want to test
>>> the use of webviewer plugin with the swt browser class.
>>>
>>> Now, I put some plugin in the class path of this application ( I saw
>>> that the vm trows some null pointer exception and so I try to meet
>>> its request ;-) ), but I suppose that the problem is inside the osgi
>>> framework, because it not be instantiate by my snippet.
>>>
>>> Thanks thousand!
>>>
>>>
>>>
>>>> Stefano,
>>>>
>>>> Do you have all the plugins that the viewer requires in your plugins
>>>> directory and did you add the viewer plugin to your project
>>>> dependecies?
>>>>
>>>> Jason
>>>>
>>>> Stefano Zaccaria wrote:
>>>>> 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.getResourceStrin g(ViewerPlugin.java:159)
>>>>>
>>>>> at
>>>>> org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(ViewerPlugin.java:181)
>>>>>
>>>>> at
>>>>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(WebappAccessor.java:152)
>>>>>
>>>>> at
>>>>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(WebappAccessor.java:68)
>>>>>
>>>>> at
>>>>> org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(WebViewer.java:369)
>>>>>
>>>>> at
>>>>> org.eclipse.birt.report.viewer.utilities.WebViewer.startup(W ebViewer.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
Re: org.eclipse.birt.report.viewer.utilities.WebViewer to SWT application [message #264859 is a reply to message #264595] Mon, 21 January 2008 03:01 Go to previous message
Eclipse UserFriend
Thanks Jason,
for hour I take this workaround:

Deploy the webviewer application in a embedded tomcat solution, then
I'm starting the tomcat when I start my swt application by inside it.

Thanks thousand
> Stefano,
>
> I believe I understand and I do not think the viewer plugin can work
> this way. One way may be to use the BIRT runtime and copy the viewer
> plugin and its required plugins to birt runtime plugins directory and
> then do a platform startup. I have not tried this though.
>
> Jason
>
> Stefano Zaccaria wrote:
>> Oh, Jason, how much patience!
>>
>> Thanks again for you answers,
>> I'm sorry for my bad English...
>> Ok, I try again to explain my project. I want to use the birt viewer
>> plugin in my swt application. My swt application is not a rcp
>> application neither a plugin project, it only a simple swt
>> application as you can see in my last snippet. I put in the class
>> path of my application the plugin that contain
>> org.eclipse.birt.report.viewer.utilities.WebViewer
>> and com.ibm.icu
>>
>> I hope that this could help you... then me :-)
>>
>> Thanks!
>>
>>> Stefano,
>>>
>>> Can you email me the project or explain how you setup the project?
>>> When you call the startup for the WebViewer this should start the
>>> required plugins for BIRT.
>>>
>>> Jason
>>>
>>> Stefano Zaccaria wrote:
>>>> Thanks Jason for you replay.
>>>>
>>>> First off, I want to be sure that you understand that my
>>>> application don't have the rcp style, I want run this plugin inside
>>>> my swt application where I use some jface class. So my application
>>>> don't use the rcp framework and as you can see from my snippet i
>>>> want to test the use of webviewer plugin with the swt browser class.
>>>>
>>>> Now, I put some plugin in the class path of this application ( I
>>>> saw that the vm trows some null pointer exception and so I try to
>>>> meet its request ;-) ), but I suppose that the problem is inside
>>>> the osgi framework, because it not be instantiate by my snippet.
>>>>
>>>> Thanks thousand!
>>>>
>>>>
>>>>
>>>>> Stefano,
>>>>>
>>>>> Do you have all the plugins that the viewer requires in your
>>>>> plugins directory and did you add the viewer plugin to your
>>>>> project dependecies?
>>>>>
>>>>> Jason
>>>>>
>>>>> Stefano Zaccaria wrote:
>>>>>> 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.getResourceStrin g(ViewerPlugin.java:159)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.birt.report.viewer.ViewerPlugin.getFormattedReso urceString(ViewerPlugin.java:181)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.getW ebappPath(WebappAccessor.java:152)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.birt.report.viewer.utilities.WebappAccessor.star t(WebappAccessor.java:68)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.birt.report.viewer.utilities.WebViewer.startWebA pp(WebViewer.java:369)
>>>>>>
>>>>>> at
>>>>>> org.eclipse.birt.report.viewer.utilities.WebViewer.startup(W ebViewer.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
Previous Topic:Embeded internationalization?
Next Topic:Accessing design.xsd through EMF API (using generated design.ecore)
Goto Forum:
  


Current Time: Mon Jul 21 09:34:19 EDT 2025

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

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

Back to the top