Runtime Error: how to find cayenne.xml

From: Dave Paules (dn..uantumleap.us)
Date: Mon Feb 24 2003 - 17:41:41 EST

  • Next message: Holger Hoffstätte: "Re: Runtime Error: how to find cayenne.xml"

    Hi all,
    I moved cayenne.xml, the *.driver.xml and the *.map.xml files for
    configuring cayenne into a different directory than the class that loads the
    Configuration class. I am doing this because I wish to hide most of the
    setup of cayenne and have people concentrate on the business objects.

    my main class resides in a directory
    /database/DBTests

    my config files for cayenne reside in
    /database/cayenne_config

    my DataObject subclasses reside in
    /database

    So in my class in DBTests that has a main, I tried calling
    DataDomain sharedDomain = Configuration.getSharedConfig().getDomain();

    which threw this error:
    ERROR Configuration: Error initializing shared Configuration
    org.objectstyle.cayenne.ConfigException:
    [org.objectstyle.cayenne.conf.DefaultConfiguration] : Domain configuration
    file "cayenne.xml" is not found.
            at
    org.objectstyle.cayenne.conf.Configuration.init(Configuration.java:249)
            at
    org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configuration.ja
    va:214)
            at
    org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configuration.ja
    va:206)
            at
    org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configuration.ja
    va:189)
            at
    org.objectstyle.cayenne.conf.Configuration.getSharedConfig(Configuration.jav
    a:162)
            at database.DBTests.MultiUserTest.loadCayenne(MultiUserTest.java:30)
            at database.DBTests.MultiUserTest.<init>(MultiUserTest.java:21)
            at database.DBTests.MultiUserTest.main(MultiUserTest.java:25)
    java.lang.RuntimeException: Error initializing shared Configuration
            at
    org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configuration.ja
    va:217)
            at
    org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configuration.ja
    va:206)
            at
    org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configuration.ja
    va:189)
            at
    org.objectstyle.cayenne.conf.Configuration.getSharedConfig(Configuration.jav
    a:162)
            at database.DBTests.MultiUserTest.loadCayenne(MultiUserTest.java:30)
            at database.DBTests.MultiUserTest.<init>(MultiUserTest.java:21)
            at database.DBTests.MultiUserTest.main(MultiUserTest.java:25)
    Exception in thread "main"

    How do I get my DBTests.MultiUserTest class to find cayenne.xml and the
    other config files? All are on the classpath (I develop in
    NetBeans...anything in the filesystem is automatically on the classpath).
    However, cayenne.xml would appear to be listed in a java package
    database.cayenne_config

    Any help would be appreciated.
    Thanks
    Dave Paules
    Quantum Leap Innovations



    This archive was generated by hypermail 2.0.0 : Mon Feb 24 2003 - 17:48:00 EST