I am on Windows, but have seen the same on OS X. The exceptions for the
two different ways of specifying are below. Sorry for the large stack
traces.
Without the slash (<properties fileName="command.properties"/>), the
error is slightly different, namely:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:258)
at
org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:505)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at
org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.commons.digester.Digester.parse(Digester.java:1567)
at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:157)
at
org.cnlp.utils.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:52)
at
org.cnlp.utils.properties.PropertyHolder.loadProperties(PropertyHolder.java:246)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver.<init>(TaxonomyViewDriver.java:59)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver$TaxonomyRunnable.run(TaxonomyViewDriver.java:112)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: org.apache.commons.configuration.ConfigurationException:
C:\ENG\Projects\AuthoringToolkit\conf\command.properties (The system
cannot find the file specified)
at
org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:128)
at
org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:63)
... 30 more
Caused by: java.io.FileNotFoundException:
C:\ENG\Projects\AuthoringToolkit\conf\command.properties (The system
cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
at java.net.URL.openStream(URL.java:913)
at
org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:123)
... 31 more
32 ERROR configuration.ConfigurationFactory - SAX Exception caught
org.apache.commons.configuration.ConfigurationException:
C:\ENG\Projects\AuthoringToolkit\conf\command.properties (The system
cannot find the file specified)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
at
org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.commons.digester.Digester.parse(Digester.java:1567)
at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:157)
at
org.cnlp.utils.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:52)
at
org.cnlp.utils.properties.PropertyHolder.loadProperties(PropertyHolder.java:246)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver.<init>(TaxonomyViewDriver.java:59)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver$TaxonomyRunnable.run(TaxonomyViewDriver.java:112)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
org.apache.commons.configuration.ConfigurationException: SAX Exception
caught
at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:163)
at
org.cnlp.utils.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:52)
at
org.cnlp.utils.properties.PropertyHolder.loadProperties(PropertyHolder.java:246)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver.<init>(TaxonomyViewDriver.java:59)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver$TaxonomyRunnable.run(TaxonomyViewDriver.java:112)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: org.apache.commons.configuration.ConfigurationException:
C:\ENG\Projects\AuthoringToolkit\conf\command.properties (The system
cannot find the file specified)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
at
org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.commons.digester.Digester.parse(Digester.java:1567)
at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:157)
---------------------------------------------
Here is what I get with the slash (<properties
fileName="/command.properties"/>):
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at
org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:258)
at
org.apache.commons.digester.CallMethodRule.end(CallMethodRule.java:505)
at org.apache.commons.digester.Rule.end(Rule.java:276)
at
org.apache.commons.digester.Digester.endElement(Digester.java:1058)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.commons.digester.Digester.parse(Digester.java:1567)
at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:157)
at
org.cnlp.utils.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:52)
at
org.cnlp.utils.properties.PropertyHolder.loadProperties(PropertyHolder.java:246)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver.<init>(TaxonomyViewDriver.java:59)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver$TaxonomyRunnable.run(TaxonomyViewDriver.java:112)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: org.apache.commons.configuration.ConfigurationException:
\command.properties (The system cannot find the file specified)
at
org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:128)
at
org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:63)
... 30 more
Caused by: java.io.FileNotFoundException: \command.properties (The
system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)
at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)
at java.net.URL.openStream(URL.java:913)
at
org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:123)
... 31 more
63 ERROR configuration.ConfigurationFactory - SAX Exception caught
org.apache.commons.configuration.ConfigurationException:
\command.properties (The system cannot find the file specified)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
at
org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.commons.digester.Digester.parse(Digester.java:1567)
at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:157)
at
org.cnlp.utils.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:52)
at
org.cnlp.utils.properties.PropertyHolder.loadProperties(PropertyHolder.java:246)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver.<init>(TaxonomyViewDriver.java:59)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver$TaxonomyRunnable.run(TaxonomyViewDriver.java:112)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
org.apache.commons.configuration.ConfigurationException: SAX Exception
caught
at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:163)
at
org.cnlp.utils.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:52)
at
org.cnlp.utils.properties.PropertyHolder.loadProperties(PropertyHolder.java:246)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver.<init>(TaxonomyViewDriver.java:59)
at
org.cnlp.authoring.taxonomy.view.swing.TaxonomyViewDriver$TaxonomyRunnable.run(TaxonomyViewDriver.java:112)
at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at
java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Caused by: org.apache.commons.configuration.ConfigurationException:
\command.properties (The system cannot find the file specified)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
at
org.apache.commons.digester.Digester.endElement(Digester.java:1061)
at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at
org.apache.commons.digester.Digester.parse(Digester.java:1567)
at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:157)
>>> [EMAIL PROTECTED] 11/15/2004 10:40:52 AM >>>
Grant,
do you work on Windows or on Unix? Which exception do you get when you
ommit the leading slash?
I supose the correct form would be just the name of the properties file
with a leading slash. But there seems to be a bug, so that such names
are interpreted as absolute file names and then the classpath is not
searched at all. I will have a closer look on that.
Oliver
Grant Ingersoll wrote:
> I have tried that, I get:
>
> 16 ERROR configuration.ConfigurationFactory - SAX Exception
caught
> org.apache.commons.configuration.ConfigurationException:
\my.properties (The system cannot find the file specified)
> at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
> at
org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
> at
org.apache.commons.digester.Digester.endElement(Digester.java:1061)
> at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
> at
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
Source)
> at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
> at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
> at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
> at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
> at
org.apache.commons.digester.Digester.parse(Digester.java:1567)
> at
org.apache.commons.configuration.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:157)
>
> Have also tried it w/o the leading slash.
>
> My ConfigurationFactory initialization is:
> URL configURL = getClass().getResource("/config.xml");
> if (configURL != null)
> {
> configFact.setConfigurationURL(configURL);
> }
>
> The config.xml file does not live in the same JAR as the
my.properties. Is this a ClassLoader issue? That is, does it not find
it b/c there are actually two separate class loaders involved? Doesn't
seem like that should be the issue, as Java is finding classes located
in the JAR in question.
>
> Thanks for your help,
> Grant
>
>
>>>>[EMAIL PROTECTED] 11/12/2004 9:35:00 AM >>>
>
> ConfigurationFactory can load property files from classpath. Did you
try
>
> <properties fileName="/my.properties"/> ?
>
> A couple of steps are performed to resolve the file: It is checked
> whether a full URL or an absolute or relative file name are provided.
If
> this fails, the classpath is searched for the specified file.
>
> HTH
> Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]