why the error?

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

why the error?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:26 pm

by James >> Sun, 26 Oct 2003 4:39:50 GMT

when i do this -
table.displayCollection (app.myBookshop.allCustomers, true, 0, null);

it compiles with no errors, but when i load the form an Unhandled exception comes up saying,
SystemException 1090
Continuable: No
Attempted access via null object reference

Caused by
Reciever Type: CustomerList
Recieved OID: 2070.7.0.0.0 (transient)
Method: CustomerList: load

Source:
table.displayCollection (app.myBookshop.allCustomers, true, 0, null);

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: why the error?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:26 pm

by dcooper@jade.co.nz >> Sun, 26 Oct 2003 5:15:07 GMT

First guess would be that your app.myBookshop reference hasn't been set up. Try putting this immediately before you call displayCollection:

write app.myBookshop;

If the last bit of the write output is "0.0" then app.myBookshop is null and that's why trying to access its allCustomers collection is raising a 1090 exception.

If that's what the problem is, find the myBookshop property, right-click it and select References (or even better, Update References). Is it being set somewhere? Is this code actually getting called?

Cheers,
Dean.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: why the error?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:26 pm

by James >> Sun, 26 Oct 2003 8:25:47 GMT

i changed my load form-

write app.myBookshop;
table.displayCollection (app.myBookshop.allCustomers, true, 0, null);

Now the Jade Interpreter output view comes up with Object/0.0
and the same 1090 - attempted access via
null object reference.

When i checked the update references of the myBookshop property the only place it was referenced was in the Customer Class, SetPropertiesOnCreate methods in this manner -
self.myBookshop := app.myBookshop;

Is this where its being set in??

createCustomerWithBookshopActs();

vars
customer : Customer;
begin
app.initialize();

beginTransaction;
create customer persistent;
customer.setPropertiesOnCreate('4523554', 'Tom', 'Jones');
create customer persistent;
customer.setPropertiesOnCreate ('231433', 'Dan', 'Smith');
commitTransaction;
end;

??

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: why the error?

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:26 pm

by allistar >> Sun, 26 Oct 2003 21:26:42 GMT

It sounds like app.myBookshop is not set anywhere. I.e. it is always null. You need to do something like this in the application initialise method:

myBookshop := Bookshop.firstInstance();

Allistar.
--
------------------------------------------------------------------
Allistar Melville
Software Developer, Analyst allistar@silvermoon.co.nz
Auckland, NEW ZEALAND

Silvermoon Software
Specialising in JADE development and consulting
Visit us at: http://www.silvermoon.co.nz
*NEW* Simple web access to Jade at: www.silvermoon.co.nz/jhp.html ------------------------------------------------------------------


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests

cron