春のコンテキストに非常に奇妙な問題があります。
public static void main(String[] args) {
File file = new File("/home/user/IdeaProjects/Refactor/src/spring-cfg.xml");
System.out.println("Exist "+file.exists());
System.out.println("Path "+file.getAbsoluteFile());
ApplicationContext context = new ClassPathXmlApplicationContext(file.getAbsolutePath());
コンソールに表示:
Exist true
Path /home/user/IdeaProjects/Refactor/src/spring-cfg.xml
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [home/user/IdeaProjects/Refactor/src/spring-cfg.xml]; nested exception is java.io.FileNotFoundException: class path resource [home/user/IdeaProjects/Refactor/src/spring-cfg.xml] cannot be opened because it does not exist