Re: Failed to load domain and/or its maps/nodes

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Mar 31 2003 - 20:31:19 EST


Troy,

To further trace the problem, you can turn on configuration loading
debugging. To do that you need to configure the logger. Configuration
file is
expected at $HOME/.cayenne/cayenne-log.properties (on Win2K $HOME is
like C:\Documents and Settings\username). Contents of this file can be
like this:

log4j.rootLogger=WARN, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.logger.org.objectstyle.cayenne = DEBUG

Also try running it outside of Intellij, from command line. Sometimes
IDEs can add unexpected kinks to the JVM runtime environment.

Those steps would allow you to obtain more information on the problem.
If this doesn't help you, please post the output of the command line
trace on this list.

Andrus

On Monday, March 31, 2003, at 07:33 PM, Dave Paules wrote:
> I've run into this problem myself. Holger from objectstyle.org has
> been fixing the finding and loading of the config files. I've found
> that the best solution works when the config files are not nested
> within a java package and the folder that contains them is on the
> classpath. This works for me whether the files are jarred up or not,
> just so long as they are NEVER in a java package.
>  
> Dave Paules
> Quantum Leap Innovations
> www.quantumleap.us
>
> -----Original Message-----
> From: Troy McKinnon [mailto:tmckinno..rise.com]
> Sent: Monday, March 31, 2003 7:28 PM
> To: cayenne-use..bjectstyle.org
> Subject: Fw: Failed to load domain and/or its maps/nodes
>
> I have been trying to get this on my own... but I feel I have hit the
> wall, and would appreciate any input.
>  
> I am getting the following error:
>  
> ERROR Configuration: Error initializing shared Configuration
> org.objectstyle.cayenne.ConfigException:
> [org.objectstyle.cayenne.conf.DefaultConfiguration] : Failed to load
> domain and/or its maps/nodes.
>  at
> org.objectstyle.cayenne.conf.RuntimeLoadDelegate.finishedLoading(Runtim
> eLoadDelegate.java:420)
>  at
> org.objectstyle.cayenne.conf.ConfigLoader.loadDomains(ConfigLoader.java
> :125)
>  at
> org.objectstyle.cayenne.conf.Configuration.init(Configuration.java:278)
>  at
> org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configurati
> on.java:228)
>  at
> org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configurati
> on.java:219)
>  at
> org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configurati
> on.java:197)
>  at
> org.objectstyle.cayenne.conf.Configuration.getSharedConfig(Configuratio
> n.java:168)
>  at
> org.objectstyle.cayenne.access.DataContext.createDataContext(DataContex
> t.java:155)
>  
>  
> I debugged the source code and it looks like my issue is with the sax
> XMLParser/Impl.
> I am using java version 1.4.1_02 and think this might be the issue?
>  
> My xml files are all being loaded correctly, I have verified this by
> outputting the file data from the
> cayenne.util.ResourceLocator.findResourceStream() using the URL found
> there.
>  
> Should I roll back to a specific version of java or am I doing
> something else wrong.
>  
> I am also using Intellij to compile and run the program.  I have a
> simple test class with the following:
>  
> Construct  {{{{
>     Configuration.bootstrapSharedConfig(this.getClass());
>     DataDomain sharedDomain =
> Configuration.getSharedConfig().getDomain();
> }}}
>  
> I basically can't get past the construct. i.e. createContext()
>  
> I have included my xml files below:
>  
>  
> --------------- cayenne.xml -----------------------
> <?xml version="1.0" encoding="utf-8"?>
> <domains project-version="1.0">
>     <domain name="DSHOPZ">
>         <map name="DSHOPZMAP" location="DSHOPZMAP.map.xml"/>
>         <node name="DSHOPZDATANODE"
>             datasource="DSHOPZDATANODE.driver.xml"
>             adapter="org.objectstyle.cayenne.dba.oracle.OracleAdapter"
>            
> factory="org.objectstyle.cayenne.conf.DriverDataSourceFactory">
>             <map-ref name="DSHOPZMAP"/>
>         </node>
>     </domain>
> </domains>
>  
>  
> ---------------------------------  DSHOPZDATANODE.driver.xml
> -----------------
> <driver project-version="1.0" class="oracle.jdbc.OracleDriver">
>  <url value="jdbc:oracle:thin..XX:1521:XXX"/>
>  <connectionPool min="1" max="10" />
>  <login userName="XXX" password="XXX"/>
> </driver>
>  
>  
>  
> ------------------------------ DSHOPZMAP.map.xml
> -------------------------------
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <data-map project-version="1.0">
>  <db-entity name="TABLE_1">
>   <db-attribute name="ACTIVE" type="CHAR" isMandatory="true"
> length="1"/>
>    ...
>   </db-entity>
>  <db-entity name="TABLE_2">
>                ...
>  </db-entity>
>  
> etc etc..
>
>  </data-map>
>



This archive was generated by hypermail 2.0.0 : Mon Mar 31 2003 - 20:35:52 EST