commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From comctrl6 <comct...@yahoo.com>
Subject Commons Configuration
Date Wed, 13 Feb 2008 20:40:57 GMT
Hello,

The following code sample adapted from the Configuration
test suite, throws a NullPointerException. The exception seems to be
thrown from the "crimson" XML parser, but I'm not sure what the problem
is exactly. Any idea what is going on?

Note: 
- The file
"test.plist.xml" exists and it could be referenced from the Java file.
The file is taken from the Configuration test cases.
- The following
libraries are included in the classpath: commons-collections,
commons-configuration, commons-lang-2.3, commons-logging.
- Compiling against Java 1.4.
- Mac OS X 1.4.11


public static main(String[] args) {

    try {
       FileConfiguration config = new XMLPropertyListConfiguration();
   
     config.setFileName("test.plist.xml");
        config.load();
    } catch (ConfigurationException e) {
        e.printStackTrace();
    }

}


Exception is as follows:


org.apache.commons.configuration.ConfigurationException: Unable to parse the configuration
file
    at org.apache.commons.configuration.plist.XMLPropertyListConfiguration.load(XMLPropertyListConfiguration.java:247)
   
at
org.apache.commons.configuration.AbstractHierarchicalFileConfiguration$FileConfigurationDelegate.load(AbstractHierarchicalFileConfiguration.java:443)
    at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:356)
    at
 org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:322)
    at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:285)
    at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:217)
    at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:195)
   
at
org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.load(AbstractHierarchicalFileConfiguration.java:164)
    at ConfigTester.main(ConfigTester.java:19)
Caused by: java.lang.NullPointerException
    at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:691)
    at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
    at
 org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
    at org.apache.commons.configuration.plist.XMLPropertyListConfiguration.load(XMLPropertyListConfiguration.java:243)
    ... 8 more

Thanks.



      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message