commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ying lcs" <ying...@gmail.com>
Subject how to use XML Configuration of Jakarta Commons in a servlet?
Date Sun, 12 Aug 2007 06:56:51 GMT
Hi,

I am trying to use XMLConfiguration in my servlet like this:

try {
			xmlconfig = new XMLConfiguration("config.xml");
		} catch (ConfigurationException  e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

But it can't load the file 'config.xml'. Can you please tell me where
should I put the config.xml file so that it can load it?

org.apache.commons.configuration.ConfigurationException: Cannot locate
configuration source config.xml
	at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:213)
	at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:193)
	at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.load(AbstractHierarchicalFileConfiguration.java:163)
	at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.<init>(AbstractHierarchicalFileConfiguration.java:90)
	at org.apache.commons.configuration.XMLConfiguration.<init>(XMLConfiguration.java:169)
	at  com.mytest.myservlet.ServletConfig.<clinit>(ServletConfig.java:39)

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


Mime
View raw message