• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NPE in storedValueForKey?!?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NPE in storedValueForKey?!?


  • Subject: Re: NPE in storedValueForKey?!?
  • From: Chuck Hill <email@hidden>
  • Date: Wed, 21 Jan 2015 17:26:45 +0000
  • Thread-topic: NPE in storedValueForKey?!?

I am pretty sure that Hugi is right here.



On 2015-01-21, 6:04 AM, "Hugi Thordarson" wrote:

Are you sure your object is in an editing context?

Cheers,
- hugi

// Hugi Thordarson
// http://www.loftfar.is/
// s. 895-6688



On 21. jan. 2015, at 14:01, OC <email@hidden> wrote:

Hello there,

how on earth can this happen?!?

===
Caused by: java.lang.NullPointerException
at com.webobjects.eocontrol.EOCustomObject.willReadRelationship(EOCustomObject.java:1270)
at er.extensions.eof.ERXGenericRecord.willReadRelationship(ERXGenericRecord.java:380)
at com.webobjects.eocontrol._EOMutableKnownKeyDictionary$Initializer$_LazyGenericRecordBinding.valueInObject(_EOMutableKnownKeyDictionary.java:614)
at er.extensions.eof.ERXGenericRecord$TouchingBinding.valueInObject(ERXGenericRecord.java:209)
at com.webobjects.eocontrol.EOCustomObject.storedValueForKey(EOCustomObject.java:1634)
at com.webobjects.eocontrol.EOCustomObject$storedValueForKey$0.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at com.webobjects.eocontrol.EOCustomObject$storedValueForKey$0.callCurrent(Unknown Source)
at model._DBRecord.auction(_DBRecord.groovy:61)
===

The _DBRecord thing is one of the pretty old legacy parts, standard EO code as generated in an Eclipse project by its eogenerator, as it used to work a couple of years ago when I used Eclipse the last time:

===
 public static final ERXKey<model.DBAuction> AUCTION = new ERXKey<model.DBAuction>("auction");
...
 public static final String AUCTION_KEY = AUCTION.key();
...
 public model.DBAuction auction() {
   (model.DBAuction)storedValueForKey(_DBRecord.AUCTION_KEY) // <== line 61
 }
===

The relationship should be nonempty, but even if it was empty, it should simply return null from storedValueForKey, and not NPE?!? :-O

Thanks for any insight,
OC


_______________________________________________
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

 _______________________________________________
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

  • Follow-Ups:
    • Re: NPE in storedValueForKey?!?
      • From: OC <email@hidden>
References: 
 >NPE in storedValueForKey?!? (From: OC <email@hidden>)
 >Re: NPE in storedValueForKey?!? (From: Hugi Thordarson <email@hidden>)

  • Prev by Date: Re: wiki.wocommunity.org down
  • Next by Date: Re: wiki.wocommunity.org down
  • Previous by thread: Re: NPE in storedValueForKey?!?
  • Next by thread: Re: NPE in storedValueForKey?!?
  • Index(es):
    • Date
    • Thread