NullPointerException during object registration

From: Jim Menard (jim..o.com)
Date: Tue Dec 16 2003 - 14:56:57 EST

  • Next message: Andrus Adamchik: "Re: NullPointerException during object registration"

    While calling context.registerNewObject(), a NullPointerException is
    thrown (stack trace below). It looks like some relationship value in my
    object is null that should not be, but what could it be?

    There is indeed one relationship that is null, but it can't be
    otherwise because, if I understand properly, I can't add that object to
    this one yet in any case because this object is not yet part of the
    context.

    Is there a Catch 22 here: I can't set the relationship because the
    object does not yet have a context, but the relationship is manditory
    (non-null) so it has to be set before I register the object.

    java.lang.NullPointerException
             
    org.objectstyle.cayenne.access.SnapshotManager.prepareForInsert(Snapshot
    Manager.java:358)
             
    org.objectstyle.cayenne.access.DataContext.registerNewObjectWithEntity(D
    ataContext.java:425)
             
    org.objectstyle.cayenne.access.DataContext.registerNewObject(DataContext
    .java:416)
            com.preclick.photowiki.MemberDoctor.create(MemberDoctor.java:68)
            com.preclick.photowiki.MemberDoctor.save(MemberDoctor.java:43)
            ...

    Thank you for your help.

    Jim

    -- 
    Jim Menard, jim..o.com, http://www.io.com/~jimm/
    "Yes, I know /. is slanted. It still irritates me though."
         -- CrayzyJ on slashdot
    "Well, if it wasn't slanted it'd be |."
         -- Eunuchswear on slashdot
    



    This archive was generated by hypermail 2.0.0 : Tue Dec 16 2003 - 14:56:58 EST