Skip to main content



      Home
Home » Archived » BIRT » Cannot add POJO as data source to simple report
Cannot add POJO as data source to simple report [message #255887] Thu, 20 September 2007 21:10 Go to next message
Eclipse UserFriend
Originally posted by: deadwinterday.yahoo.com

Hi folks:

I am attempting to write a very simple report which uses a very simple
POJO for its data. I cannot seem to get the JavaScript interpreter to
correctly load my POJO class. I have tried copying the class to:

C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\birt\WEB-INF\classes

C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\birt\WEB-INF\lib

C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\birt\scriptlib

Neither has worked.

This is the error I am getting in preview mode:

A BIRT exception occurred.
Plug-in Provider:Eclipse.org
Plug-in Name:BIRT Data Engine
Plug-in ID:org.eclipse.birt.data
Version:2.2.0.v200706221
Error Code:data.engine.BirtException
Error Message:A BIRT exception occurred: Error evaluating Javascript
expression. Script engine error: ReferenceError:
"SpeedometerDataSourceBean" is not defined. (DataSet[Data Set].__bm_open#4)
Script source: DataSet[Data Set].__bm_open, line: 1, text:
__bm_open(). See next exception for more information.
Error evaluating Javascript expression. Script engine error:
ReferenceError: "SpeedometerDataSourceBean" is
not defined. (DataSet[Data Set].__bm_open#4)
Script source: DataSet[Data Set].__bm_open, line: 1, text:
__bm_open()


This is my class:

package com.mycompany.platform.ui;

public class SpeedometerDataSourceBean {
private String count = "42";

public String getCount() {
return count;
}

public void setCount(String count) {
this.count = count;
}
}

These are my scripts:
"open"

importPackage(Packages.com.supplyscape.platform.ui);

c = new SpeedometerDataSourceBean();

count = c.getCount();

"fetch"
row["COUNT"] = count;

return true;

I can post the design XML if need be.

Any help will be appreciated. Thanks.

-Carlos Rodriguez
Re: Cannot add POJO as data source to simple report [message #255898 is a reply to message #255887] Thu, 20 September 2007 23:48 Go to previous messageGo to next message
Eclipse UserFriend
You have defined the class in the package

> package com.mycompany.platform.ui; <-- mycompany

and imported the package

> importPackage(Packages.com.supplyscape.platform.ui); <-- supplyscape

It is possible that this is just a typing error.

Snjeza

Carlos Rodriguez wrote:
> Hi folks:
>
> I am attempting to write a very simple report which uses a very simple
> POJO for its data. I cannot seem to get the JavaScript interpreter to
> correctly load my POJO class. I have tried copying the class to:
>
> C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\birt\WEB-INF\classes
>
>
> C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\birt\WEB-INF\lib
>
>
> C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\birt\scriptlib
>
>
> Neither has worked.
>
> This is the error I am getting in preview mode:
>
> A BIRT exception occurred.
> Plug-in Provider:Eclipse.org
> Plug-in Name:BIRT Data Engine
> Plug-in ID:org.eclipse.birt.data
> Version:2.2.0.v200706221
> Error Code:data.engine.BirtException
> Error Message:A BIRT exception occurred: Error evaluating Javascript
> expression. Script engine error: ReferenceError:
> "SpeedometerDataSourceBean" is not defined. (DataSet[Data Set].__bm_open#4)
> Script source: DataSet[Data Set].__bm_open, line: 1, text:
> __bm_open(). See next exception for more information.
> Error evaluating Javascript expression. Script engine error:
> ReferenceError: "SpeedometerDataSourceBean" is not defined.
> (DataSet[Data Set].__bm_open#4)
> Script source: DataSet[Data Set].__bm_open, line: 1, text:
> __bm_open()
>
>
> This is my class:
>
> package com.mycompany.platform.ui;
>
> public class SpeedometerDataSourceBean {
> private String count = "42";
>
> public String getCount() {
> return count;
> }
>
> public void setCount(String count) {
> this.count = count;
> }
> }
>
> These are my scripts:
> "open"
>
> importPackage(Packages.com.supplyscape.platform.ui);
>
> c = new SpeedometerDataSourceBean();
>
> count = c.getCount();
>
> "fetch"
> row["COUNT"] = count;
>
> return true;
>
> I can post the design XML if need be.
>
> Any help will be appreciated. Thanks.
>
> -Carlos Rodriguez
>
>
Re: Cannot add POJO as data source to simple report [message #255923 is a reply to message #255898] Fri, 21 September 2007 13:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: deadwinterday.yahoo.com

Yes, I am sorry. This was just a typo when writing it to the newsgroup.
It was a halfhearted attempt to hide the name of my company. The real
code for the class is:

package com.supplyscape.platform.ui;

public class SpeedometerDataSourceBean {
private String count = "42";

public String getCount() {
return count;
}

public void setCount(String count) {
this.count = count;
}
}

I should also add that I also attempted to package the class by itself in
a jar, and then added the following to the manifest found in:

C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\META-INF

like so:

Class-Path: myclass.jar

-carlos


Snjezana Peco wrote:

> You have defined the class in the package

> > package com.mycompany.platform.ui; <-- mycompany

> and imported the package

> > importPackage(Packages.com.supplyscape.platform.ui); <-- supplyscape

> It is possible that this is just a typing error.

> Snjeza

> Carlos Rodriguez wrote:
>> Hi folks:
>>
>> I am attempting to write a very simple report which uses a very simple
>> POJO for its data. I cannot seem to get the JavaScript interpreter to
>> correctly load my POJO class. I have tried copying the class to:
>>
>>
C:SoftwareBIRTeclipsepluginsorg.eclipse.birt.report.viewer_2 .2.0.v20070620birtWEB-INFclasses
>>
>>
>>
C:SoftwareBIRTeclipsepluginsorg.eclipse.birt.report.viewer_2 .2.0.v20070620birtWEB-INFlib
>>
>>
>>
C:SoftwareBIRTeclipsepluginsorg.eclipse.birt.report.viewer_2 .2.0.v20070620birtscriptlib
>>
>>
>> Neither has worked.
>>
>> This is the error I am getting in preview mode:
>>
>> A BIRT exception occurred.
>> Plug-in Provider:Eclipse.org
>> Plug-in Name:BIRT Data Engine
>> Plug-in ID:org.eclipse.birt.data
>> Version:2.2.0.v200706221
>> Error Code:data.engine.BirtException
>> Error Message:A BIRT exception occurred: Error evaluating Javascript
>> expression. Script engine error: ReferenceError:
>> "SpeedometerDataSourceBean" is not defined. (DataSet[Data Set].__bm_open#4)
>> Script source: DataSet[Data Set].__bm_open, line: 1, text:
>> __bm_open(). See next exception for more information.
>> Error evaluating Javascript expression. Script engine error:
>> ReferenceError: "SpeedometerDataSourceBean" is not defined.
>> (DataSet[Data Set].__bm_open#4)
>> Script source: DataSet[Data Set].__bm_open, line: 1, text:
>> __bm_open()
>>
>>
>> This is my class:
>>
>> package com.mycompany.platform.ui;
>>
>> public class SpeedometerDataSourceBean {
>> private String count = "42";
>>
>> public String getCount() {
>> return count;
>> }
>>
>> public void setCount(String count) {
>> this.count = count;
>> }
>> }
>>
>> These are my scripts:
>> "open"
>>
>> importPackage(Packages.com.supplyscape.platform.ui);
>>
>> c = new SpeedometerDataSourceBean();
>>
>> count = c.getCount();
>>
>> "fetch"
>> row["COUNT"] = count;
>>
>> return true;
>>
>> I can post the design XML if need be.
>>
>> Any help will be appreciated. Thanks.
>>
>> -Carlos Rodriguez
>>
>>
Yes, I am sorry. This was just a typo when writing it to the newsgroup
Re: Cannot add POJO as data source to simple report [message #255959 is a reply to message #255923] Sat, 22 September 2007 16:38 Go to previous message
Eclipse UserFriend
Carlos Rodriguez wrote:

>
> C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\META-INF
>
>
> like so:
>
> Class-Path: myclass.jar
>

You need to find the following line in the MANIFEST.MF file:

Bundle-ClassPath: viewer.jar

and change it to:

Bundle-ClassPath: viewer.jar,
myclass.jar

Put myclass.jar in the
C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620
directory (the viewer's root directory).

Check if BIRT has been loaded from the C:\Software\BIRT\eclipse\plugins
location and restart Eclipse using the -clean option
Adding myclass.jar to
C:\Software\BIRT\eclipse\plugins\org.eclipse.birt.report.vie wer_2.2.0.v20070620\birt\scriptlib
would have to work.

Snjeza
Previous Topic:What is the minimal deployment of the webviewer?
Next Topic:Urgent Please advise asap
Goto Forum:
  


Current Time: Thu Jun 05 05:16:33 EDT 2025

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

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

Back to the top