You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/12/11 22:54:08 UTC

DO NOT REPLY [Bug 25459] New: - [Configuration] Documentation Issue

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25459>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25459

[Configuration] Documentation Issue

           Summary: [Configuration] Documentation Issue
           Product: Commons
           Version: unspecified
          Platform: Other
               URL: http://jakarta.apache.org/commons/sandbox/configuration/
                    examples.html
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Sandbox
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: timreilly@spherion.com


I think there's an error in the documentation for commons-configuration 
examples page.
If I use this example:
   ConfigurationFactory factory = new ConfigurationFactory();
   URL configURL = getClass().getResource("/config.xml");
   factory.setConfigurationFileName(configURL.toString());
   Configuration config = factory.getConfiguration();

I get a NPE, but if I change to this:
  ConfigurationFactory factory = new ConfigurationFactory();
  URL configURL = getClass().getResource("/config.xml");
- factory.setConfigurationFileName(configURL.toString());
+ factory.setConfigurationFileName(configURL.getFile());
  Configuration config = factory.getConfiguration();

everthing is fine. Basically, the setConfigFileName in ConfigurationFactory is 
not expecting a URI its expecting a path i think?

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