Re: Runtime Error: how to find cayenne.xml

From: Holger Hoffstätte (holge..izards.de)
Date: Mon Feb 24 2003 - 18:29:02 EST

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

    Dave Paules wrote:
    > 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.
    > (..)
    > 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.

    Interesting, this should IMHO work. Ij ust looked at it - the config files
    are loaded from the CLASSPATH by the main ClassLoader; are you sure they
    are really copied to the output path or whatever Netbeans uses?
    If that's the case we either have a bug (will try to reproduce this) or
    there's something else wrong. For a workaround try to use something like
    domain = Configuration.initSharedConfig(new
    DefaultConfiguration("/path/to/caynenne.xml")) which will use a file path
    directly.
    At least that's what the documentation says.. ;-)

    Holger



    This archive was generated by hypermail 2.0.0 : Mon Feb 24 2003 - 18:31:48 EST