java - 在eclipse中配置classpath
如何配置类路径,以便我可以使用此代码而不会出现错误
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
ctx.load("classpath:appContext/messageSource.xml");
我现在得到的错误是
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
最佳答案:
1 个答案:
答案 0 :(得分:2)
选择Build Path > Use as Source Folder
并将其应用于appContext
文件夹。我相信Eclipse在项目的.classpath
文件中添加了一个条目,这符合您的最佳利益。
本文经用户投稿或网站收集转载,如有侵权请联系本站。