aspose file tools*
The moose likes Java in General and the fly likes ConfigurationUtils.locate(): base is null, name is config.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "ConfigurationUtils.locate(): base is null, name is config.xml" Watch "ConfigurationUtils.locate(): base is null, name is config.xml" New topic
Author

ConfigurationUtils.locate(): base is null, name is config.xml

Mike Cheung
Ranch Hand

Joined: Feb 01, 2013
Posts: 74
Hi, sorry if this may appear to be too simple for everyone but I am stuck with an Apache commons issue. Following code works fine and dandy but as soon as I add the following bolded line, I'm getting a lot of stuff in the output file (pasted below). Any idea why this is the case?
Configuration config = factory.getConfiguration(true);

Also not sure why but if you look at the log.log section, there are 2 lines listing the following, Netbeans somehow is thinking the config.xml is under Testapp.jar!/config.xml rather than Testapp.jar/config.xml. Why is this the case? Any idea?
Base path set to jar:file:/C:/Users/test/Documents/NetBeansProjects/rsa-read-only/Testapp/dist/Testapp.jar!/config.xml

Not sure if it makes any difference, I have the following files structure.
C:\Users\test\Documents\NetBeansProjects\rsa-read-only\Testapp\src\application.properties
C:\Users\test\Documents\NetBeansProjects\rsa-read-only\Testapp\src\config.xml
C:\Users\test\Documents\NetBeansProjects\rsa-read-only\Testapp\src\log4j.properties
C:\Users\test\Documents\NetBeansProjects\rsa-read-only\Testapp\src\test\Testapp.java

I have the following Libraries added.
commons-configuration-1.9.jar
log4j-1.2.17.jar
commons-logging-1.1.1.jar
commons-lang-2.6.jar
commons-beanutils-1.8.3.jar
commons-beanutils-bean-collections-1.8.3.jar
commons-beanutils-core-1.8.3.jar
commons-configuration-1.9.jar

Testapp.java


config.xml


log.log
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38363
    
  23
Mike Cheung wrote:Hi, sorry if this may appear to be too simple for everyone . . .
Flattery will get you anywhere, but it is far too difficult for “beginning Java”. Shall move it, but not sure where the best place to put it is.

And welcome to the Ranch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ConfigurationUtils.locate(): base is null, name is config.xml