Why FileSystemXmlApplicationContext throws FileNotFoundException on file that exists
java, linux, spring
Solution
Try creating a FileSystemXmlApplicationContext using a Url, like:
new FileSystemXmlApplicationContext("file:/data/farm/Server/confData/1000004/contex.xml");
For further explanation see this: http://static.springsource.org/spring/docs/3.0.0.M3/spring-framework-reference/html/ch05s07.html 5.7.3 FileSystemResource caveats
Problem
I'm running the following code: ``` new FileSystemXmlApplicationContext("/data/farm/Server/confData/1000004/contex.xml") ``` and it throws ``` java.io.FileNotFoundException: class path resource [data/farm/Server/confData/1000004/contex.xml] cannot be opened because it does not exist ``` The file exists, I can do ``` cat /data/farm/Server/confData/1000004/contex.xml ``` and see its content. Also in windows this code is working - the problem is in linus (i have ubuntu os) Can any one advise what is wrong here?