0

How can I configure the classpath so I can use this code without errors

GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
ctx.load("classpath:appContext/messageSource.xml");

the error I get now is

Exception in thread "main" 
org.springframework.beans.factory.BeanDefinitionStoreException:
IOException parsing XML document from class path resource [messageSource.xml]; 
nested exception is java.io.FileNotFoundException: class path resource 
[messageSource.xml] cannot be opened because it does not exist
4

1 回答 1

2

选择Build Path > Use as Source Folder一个将其应用到appContext文件夹。我相信 Eclipse 在项目.classpath文件中添加了一个条目,这符合您的最大利益。

于 2013-09-13T11:45:51.233 回答