Re: A fetch throws a java.lang.NullPointerException on a sub-record
Re: A fetch throws a java.lang.NullPointerException on a sub-record
- Subject: Re: A fetch throws a java.lang.NullPointerException on a sub-record
- From: Chuck Hill <email@hidden>
- Date: Sun, 4 Jul 2010 20:55:06 -0700
On Jul 4, 2010, at 5:49 PM, Baiss Eric Magnusson wrote:
> In changing to EODatabaseDataSource in the Session and ERXDisplayGroup in the WOComponent from using templated woo files, I tripped up on the way because I get a <java.lang.NullPointerException> when I try to bring in the current transactions at startup.
>
> After getting through the first 8 different table fetches I get a NullPointerException on the last table, a SubCategory record. It's the only 2 deep fetch, (Transaction: Category: SubCategory) and does not have an Owner reference, referring only to its Parent EO, Category.
> The various records it tries to fetch below have correct contents in the DB and there are 3 SubCategory rows in the Category table.
>
> <WorkerThread15> evaluateExpression: <com.webobjects.jdbcadaptor.FrontbasePlugIn$FrontbaseExpression: "SELECT t0."CAT_ID", t0."SUB_CAT_ID", t0."SUB_CAT_NAME", t0."TOT_AMT_ALL", t0."TOT_AMT_MONTH", t0."TOT_AMT_YEAR" FROM "SUB_CATEGORY" t0 WHERE t0."CAT_ID" = 1000146" withBindings: >
>
> 3 row(s) processed
> === Commit Internal Transaction
> <com.webobjects.appserver._private.WOComponentRequestHandler>: Exception occurred while handling request:
> com.webobjects.foundation.NSForwardException [java.lang.reflect.InvocationTargetException] null:java.lang.reflect.InvocationTargetException
> com.webobjects.foundation.NSForwardException [java.lang.reflect.InvocationTargetException] null:java.lang.reflect.InvocationTargetException
> at com.webobjects.foundation._NSUtilities._explainInstantiationException(_NSUtilities.java:600)
> at com.webobjects.foundation._NSUtilities.instantiateObject(_NSUtilities.java:620)
> ...
> Caused by: java.lang.NullPointerException
> at com.webobjects.eoaccess.EODatabaseDataSource.fetchObjects(EODatabaseDataSource.java:589)
> at com.webobjects.appserver.WODisplayGroup.fetch(WODisplayGroup.java:2132)
> at er.extensions.appserver.ERXDisplayGroup.fetch(ERXDisplayGroup.java:123)
> at Components.CurrentSit.fillDisplayGroup(CurrentSit.java:64)
> ... 46 more
That seems to come from having a null editing context. Are you somehow not setting the EC for this EODatabaseDataSource?
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden