cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut BolĨina <borut.bolc...@gmail.com>
Subject Search order for cayenne.xml
Date Thu, 18 Nov 2010 10:21:26 GMT
Hi,

before looking into the source code, maybe someone can help me understand
the order of search paths when adding a classpath like this

        DefaultConfiguration conf = new
DefaultConfiguration();
        conf.addClassPath("database");
        Configuration.initializeSharedConfiguration(conf);

the log spits out

[2010/11/18 11:01:03.348] DEBUG [conf.DefaultConfiguration:<init>]: using
domain file name: cayenne.xml
[2010/11/18 11:01:03.350] DEBUG [conf.DefaultConfiguration:initialize]:
initialize starting.
[2010/11/18 11:01:03.351] DEBUG [util.ResourceLocator:findResource]:
searching additional classpaths: [database]
[2010/11/18 11:01:03.351] DEBUG [util.ResourceLocator:findResource]:
searching for: database/cayenne.xml
[2010/11/18 11:01:03.352] DEBUG [mortbay.log:debug]:
getResource(database/cayenne.xml)=file:/C:/Users/borutb/workspace/maps-manager/target/classes/database/cayenne.xml
[2010/11/18 11:01:03.352] DEBUG [util.ResourceLocator:findURLInClassLoader]:
URL found with classloader:
file:/C:/Users/borutb/workspace/maps-manager/target/classes/database/cayenne.xml

So, if I do

conf.addClassPath("database");

is Cayenne also trying to load cayenne.xml from the root classpath or not?
The log says: "searching additional classpths..."

I am asking this because I have a JAR which my web project depends on and
this jar has cayenne.xml also (at the root). I just wanna be sure if the
order is deterministic and if the root is searched at all in the above case.
If not, I suggest log improvement and the documentation at
http://cayenne.apache.org/doc30/customizing-configuration.html which doesn't
clarify my case.

Thanks,
Borut

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message