user1072680
user1072680

Reputation:

configure classpath in eclipse

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

Upvotes: 0

Views: 327

Answers (1)

Konstantin Yovkov
Konstantin Yovkov

Reputation: 62874

Pick Build Path > Use as Source Folder an apply it to the appContext folder. I believe Eclipse adds an entry in the project's .classpath file, which is in your best interest.

Upvotes: 2

Related Questions