Re: ConfigurationException

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Jul 16 2007 - 02:49:22 EDT

  • Next message: Greg Boshart: "RE: problems with Oracle stored procedure"

    Hi,

    > org.apache.cayenne.ConfigurationException: [v.2.0.3 May 6 2007]
    > Error during Configuration initialization. [v.2.0.3 May 6 2007]
    > [org.apache.cayenne.conf.DefaultConfiguration] : Domain
    > configuration file "cayenne.xml" is not found.

    Could you doublecheck where your XML files are located (should be in
    WEB-INF or WEB-INF/classes)?

    > Second question: is there a singleton solution for accessing the
    > same DataContext instance from multiple JSP's?

    Totally... with a session pattern that won't be a singleton per se.
    Check out this page:

    http://cayenne.apache.org/doc20/web-applications.html

    The filter setup would allow you to obtain a session DataContext with
    this code within JSP's:

         DataContext context = DataContext.getThreadDataContext();

    Andrus

    On Jul 16, 2007, at 12:39 AM, Joe Baldwin wrote:

    > I have been converting a JSP project from JDBC to Cayenne for the
    > last few days. Everything has been going incredibly well: I used
    > CayenneModeler to convert my database and create Java classes. I
    > stored the configuration files in WEB-INF and everything has been
    > going great. I verified that the JSP was integrated with Cayenne,
    > Tomcat, & MySQL. I started experimenting with storing the
    > DataContext with the session and at some point Cayenne reported
    > problems. So I reverted back to the archived project that was
    > working and now that does not work anymore.
    >
    > I wrote an app that does not use JSP and it has no problems.
    >
    > I *suspect* that it might have something to do with the DataModeler
    > config files and Tomcat being out of sync but I am a bit unsure
    > with how to move forward with my testing.
    >
    > The trigger line in my JSP file is:
    > DataContext dataContext = DataContext.createDataContext();
    >
    > The current error reported by Tomcat is:
    >
    > org.apache.cayenne.ConfigurationException: [v.2.0.3 May 6 2007]
    > Error during Configuration initialization. [v.2.0.3 May 6 2007]
    > [org.apache.cayenne.conf.DefaultConfiguration] : Domain
    > configuration file "cayenne.xml" is not found.
    > org.apache.cayenne.conf.Configuration.initializeSharedConfiguration
    > (Configuration.java:285)
    > org.apache.cayenne.conf.Configuration.initializeSharedConfiguration
    > (Configuration.java:258)
    > org.apache.cayenne.conf.Configuration.initializeSharedConfiguration
    > (Configuration.java:239)
    > org.apache.cayenne.conf.Configuration.getSharedConfiguration
    > (Configuration.java:176)
    > org.apache.cayenne.access.DataContext.createDataContext
    > (DataContext.java:206)
    > org.apache.jsp.Products_jsp._jspService(Products_jsp.java:145)
    >
    > As I said I have reverted back to my old project that I archived,
    > but am now getting this error from the project that functioned
    > properly. Also, as I said, similar but non-JSP code seems to work
    > with no problems.
    >
    > Second question: is there a singleton solution for accessing the
    > same DataContext instance from multiple JSP's?
    >
    >



    This archive was generated by hypermail 2.0.0 : Mon Jul 16 2007 - 02:49:46 EDT