commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <ebo...@apache.org>
Subject Re: Commons Configuration
Date Fri, 15 Feb 2008 11:37:41 GMT
Hi,

Did you try with Java 5 instead ? Is there another XML parser in the 
classpath besides the default one of Java 1.4 ?

Emmanuel Bourg


comctrl6 a écrit :
> 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

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


Mime
View raw message