Re: Strange NullPointerException

From: Alex Gunawan Wibowo (netzone_tec..ahoo.com)
Date: Fri Mar 11 2005 - 23:51:08 EST

  • Next message: Andrus Adamchik: "Re: Strange NullPointerException"

    Could be wrong... but have you tried
    BasicServletConfiguration.getDefaultContext(request.getSession())??
    Have you bind the DataContext in web.xml??

    Again.. I could be wrong...

    --- Jürgen Saar <jsaa..eb.de> wrote:
    > I actually set up a new project ...
    > the first with postgres and PK from cayenne
    >
    > The following source:
    > ...
    > DataContext context =
    > DataContext.createDataContext();
    >
    > TrAddress addr = (TrAddress)
    > context.createAndRegisterNewObject(TrAddress.class);
    > addr.setCity("AnyWhere");
    >
    > context.commitChanges();
    > ...
    >
    > The Reaktion:
    >
    > Exception in thread "main"
    > java.lang.NullPointerException
    > at
    >
    org.objectstyle.cayenne.CayenneDataObject.validateForSave(CayenneDataObject.java:575)
    > at
    >
    org.objectstyle.cayenne.CayenneDataObject.validateForInsert(CayenneDataObject.java:700)
    > at
    >
    org.objectstyle.cayenne.access.ObjectStore.validateUncommittedObjects(ObjectStore.java:937)
    > at
    >
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1260)
    > at
    >
    org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1236)
    > at
    > org.jsaar.test.JustForTry.main(JustForTry.java:31)
    >
    >
    > any idea?
    > ---Juergen---
    >
    >
    >
    ______________________________________________________________
    > Verschicken Sie romantische, coole und witzige
    > Bilder per SMS!
    > Jetzt bei WEB.DE FreeMail:
    > http://f.web.de/?mc=021193
    >
    >

    Alex Wibowo
                ~ Second is a failure ~
    ==============================================

                    
    __________________________________
    Do you Yahoo!?
    Yahoo! Small Business - Try our new resources site!
    http://smallbusiness.yahoo.com/resources/



    This archive was generated by hypermail 2.0.0 : Fri Mar 11 2005 - 23:51:10 EST