• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Mike Cheung
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47293
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic