Which is line 100? My first guess is that editingContext != me.editingContext() and further that me has been deleted or is otherwise no longer in an valid editing context.
On 2012-04-12, at 10:05 AM, Ken Anderson wrote:
> Okay...another issue from a revision project. If you need any other
> information to make the situation clearer, let me know. I keep getting a
> NullPointerException in the following code. Keep in mind that "me" is an
> Address object and this block of code is contained in a method that is
> triggered to give the exception. All of my System.out.println() efforts
> return positive results:
>
> "try{
> System.out.println(editingContext.toString());
> me.editingContext().saveChanges();
> } catch (Exception e){
> System.out.println(me._primaryKey);
>
> System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY));
> System.out.println(e.getCause().toString());
> }
> System.out.println("ec saved for: " +
> me.getAddressForMap(true));"
>
> Printout:
>
> "r.extensions.eof.ERXEC@7a4fe91e
> 1010660
> 42 Rue Perron
> java.lang.NullPointerException
>
> at
> com.digitalesdesign.pup.dataobjects.Address.geocodeAddress(Address.java:100)
>
> at
> com.digitalesdesign.pup.dataobjects.Address.provideGeocodeAddress(Address.java:120)
>
> at
> com.digitalesdesign.pup.Application.performAddressGeocodingTemp(Application.java:176)
>
> at com.digitalesdesign.pup.Application.<init>(Application.java:34)
>
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>
> at java.lang.Class.newInstance0(Class.java:355)
>
> at java.lang.Class.newInstance(Class.java:308)
>
> at com.webobjects.appserver.WOApplication.main(WOApplication.java:547)
>
> at er.extensions.appserver.ERXApplication.main(ERXApplication.java:826)
>
> at com.digitalesdesign.pup.Application.main(Application.java:26)"
>
>
> Ken Anderson
> [email protected]
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>
> This email sent to [email protected]
--
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/gvc/practical_webobjects
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
