I'm trying to change path of cache.ccf file about an hour...
When I'm calling JCS.getInstance("myRegion");
I'm getting this error:
Exception in thread "main" java.lang.IllegalStateException: Failed to load properties for name [/cache.ccf]
I tried to put cache.ccf into src folder. In this case everything's OK. But I want it to be in ./config/
directory, not in ./src
. I tried to change config file name:
JCS.setConfigFilename("../config/cache.ccf");
But it's not working and I'm getting the same error:
Exception in thread "main" java.lang.IllegalStateException: Failed to load properties for name [../config/cache.ccf]
It seams that JCS tries to find the file named "../config/cache.ccf"
in src directory.
Here i found this sentence:
The classpath should include the directory where this file is located or the file should be placed at the root of the classpath, since it is discovered automatically.
But my applilcation don't work even if cache.ccf file is in the root directory of project.
How can I change cache.ccf file's path?
You may want to check your classpath. Seems like only src is in the classpath and not config folder. For me I have my *.ccf files placed in config directory which is in my classpath and I need only to specify the path to the ccf file as /client_cache.ccf for JCS to pick it up.
It also depends on your deployment environment. However if you have /config listed in your classpath it should work.