Skip to main content



      Home
Home » Archived » BIRT » birt 2.2 fails to locate java classes in importPackage script statements
birt 2.2 fails to locate java classes in importPackage script statements [message #253057] Mon, 20 August 2007 17:22 Go to next message
Eclipse UserFriend
We use the BIRT Runtime API, and after we upgraded from BIRT 2.1.1 to 2.2
the scripting engine now fails to locate java classes referenced in the
importPackage of a report script. The classes that we use in the script are
part of the same java application that uses the BIRT Runtime API.

The exact error message is:

Aug 20, 2007 11:27:55 AM
org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor handleJS
WARNING: A BIRT exception occurred: Error evaluating Javascript expression.
Script engine error: ReferenceError: "IeBirtFilter" is not defined.
(DataSource[DSS].__bm_beforeOpen#9)
Script source: DataSource[DSS].__bm_beforeOpen, line: 1, text:
__bm_beforeOpen().

Everything worked fine under Birt 2.1.1 We were getting the errors under
Eclipse 3.2. I switched to Eclipse 3.3 but still received the same errors.
Any ideas what can be causing this error? I've tried everything I can think
of. Thank you.
Re: birt 2.2 fails to locate java classes in importPackage script statements [message #253172 is a reply to message #253057] Tue, 21 August 2007 17:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: clf.clf.com

This might be it....

https://bugs.eclipse.org/bugs/show_bug.cgi?id=186272


"al kamarauskas" <akamarau@indiana.edu> wrote in message
news:fad0ms$dh8$1@build.eclipse.org...
> We use the BIRT Runtime API, and after we upgraded from BIRT 2.1.1 to 2.2
> the scripting engine now fails to locate java classes referenced in the
> importPackage of a report script. The classes that we use in the script
> are part of the same java application that uses the BIRT Runtime API.
>
> The exact error message is:
>
> Aug 20, 2007 11:27:55 AM
> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor handleJS
> WARNING: A BIRT exception occurred: Error evaluating Javascript
> expression. Script engine error: ReferenceError: "IeBirtFilter" is not
> defined. (DataSource[DSS].__bm_beforeOpen#9)
> Script source: DataSource[DSS].__bm_beforeOpen, line: 1, text:
> __bm_beforeOpen().
>
> Everything worked fine under Birt 2.1.1 We were getting the errors under
> Eclipse 3.2. I switched to Eclipse 3.3 but still received the same
> errors.
> Any ideas what can be causing this error? I've tried everything I can
> think of. Thank you.
>
Re: birt 2.2 fails to locate java classes in importPackage script statements [message #253614 is a reply to message #253172] Mon, 27 August 2007 21:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: alpheratz-news.transentia.com.au

> This might be it....
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=186272

I am experiencing the same issue when I try to use a scripted data source in
the BIRT RCP Designer. I have my classes under
C:\birt-rcp-report-designer-2_2_0\plugins\org.eclipse.birt.r eport.viewer_2.2.0.v20070620\birt\WEB-INF\classes
and the designer simply can't see them.

I suspect this is an issue of design time vs. run-time classpaths.

So: how to set the design-time classpath for the RCP designer?

Cheers.
Re: birt 2.2 fails to locate java classes in importPackage script statements [message #253728 is a reply to message #253172] Tue, 28 August 2007 14:28 Go to previous messageGo to next message
Eclipse UserFriend
clf - You were right. I had to add code to set the appclassloader of the
report engine via EngineConstants.APPCONTEXT_CLASSLOADER_KEY. In my case,
the exact code was:

contextMap.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,Re portEngine.class.getClassLoader());



This corrected the problem. Thanks for your help.

ak



"clf" <clf@clf.com> wrote in message news:fafktc$kno$1@build.eclipse.org...
> This might be it....
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=186272
>
>
> "al kamarauskas" <akamarau@indiana.edu> wrote in message
> news:fad0ms$dh8$1@build.eclipse.org...
>> We use the BIRT Runtime API, and after we upgraded from BIRT 2.1.1 to 2.2
>> the scripting engine now fails to locate java classes referenced in the
>> importPackage of a report script. The classes that we use in the script
>> are part of the same java application that uses the BIRT Runtime API.
>>
>> The exact error message is:
>>
>> Aug 20, 2007 11:27:55 AM
>> org.eclipse.birt.report.engine.script.internal.DtEScriptExec utor handleJS
>> WARNING: A BIRT exception occurred: Error evaluating Javascript
>> expression. Script engine error: ReferenceError: "IeBirtFilter" is not
>> defined. (DataSource[DSS].__bm_beforeOpen#9)
>> Script source: DataSource[DSS].__bm_beforeOpen, line: 1, text:
>> __bm_beforeOpen().
>>
>> Everything worked fine under Birt 2.1.1 We were getting the errors under
>> Eclipse 3.2. I switched to Eclipse 3.3 but still received the same
>> errors.
>> Any ideas what can be causing this error? I've tried everything I can
>> think of. Thank you.
>>
>
>
Re: birt 2.2 fails to locate java classes in importPackage script statements [message #253821 is a reply to message #253728] Wed, 29 August 2007 03:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: firstname.lastname.napa.fi

On Tue, 28 Aug 2007 21:28:58 +0300, al kamarauskas <akamarau@indiana.edu=
> =

wrote:

> clf - You were right. I had to add code to set the appclassloader of =
the
> report engine via EngineConstants.APPCONTEXT_CLASSLOADER_KEY. In my =
=

> case,
> the exact code was:
>
> contextMap.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,Re portEngine=
..class.getClassLoader());
>
> This corrected the problem. Thanks for your help.
>
>
> "clf" <clf@clf.com> wrote in message =

> news:fafktc$kno$1@build.eclipse.org...
>> This might be it....
>>
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D186272

Is setting the classloader property from javacode embedding BIRT the =
=

only way? Doesn't this mean it is not possible to see the correct result=
s =

in BIRT RCP Designer's preview?

I'm asking as I am having precisely the same problem. I did not yet t=
ry =

running the report from my own code, but I think it makes designing a =

report considerably more difficult if I can't preview the result from th=
e =

RCP Designer...

Any ideas?



-Antti-
birt 2.2 fails to locate java classes in the ODA driver when in RCP Designer [message #254072 is a reply to message #253821] Fri, 31 August 2007 06:49 Go to previous message
Eclipse UserFriend
Originally posted by: firstname.lastname.napa.fi

On Wed, 29 Aug 2007 10:48:42 +0300, Antti Karanta =

<firstname.lastname@napa.fi> wrote:

>> clf - You were right. I had to add code to set the appclassloader of=
=

>> the report engine via EngineConstants.APPCONTEXT_CLASSLOADER_KEY. I=
n =

>> my case, the exact code was:
>>
>> contextMap.put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY,Re portEngin=
e.class.getClassLoader());


I have now confirmed that the javascript snippets are able to access =
the =

classes in the driver ok when APPCONTEXT_CLASSLOADER_KEY is set as above=
..
However, this only works when embedding BIRT. I haven't found a way t=
o =

make it work with BIRT runtime's genReport.bat nor in BIRT RCP Report =

Designer's preview. I'd need to have at least the latter one working as =
it =

will be very inconvenient to design reports and only be able to preview =
=

them correctly from the embedding app.

BTW, I need to access the classes via the same classloader that the =

driver uses. This is because I am accessing a native library and having =
=

multiple versions of the classes by separate classloaders within the sam=
e =

process would lead into problems. To put it another way, I need to acces=
s =

the same objects (the one I need is available as a singleton) that the =

driver is accessing.

Should I reopen https://bugs.eclipse.org/bugs/show_bug.cgi?id=3D18627=
2 ? =

Or is there a way to make this work? Is there something I can do in the =
=

plugin code?



-Antti-
Previous Topic:Trying to "append" multiple rptdesigns to single output (HTML, BIRT 2.2)
Next Topic:Image URL in HTML report is wrong
Goto Forum:
  


Current Time: Sun Apr 27 01:39:02 EDT 2025

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

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

Back to the top