Skip to main content



      Home
Home » Archived » BIRT » Cannot get POJO
Cannot get POJO [message #87249] Thu, 03 November 2005 16:00 Go to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

I have some logic that I have tested in Java and it works fine, but when I
try it through BIRT I get null as my object.

My initialize script for the report looks thusly:

importPackage(Packages.com.labcorp.cels.pla.domain.organizat ion);
labCorp = LabCorp.INSTANCE;
lab = labCorp.getLabNamed( "CMBP" );
dept = lab.getDepartmentNamed( "Molecular Biology" );

The Lab class, which is to be returned from getLabNamed() and LabCorp are
both in the organization package.

I have a Data object from the palette with the following expression:

labCorp.getName()

That works fine. But, I have another Data object with:

lab.toString()

which does NOT work. An error for the report initialization script says:

TypeError: Cannot call method "getDepartmentNamed" of null (#9)

So, the Lab is obviously not being retrieved through my LabCorp instance.

If anyone sees what I'm doing wrong, I'd greatly appreciate advice.
(I'm on BIRT 1.0.1 and Eclipse 3.1)

Thanks, Mark
Re: Cannot get POJO [message #87264 is a reply to message #87249] Thu, 03 November 2005 16:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

What are you using underneath to get the data?



Mark Lorenz wrote:
> I have some logic that I have tested in Java and it works fine, but when
> I try it through BIRT I get null as my object.
>
> My initialize script for the report looks thusly:
>
> importPackage(Packages.com.labcorp.cels.pla.domain.organizat ion);
> labCorp = LabCorp.INSTANCE;
> lab = labCorp.getLabNamed( "CMBP" );
> dept = lab.getDepartmentNamed( "Molecular Biology" );
>
> The Lab class, which is to be returned from getLabNamed() and LabCorp
> are both in the organization package.
>
> I have a Data object from the palette with the following expression:
>
> labCorp.getName()
>
> That works fine. But, I have another Data object with:
>
> lab.toString()
>
> which does NOT work. An error for the report initialization script says:
>
> TypeError: Cannot call method "getDepartmentNamed" of null (#9)
>
> So, the Lab is obviously not being retrieved through my LabCorp instance.
>
> If anyone sees what I'm doing wrong, I'd greatly appreciate advice.
> (I'm on BIRT 1.0.1 and Eclipse 3.1)
>
> Thanks, Mark
>
>
Re: Cannot get POJO [message #87278 is a reply to message #87249] Thu, 03 November 2005 16:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

Also, check the log file in the log directory in the viewer plugin directory

...\plugins\org.eclipse.birt.report.viewer_1.0.1\birt\logs



Mark Lorenz wrote:
> I have some logic that I have tested in Java and it works fine, but when
> I try it through BIRT I get null as my object.
>
> My initialize script for the report looks thusly:
>
> importPackage(Packages.com.labcorp.cels.pla.domain.organizat ion);
> labCorp = LabCorp.INSTANCE;
> lab = labCorp.getLabNamed( "CMBP" );
> dept = lab.getDepartmentNamed( "Molecular Biology" );
>
> The Lab class, which is to be returned from getLabNamed() and LabCorp
> are both in the organization package.
>
> I have a Data object from the palette with the following expression:
>
> labCorp.getName()
>
> That works fine. But, I have another Data object with:
>
> lab.toString()
>
> which does NOT work. An error for the report initialization script says:
>
> TypeError: Cannot call method "getDepartmentNamed" of null (#9)
>
> So, the Lab is obviously not being retrieved through my LabCorp instance.
>
> If anyone sees what I'm doing wrong, I'd greatly appreciate advice.
> (I'm on BIRT 1.0.1 and Eclipse 3.1)
>
> Thanks, Mark
>
>
Re: Cannot get POJO [message #87295 is a reply to message #87249] Thu, 03 November 2005 16:56 Go to previous messageGo to next message
Eclipse UserFriend
Mark,

Have you tried
LC = Packages.com.labcorp.cels.pla.domain.organization.LabCorp;
if not static do
LC = new Packages.com.labcorp.cels.pla.domain.organization.LabCorp();


labCorp = LabCorp.INSTANCE;
lab = labCorp.getLabNamed( "CMBP" );
dept = lab.getDepartmentNamed( "Molecular Biology" );

Jason Weathersby
BIRT PMC



"Mark Lorenz" <mlorenz@nc.rr.com> wrote in message
news:8d23237422c0dcac396aeb2723401197$1@www.eclipse.org...
>I have some logic that I have tested in Java and it works fine, but when I
>try it through BIRT I get null as my object.
>
> My initialize script for the report looks thusly:
>
> importPackage(Packages.com.labcorp.cels.pla.domain.organizat ion); labCorp
> = LabCorp.INSTANCE;
> lab = labCorp.getLabNamed( "CMBP" );
> dept = lab.getDepartmentNamed( "Molecular Biology" );
>
> The Lab class, which is to be returned from getLabNamed() and LabCorp are
> both in the organization package.
>
> I have a Data object from the palette with the following expression:
>
> labCorp.getName()
>
> That works fine. But, I have another Data object with:
>
> lab.toString()
>
> which does NOT work. An error for the report initialization script says:
>
> TypeError: Cannot call method "getDepartmentNamed" of null (#9)
>
> So, the Lab is obviously not being retrieved through my LabCorp instance.
>
> If anyone sees what I'm doing wrong, I'd greatly appreciate advice.
> (I'm on BIRT 1.0.1 and Eclipse 3.1)
>
> Thanks, Mark
>
>
Re: Cannot get POJO [message #87504 is a reply to message #87295] Fri, 04 November 2005 07:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

Jason -

I can get the LabCorp instance OK - that was the one you had helped with
before. So, "labCorp = LabCorp.INSTANCE;" works fine. The problem is that
I then do:

lab = labCorp.getLabNamed( "CMBP" );
dept = lab.getDepartmentNamed( "Molecular Biology" );

and "lab" is null. This exact same code works in Java, just not in BIRT.
My .jar is obviously being found since LabCorp is found. And Lab and
LabCorp are in the same package.

I'll try what you suggest, but it doesn't seem related to me.

Thanks for the reply.
Mark
Re: Cannot get POJO [message #87518 is a reply to message #87278] Fri, 04 November 2005 07:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

Thanks for the tip Mark. I checked in the file from yesterday and found
this:

"SEVERE: TypeError: Cannot call method "getDepartmentNamed" of null
(<inline>#11) org.mozilla.javascript.EcmaError: TypeError: Cannot call
method "getDepartmentNamed" of null (<inline>#11)"

So, my "lab" instance is NOT being returned from my (valid) "labCorp"
instance. Same code works in Java, just not BIRT.

Thanks again.
Mark L
Re: Cannot get POJO [message #87533 is a reply to message #87264] Fri, 04 November 2005 07:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

I am using Mock objects to return the values for now. Just focusing on
BIRT, not the persistence.

Mark L
Re: Cannot get POJO [message #87609 is a reply to message #87518] Fri, 04 November 2005 10:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: m.n.com

Log what is being passed to getLabNamed and try it both ways. Also
delimit the value like: "'" + param + "'"

Mark Lorenz wrote:
> Thanks for the tip Mark. I checked in the file from yesterday and found
> this:
>
> "SEVERE: TypeError: Cannot call method "getDepartmentNamed" of null
> (<inline>#11) org.mozilla.javascript.EcmaError: TypeError: Cannot call
> method "getDepartmentNamed" of null (<inline>#11)"
>
> So, my "lab" instance is NOT being returned from my (valid) "labCorp"
> instance. Same code works in Java, just not BIRT.
>
> Thanks again.
> Mark L
>
Re: Cannot get POJO [message #87663 is a reply to message #87249] Fri, 04 November 2005 10:58 Go to previous messageGo to next message
Eclipse UserFriend
Mark,
If you just have this in the initialize

> importPackage(Packages.com.labcorp.cels.pla.domain.organizat ion); labCorp
> = LabCorp.INSTANCE;
> lab = labCorp.getLabNamed( "CMBP" );
> dept = lab.getDepartmentNamed( "Molecular Biology" );

Nothing on controls does the report complain?
Any way you could upload a stub class so we could try it?

Jason Weathersby
BIRT PMC

"Mark Lorenz" <mlorenz@nc.rr.com> wrote in message
news:8d23237422c0dcac396aeb2723401197$1@www.eclipse.org...
>I have some logic that I have tested in Java and it works fine, but when I
>try it through BIRT I get null as my object.
>
> My initialize script for the report looks thusly:
>
> importPackage(Packages.com.labcorp.cels.pla.domain.organizat ion); labCorp
> = LabCorp.INSTANCE;
> lab = labCorp.getLabNamed( "CMBP" );
> dept = lab.getDepartmentNamed( "Molecular Biology" );
>
> The Lab class, which is to be returned from getLabNamed() and LabCorp are
> both in the organization package.
>
> I have a Data object from the palette with the following expression:
>
> labCorp.getName()
>
> That works fine. But, I have another Data object with:
>
> lab.toString()
>
> which does NOT work. An error for the report initialization script says:
>
> TypeError: Cannot call method "getDepartmentNamed" of null (#9)
>
> So, the Lab is obviously not being retrieved through my LabCorp instance.
>
> If anyone sees what I'm doing wrong, I'd greatly appreciate advice.
> (I'm on BIRT 1.0.1 and Eclipse 3.1)
>
> Thanks, Mark
>
>
Re: Cannot get POJO [message #87770 is a reply to message #87663] Fri, 04 November 2005 13:01 Go to previous message
Eclipse UserFriend
Originally posted by: mlorenz.nc.rr.com

Sending via email directly to you...Mark
Previous Topic:BIRT-Report parameter default value as null
Next Topic:BIRT viewer and dynamic parameters
Goto Forum:
  


Current Time: Sat Jul 19 03:00:26 EDT 2025

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

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

Back to the top