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 Re: [configuration] How to load from a resource (as opposed to a file)
Date Fri, 24 Sep 2004 12:19:44 GMT
Hi Eric,

I am really glad the issue can be solved (and will be).

WRT the unit test, I find it a bit complicated to isolate, but I may
try to create a few classes for that. But anyway, what I would need to
know is what the expected behaviour is. In other words: what am I
supposed to have in the fileName attribute to read from a resource?

Thank you very much.


Antonio Fiol


On Fri, 24 Sep 2004 13:38:00 +0200, Eric Pugh <epugh@upstate.com> wrote:
> Hi..
> 
> I think, and Emmanuel, can you verify for me, that we need to change the
> ConfigurationFactory to use the new file locating stuff?  Right now I think
> the problem is that in ConfigurationFactory.FileConfigurationFactory, the
> logic for finding a file sucks..  I think the whole basePath is wrong..
> 
> Antonio, if you could send in a unit test demonstrating this, that would
> really help verify that any changes we make solve your problem.
> 
> Eric
> 
> 
> 
> > -----Original Message-----
> > From: Antonio Fiol Bonnin [mailto:antonio.fiol@gmail.com]
> > Sent: Thursday, September 23, 2004 8:48 PM
> > To: Jakarta Commons Users List
> > Subject: [configuration] How to load from a resource (as opposed to a
> > file)
> >
> >
> > 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
> 
>

---------------------------------------------------------------------
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