Re: nullpointerexception from ctxt.performQuery

From: Vincent Stoessel (vincen..aymaca.com)
Date: Tue Feb 04 2003 - 15:43:19 EST

  • Next message: Vincent Stoessel: "Re: nullpointerexception from ctxt.performQuery"

    Yes, this is how the Datacontext is created:

    DataContext ctxt = (DataContext)
    request.getSession().getAttribute("context");

    //this is where we choke.
    SelectQuery query = new SelectQuery(Artist.class);

    Is there supposed to be a "context" attribute in the session
    beforehand for this example?

    Andrus Adamchik wrote:
    > Vincent, Holger,
    >
    > There is no Cayenne classes in stack trace, so I believe that DataContext
    > is not created for the Session at all, causing the NPE. I don't have the
    > test environment here, so I will take a look for the possible reasons when
    > I get home.
    >
    > Andrus
    >
    >
    >
    >>whoops, only replied to Vincent..
    >>
    >>--snip--
    >>
    >>Vincent,
    >>
    >>
    >>>I am sooo close to having cayenne set up correctly, just need
    >>>a push in the right direction.
    >>
    >>What version of Cayenne are you running? Please use at least the latest
    >>release version, alpha6; if that doesn't help we'll dig further. You
    >>might also try to println both the DataContext and the query; let me
    >>know what you find. Unfortunately I don't have the web tutorials set up
    >>at the moment so I cannot test this myself, sorry..
    >>
    >>regards
    >>Holger
    >
    >
    >

    -- 
    Vincent Stoessel
    Linux Systems Developer
    vincent xaymaca.com
    



    This archive was generated by hypermail 2.0.0 : Tue Feb 04 2003 - 15:44:45 EST