commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Fiol BonnĂ­n <antonio.f...@gmail.com>
Subject [configuration] How to load from a resource (as opposed to a file)
Date Thu, 23 Sep 2004 18:48:14 GMT
Hi,

<configuration>
   <hierarchicalDom4j fileName="someFile.xml" />
</configuration>

looks for someFile.xml in the same place as the containing xml. Looks
good... unless the containing XML is a resource.

Possibly due to a bug on ClassLoader implementation in both Tomcat and
IBM WAS, if the containing file is in a jar file in WEB-INF/lib, and
someFile.xml is in the same package (to make it simpler) in
WEB-INF/classes/package/name, the file is not properly loaded, for
different reasons in each App server.

So the question is: Can I state something like...
filename="resource:package/name/someFile.xml" that would ultimately
resolve to the right file in the right place?

Do I have an alternative other than translating the XML into code that
creates the right Configuration objects (in a CompositeConfiguration),
but giving each the right URL I got from Class.getResource(String) ?

Thank you very much.


Antonio Fiol

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message