Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » ReportServiceException when trying to preview a report more than once
ReportServiceException when trying to preview a report more than once [message #655503] Mon, 21 February 2011 13:32 Go to next message
RWIL Mising name is currently offline RWIL Mising name
Messages: 28
Registered: February 2011
Junior Member
Hi,

I'm trying to create a sample report which uses a Java object as datasource.
When I click on the Preview tab to see how it looks, it works fine at the first Preview. But when I go back to source and click on Preview again, I've got an exception (see below).

Eclipse Birt Report designer seems to load the native library at the first preview and seems unable to reload it at the second preview.

I have to restart Eclipse at each preview, and it's not funny...

Does anyone have an idea on how to avoid that problem ?


org.eclipse.birt.report.service.api.ReportServiceException: Error happened while running the report.
at org.eclipse.birt.report.service.ReportEngineService.throwDum myException(ReportEngineService.java:1097)
at org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(ReportEngineService.java:926)
at org.eclipse.birt.report.service.BirtViewerReportService.runA ndRenderReport(BirtViewerReportService.java:973)
(...)

Caused by: org.eclipse.birt.report.engine.api.EngineException: Error happened while running the report.
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR un(RunAndRenderTask.java:209)
at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run (RunAndRenderTask.java:77)
at org.eclipse.birt.report.service.ReportEngineService.runAndRe nderReport(ReportEngineService.java:920)
... 49 more

Caused by: java.lang.UnsatisfiedLinkError: Cannot load native JNIWrapper library (jniwrap.dll). at com.jniwrapper.Library.loadNativeCode(SourceFile:78)
at com.jniwrapper.Library.loadNativeCode(SourceFile:103)
at com.jniwrapper.Library.ensureNativeCode(SourceFile:113)
at com.jniwrapper.PlatformContext.a(SourceFile:452)

[Updated on: Mon, 21 February 2011 13:33]

Report message to a moderator

Re: ReportServiceException when trying to preview a report more than once [message #655824 is a reply to message #655503] Tue, 22 February 2011 17:04 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Does the Java Object rely on other jars that may be in multiple places
in the classpath?

Jason

On 2/21/2011 8:32 AM, RWIL wrote:
> Hi,
>
> I'm trying to create a sample report which uses a Java object as
> datasource. When I click on the Preview tab to see how it looks, it
> works fine at the first Preview. But when I go back to source and click
> on Preview again, I've got an exception (see below).
>
> Eclipse/brit seems to load the native library at the first preview and
> seems unable to reload it at the second preview.
>
> I have to restart Eclipse at each preview, and it's not funny...
> Does anyone have an idea on how to avoid that problem ?
>
>
> org.eclipse.birt.report.service.api.ReportServiceException: Error
> happened while running the report.
> at org.eclipse.birt.report.service.ReportEngineService.throwDum
> myException(ReportEngineService.java:1097)
> at org.eclipse.birt.report.service.ReportEngineService.runAndRe
> nderReport(ReportEngineService.java:926)
> at org.eclipse.birt.report.service.BirtViewerReportService.runA
> ndRenderReport(BirtViewerReportService.java:973)
> (...)
>
> Caused by: org.eclipse.birt.report.engine.api.EngineException: Error
> happened while running the report.
> at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doR
> un(RunAndRenderTask.java:209)
> at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run
> (RunAndRenderTask.java:77)
> at org.eclipse.birt.report.service.ReportEngineService.runAndRe
> nderReport(ReportEngineService.java:920)
> ... 49 more
>
> Caused by: java.lang.UnsatisfiedLinkError: Cannot load native JNIWrapper
> library (jniwrap.dll). at
> com.jniwrapper.Library.loadNativeCode(SourceFile:78)
> at com.jniwrapper.Library.loadNativeCode(SourceFile:103)
> at com.jniwrapper.Library.ensureNativeCode(SourceFile:113)
> at com.jniwrapper.PlatformContext.a(SourceFile:452)
>
Re: ReportServiceException when trying to preview a report more than once [message #655907 is a reply to message #655824] Wed, 23 February 2011 09:29 Go to previous messageGo to next message
RWIL Mising name is currently offline RWIL Mising name
Messages: 28
Registered: February 2011
Junior Member
Hi Jason,

Thanks for your answer.

Yes, the Java class relies on other jars. But these jars are only once in the classpath. It's the same classpath which is used in debug mode, and I don't have the problem in Debug mode.
The problem only occurs in Preview.

Re: ReportServiceException when trying to preview a report more than once [message #655954 is a reply to message #655907] Wed, 23 February 2011 14:11 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Do you have the same workspace for your Java project and Report project?
If so, look at this post:
http://birtworld.blogspot.com/2009/12/birt-designer-classpat h-changes.html

Jason

On 2/23/2011 4:29 AM, RWIL wrote:
> Hi Jason,
>
> Thanks for your answer.
> Yes, the Java class relies on other jars. But these jars are only once
> in the classpath. It's the same classpath which is used in debug mode,
> and I don't have the problem in Debug mode. The problem only occurs in
> Preview.
>
>
Re: ReportServiceException when trying to preview a report more than once [message #655965 is a reply to message #655954] Wed, 23 February 2011 15:07 Go to previous messageGo to next message
RWIL Mising name is currently offline RWIL Mising name
Messages: 28
Registered: February 2011
Junior Member
No, I've no java project in my workspace.
I'm using a jar build provided by a build machine.
I've read the changes made in the BIRT classpath, and I've set my classpath according to the new method, in the Preferences > Report design > classpath. All the jars used are "external jars" (none of them is in the workspace/project (sub)folder).

I really think about a threading model issue. The class that I try to use as datasource is using ComfyJ, a bridge Java-to-COM, to access to a COM service. The interaction with COM is very sensitive to the threading model.

Do you know what's the threading model used in the Preview tab of the Birt perspective in Eclipse ? Multi-Thread Appartment ? Single Thread Appartment ?
It should be different of the threading model used in debug mode and it would explain why there is a difference between these two modes.

Renaud
Re: ReportServiceException when trying to preview a report more than once [message #655980 is a reply to message #655965] Wed, 23 February 2011 15:27 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Renauld

There is a property on the report design, under the Advanced category
called "New handler on each event". I assume yours is set to false,
which creates one instance of the dataset class. If you set this to
true it will create a new instance of the class every time the dataset
is called. Can you try changing this and restart eclipse?

Jason

On 2/23/2011 10:09 AM, RWIL wrote:
> No, I've no java project in my workspace.
> I'm using a jar build provided by a build machine.
> I've read the changes made in the BIRT classpath, and I've set my
> classpath according to the new method, in the Preferences > Report
> design > classpath. All the jars used are "external jars" (none of them
> is in the workspace/project (sub)folder).
>
> I really think about a threading model issue. The class that I try to
> use as datasource is using ComfyJ, a bridge Java-to-COM, to access to a
> COM service. The interaction with COM is very sensitive to the threading
> model.
>
> Do you know what's the threading model used in the Preview tab of the
> Birt perspective in Eclipse ? Multi-Thread Appartment ? Single Thread
> Appartment ?
> It should be different of the threading model used in debug mode and it
> would explain why there is a difference between these two modes.
>
> Renaud
Re: ReportServiceException when trying to preview a report more than once [message #656005 is a reply to message #655980] Wed, 23 February 2011 17:29 Go to previous messageGo to next message
RWIL Mising name is currently offline RWIL Mising name
Messages: 28
Registered: February 2011
Junior Member
The property "New handler on each event" was set to false, as you have expected it. I've set the property value to true and I've restarted Eclipse.

Unfortunatly, the problem remains. The Preview is ok at the first time, but when I click on the button "Refresh Report" or when I leave the Preview mode and try to get back into Preview, the exception occurs.

I've also made test with the threading appartement model of the bridge Java2COM, but it changes nothing. The error occurs in Single Thread Appartement and in Multithreaded Apartment too.

Re: ReportServiceException when trying to preview a report more than once [message #656015 is a reply to message #656005] Wed, 23 February 2011 18:23 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Does the error happen when you preview in the Viewer or previewing the
dataset? Also can you post the code you using to load the library.

On 2/23/2011 12:29 PM, RWIL wrote:
> The property "New handler on each event" was set to false, as you have
> expected it. I've set the property value to true and I've restarted
> Eclipse.
>
> Unfortunatly, the problem remains. The Preview is ok at the first time,
> but when I click on the button "Refresh Report" or when I leave the
> Preview mode and try to get back into Preview, the exception occurs.
>
> I've also made test with the threading appartement model of the bridge
> Java2COM, but it changes nothing. The error occurs in Single Thread
> Appartement and in Multithreaded Apartment too.
>
>
Re: ReportServiceException when trying to preview a report more than once [message #656799 is a reply to message #656015] Mon, 28 February 2011 16:27 Go to previous messageGo to next message
RWIL Mising name is currently offline RWIL Mising name
Messages: 28
Registered: February 2011
Junior Member
Hi Jason,

(sorry for the delay, I was off since thursday).

I'm not sure what you mean about "preview in the Viewer". If I access to the report in the Birt Viewer through Tomcat, it works fine and I can run this report as often as I need it without problem.

I have no idea how to "preview the dataset". It's a scripted dataset and I don't know where I can preview it.

About the special property "New event on each handler", it has the value "true" in the properties of the report, but it's still "false : Inherited" in the datasource's advanced properties and in the dataset's advanced properties.

I've no code used to load the library : I'm using a third-party (ComfyJ) jar file and it loads its library itself. This work fine on our web application, with the same classes.

Renaud


[Updated on: Mon, 28 February 2011 16:29]

Report message to a moderator

Re: ReportServiceException when trying to preview a report more than once [message #656838 is a reply to message #656799] Mon, 28 February 2011 18:22 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Renaud,

In the designer you can select the preview tab to preview the report,
but you also can choose to preview it in the Web Viewer from an icon in
the toolbar. That is what I wanted you to test. To preview the
dataset, double click on the dataset and it will open the dataset editor
which has a preview tab to preview the dataset.

Jason

On 2/28/2011 11:27 AM, RWIL wrote:
> Hi Jason,
>
> (sorry for the delay, I was off since thursday).
>
> I'm not sure what you mean about "preview in the Viewer". If I access to
> the report in the Birt Viewer through Tomcat, it works fine and I can
> run this report as often as I need it without problem.
>
> I have no idea how to "preview the dataset". It's a scripted dataset and
> I don't know where I can preview it.
>
> About the special property "New event on each handler", it has the value
> "true" in the properties of the report, but it's still "false :
> Inherited" in the datasource's advanced properties and in the dataset's
> advanced properties.
>
> Renaud
>
>
>
Re: ReportServiceException when trying to preview a report more than once [message #656994 is a reply to message #656838] Tue, 01 March 2011 10:10 Go to previous messageGo to next message
RWIL Mising name is currently offline RWIL Mising name
Messages: 28
Registered: February 2011
Junior Member
Hi Jason,

Thanks for the help.

Yes, the problem also occurs when I use the "View Report in Web Viewer" button in the toolbar. The first time is ok, and the exception occurs at the second try.

And when I'm trying to preview the dataset, it's the same problem : the first time is ok, the second try raises the exception.

I've installed the version 2.6.2 of Birt, but the problem remains.

Any idea ?
Re: ReportServiceException when trying to preview a report more than once [message #657097 is a reply to message #656994] Tue, 01 March 2011 15:26 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you either post the code or email it to me? Maybe you can check the
existence of the loaded library before loading it again.
My email is jasonweathersby at windstream dot net.

Jason

On 3/1/2011 5:10 AM, RWIL wrote:
> Hi Jason,
>
> Thanks for the help.
>
> Yes, the problem also occurs when I use the "View Report in Web Viewer"
> button in the toolbar. The first time is ok, and the exception occurs at
> the second try.
>
> And when I'm trying to preview the dataset, it's the same problem : the
> first time is ok, the second try raises the exception.
>
> I've installed the version 2.6.2 of Birt, but the problem remains.
>
> Any idea ?
Re: ReportServiceException when trying to preview a report more than once [message #659483 is a reply to message #657097] Mon, 14 March 2011 09:08 Go to previous messageGo to next message
RWIL Mising name is currently offline RWIL Mising name
Messages: 28
Registered: February 2011
Junior Member
Hi Jason,

Sorry, but i can't. To be able to do that I will have to create a small sample and it will be hard to create : we use an external server through DCOM (c++), a thirt-party bridge between Java and COM to access to the local stubs, a lot of DLLs, ...

To be honest, I'm still unable to use the "preview" modes more than once, but as it works when I'm debugging the report, I'm always working in debug mode. And I works on the report directly in the main folder of the Birt Viewer, to be able to "preview" it when I want with just a refresh in my browser.

Thanks you for your help.
Re: ReportServiceException when trying to preview a report more than once [message #659556 is a reply to message #659483] Mon, 14 March 2011 14:59 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

Can you open a bugzilla entry, maybe someone else on the dev team will
be able to shed some light on this.

Jason

On 3/14/2011 5:08 AM, RWIL wrote:
> Hi Jason,
>
> Sorry, but i can't. To be able to do that I will have to create a small
> sample and it will be hard to create : we use an external server through
> DCOM (c++), a thirt-party bridge between Java and COM to access to the
> local stubs, a lot of DLLs, ...
> To be honest, I'm still unable to use the "preview" modes more than
> once, but as it works when I'm debugging the report, I'm always working
> in debug mode. And I works on the report directly in the main folder of
> the Birt Viewer, to be able to "preview" it when I want with just a
> refresh in my browser.
>
> Thanks you for your help.
Previous Topic:Load Report Libraries Dinamically
Next Topic:How to group in a table cell with the detail in the adjacent cell ?
Goto Forum:
  


Current Time: Fri Oct 24 15:44:30 GMT 2014

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

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