Uhmm ... I have not succeeded with the gist, but I have just created a small project that can be cloned:
https://github.com/pleira/ds-config-file.git Move the file myconfig.properties to D:/EMOS.web/cfg/myconfig.properties and launch the test. I get: 26.11.2014 15:41:51 org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener testStarted INFO: [run] com.pleira.MyConfigFileTest#testGetPropertyFileName 26.11.2014 15:41:51 org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener testFailure INFO: [failed] com.pleira.MyConfigFileTest#testGetPropertyFileName message: expected:<somevalue> but was:<null> 26.11.2014 15:41:51 org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener testFinished INFO: [finished] com.pleira.MyConfigFileTest#testGetPropertyFileName On Wed, Nov 26, 2014 at 2:41 PM, John D. Ament <[email protected]> wrote: > For the second option, can you post a gist w/ log file output? > > On Wed Nov 26 2014 at 8:35:58 AM Pablo Pita <[email protected]> wrote: > > > As I am on Windows, and I have been using thiese kind of > > PropertyFileConfig's without success: > > > > 1.- > > > > public class MyConfigFile implements PropertyFileConfig { > > > > @Override > > public String getPropertyFileName() { > > return "D:\\web\\cfg\\my.properties"; > > } > > > > } > > > > 2.- returning the file:// : > > > > public class MyConfigFile implements PropertyFileConfig { > > > > @Override > > public String getPropertyFileName() { > > return "file:///D:/web/cfg/my.properties"; > > } > > > > } > > > > Can you succeed loading the properties with a full file path? > > > > Pablo Pita > > > > > > > > On Wed, Nov 26, 2014 at 2:27 PM, John D. Ament <[email protected]> > > wrote: > > > > > What value did you provide? All of the property file loading is done > via > > > URLs, so if I had to guess you need file:// > > > > > > > > > https://github.com/apache/deltaspike/blob/master/ > > deltaspike/core/api/src/main/java/org/apache/deltaspike/ > > core/util/PropertyFileUtils.java > > > > > > John > > > > > > > > > On Wed Nov 26 2014 at 7:47:22 AM Pablo Pita <[email protected]> > > wrote: > > > > > > > Hello, > > > > > > > > I would like to use DeltaSpike configuration mechanisms using a > > > properties > > > > file which is not in the classpath. I had no success by implementing > > > > MyPropertyFileConfig and returning the absolute path of the file in > the > > > > String getPropertyFileName() method. Is there a simple way to load a > > > > property file that is not in the classpath? > > > > > > > > Thanks for any hints, > > > > -- > > > > Pablo Pita Leira > > > > > > > > > > > > > > > -- > > Pablo Pita Leira > > > -- Pablo Pita Leira
