I'm trying to learn Spring3 by following book Pro Spring3. I'm in chapter 4 where the author explains IoC and DI. He uses GenericXmlApplicationContext to specify the configuration file. He does the following:
package com.apress.prospring3.ch4;
import org.springframework.context.support.GenericXmlApplicationContext;
public class UsingSetterInjection {
public static void main(String[] args) {
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
//ctx.load("classpath:app-context-xml.xml");
ctx.load("classpath:app-context-annotation.xml");
ctx.refresh();
MessageRenderer messageRenderer = ctx.getBean("messageRenderer", MessageRenderer.class);
messageRenderer.render();
}
}
My structure is
src/main/resources/app-context-annotation.xml
IOException parsing XML document from class path resource [app-context-annotation.xml]; nested exception is java.io.FileNotFoundException: class path resource [app-context-annotation.xml] cannot be opened because it does not exist