0

このコードをエラーなしで使用できるようにクラスパスを構成するにはどうすればよいですか

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
4

1 に答える 1

2

選択Build Path > Use as Source Folderしてフォルダに適用しappContextます。Eclipse はプロジェクトの.classpathファイルにエントリを追加すると思います。

于 2013-09-13T11:45:51.233 に答える