Re: NullPointerException in call to DataContext.createDataContext()

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Oct 13 2004 - 00:06:56 EDT

  • Next message: Twan Kogels: "Re: SQLTemplate generates Date instead of Timestamp?"

    Hi Marcia,

    What version of Cayenne do you have (my latest code has line 151 at
    DataContext.java pointing to a totally different code, so is hard to
    trace the origin, though I can guess where it is of course...). But
    more importantly - could you post the log statements that according to
    your message indicate proper Cayenne startup - this may be helpful in
    diagnosing the problem further.

    Thanks
    Andrus

    On Oct 12, 2004, at 4:27 PM, Marcia Corprew wrote:

    > A former co-worker successfully used cayenne in other environments,
    > however I'm trying to mirror the environment on my own machine and am
    > getting the error below when I start my application.  Between the
    > cayenne documentation and by looking at our other working
    > environments, it appears that I have the libraries and appropriate
    > cayenne files in the correct location.  When I start Tomcat, my
    > cayenne initialization appears to be okay with no reported errors. 
    > (The output indicates that all maps and xml files were loaded, the
    > database connection pool was created and my specified domain was
    > added.)
    >
    > I've searched the entire archive, but to no avail.  I'm sure it's a
    > basic error but I've searched for longer than I care to admit for a
    > solution and am hoping someone has the patience to get me on the right
    > path.  If I need to provide more detail, let me know.  I've been
    > thrown to the wolves in regards to Cayenne and my crash course isn't
    > going very smoothly.
    >
    > The offending line of code: 
    >
    >     DataContext context = DataContext.createDataContext();
    >
    > The error:
    >
    > File name:
    > C:\jakarta-tomcat-5.0.28\webapps\new_recon\WEB-
    > INF\classes\bstResaleConvert.class
    >
    > Exception in thread "main" java.lang.NullPointerException
    >
    >         at
    > org.objectstyle.cayenne.access.DataContext.createDataContext(DataContex
    > t.java:151)
    >
    >         at
    > api.reconciliation.conversion.BellSouthResaleConverter.processRows(Bell
    > SouthResaleConverter.java:63)
    >
    >         at
    > api.reconciliation.conversion.BellSouthResaleConverter.<init>(BellSouth
    > ResaleConverter.java:43)
    >
    >         at bstResaleConvert.main(bstResaleConvert.java:33)
    >
    > Tx,
    >
    > Marcia
    >



    This archive was generated by hypermail 2.0.0 : Wed Oct 13 2004 - 00:07:02 EDT