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 <http://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(RuntimeLoad
Delegate.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(Configuration.ja
va:228)
at
org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configuration.ja
va:219)
at
org.objectstyle.cayenne.conf.Configuration.initSharedConfig(Configuration.ja
va:197)
at
org.objectstyle.cayenne.conf.Configuration.getSharedConfig(Configuration.jav
a:168)
at
org.objectstyle.cayenne.access.DataContext.createDataContext(DataContext.jav
a: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 - 19:43:01 EST