On 2012-04-12, at 10:25 AM, Ken Anderson wrote:

> The editing context is passed in as a parameter and checked between lines 
> 68-73.
> 
> This is line 68-73:
> 
>       68      Address me = this;
>       69
>       70      if (editingContext() != editingContext) {
>       71        System.out.println("ec not matched");
>       72              me = this.localInstanceIn(editingContext);

That seems confusing.  You are using editingContext, editingContext(), and 
me.editingContext().


>       73      }
> 
> And this is line 94-101:
> 
>       94      try{
>       95        System.out.println(editingContext.toString());
>       96        me.editingContext().saveChanges();
>       97      } catch (Exception e){
>       98        System.out.println(me._primaryKey);
>       99        
> System.out.println(editingContext.objectForGlobalID(me.__globalID()).valueForKey(ADDRESS1_KEY));
>       100       System.out.println(e.getCause().toString());

So if the exception is happening on line 100, then e.getCause() is null, no?  
Try e.printStackTrace();


Chuck

>       101     }
> 
> Ken Anderson
> k...@watermarkstudios.com
> 
> 
> 
> On Apr 12, 2012, at 10:14 AM, Chuck Hill wrote:
> 
>> 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
>>> k...@watermarkstudios.com
>>> 
>>> 
>>> 
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
>>> 
>>> This email sent to ch...@global-village.net
>> 
>> -- 
>> 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
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> 

-- 
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








Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to