• 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: NullPointerException
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NullPointerException


  • Subject: Re: NullPointerException
  • From: Steve Quirk <email@hidden>
  • Date: Wed, 01 Oct 2008 17:23:49 -0400 (EDT)




On Wed, 1 Oct 2008, Chuck Hill wrote:

Nothing about that looks familiar to me. You appear to be using Wonder which should fix any bug.
  __________________!!!

Oh come on now.  A little humility, please.  :-)

Steve


Anyone have an idea on this?

Chuck

On Oct 1, 2008, at 7:40 AM, Awbrey Hughlett wrote:

I am using Wonder 5.3 and I have found a few things saying there was a bug with WOForm in that version. Is this the case here?

<webobject name="Form">
<webobject name="SpecificType"></webobject><br />
<webobject name="SaveChanges"></webobject>
</webobject>

Form : WOForm {
}

SpecificType : WOTextField {
value = specific.specificType;
}

SaveChanges : WOSubmitButton {
action = saveChanges;
value = "Save";
}

Awbrey

On Oct 1, 2008, at 1:01 AM, Chuck Hill wrote:

Please keep messages on the list.
^ now I understand what you are saying :( oops sorry

That error seems very odd. What is in the HTML and WOD?

Chuck


On Sep 30, 2008, at 9:46 PM, Awbrey Hughlett wrote:

File
Line#
Method
Package


WOForm.java 58 _enterFormInContext com.webobjects.appserver._private WOForm.java 69 takeValuesFromRequest com.webobjects.appserver._private WOComponent.java 914 takeValuesFromRequest com.webobjects.appserver WOSession.java 1139 takeValuesFromRequest com.webobjects.appserver ERXSession.java 525 takeValuesFromRequest er.extensions.appserver WOApplication.java 1350 takeValuesFromRequest com.webobjects.appserver WOComponentRequestHandler.java 189 _dispatchWithPreparedPage com.webobjects.appserver._private WOComponentRequestHandler.java 287 _dispatchWithPreparedSession com.webobjects.appserver._private WOComponentRequestHandler.java 322 _dispatchWithPreparedApplication com.webobjects.appserver._private WOComponentRequestHandler.java 358 _handleRequest com.webobjects.appserver._private WOComponentRequestHandler.java 432 handleRequest com.webobjects.appserver._private WOApplication.java 1306 dispatchRequest com.webobjects.appserver WOWorkerThread.java 173 runOnce com.webobjects.appserver._private WOWorkerThread.java 254 run com.webobjects.appserver._private Thread.java 613 run java.lang


NA : Non applicable, JIT activated On Sep 30, 2008, at 11:22 PM, Chuck Hill wrote:


On Sep 30, 2008, at 8:07 PM, Awbrey Hughlett wrote:

I have an entity named "Specific" and an attribute named "specificType". I have a WOTextField bound to specific.specificType and a WOSubmitButton bound to saveChanges() all wrapped in a WOForm. When I run the component and click to save changes to the database, I get a NullPointerException. Have I instantiated the Specific entity and inserted it into an editing context correctly? Or do I have other problems?

You have other problems, some of which you probably don't know about.




public class SpecificEntry extends WOComponent { private Specific specific; private EOEditingContext ec = new EOEditingContext();

Noooooooooo. :-) You are using an unlocked editing context. Doom awaits you. You have three choices here:


1. Start using Wonder and ERXEC
2. Use session().defaultEditingContext() - though this has issues of its own
3. Use MultiECLockManager and add the infrastructure to your apps to handle EC management.




public SpecificEntry(WOContext context) { super(context); }

   public Specific specific() {
   	if (specific == null) {
   		editingContext().revert();

specific = (Specific)EOUtilities.createAndInsertInstance(editingContext(), "Specific");
}


   	return specific;
   }

   public WOComponent saveChanges() {

   	editingContext().saveChanges();

   	setSpecific(null);

return context().page();

Post the stack track for for NPE. Guessing is too hard.


Chuck


   }

   public EOEditingContext editingContext() {
   	return ec;
   }

   public void setSpecific(Specific newSpecific) {
   	specific = newSpecific;
   }
}

Thanks,
Awbrey
_______________________________________________
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: NullPointerException
      • From: Chuck Hill <email@hidden>
References: 
 >Re: NullPointerException (From: Awbrey Hughlett <email@hidden>)
 >Re: NullPointerException (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: NullPointerException
  • Next by Date: Re: NullPointerException
  • Previous by thread: Re: NullPointerException
  • Next by thread: Re: NullPointerException
  • Index(es):
    • Date
    • Thread