私は本ProSpring3をフォローしてSpring3を学ぼうとしています。私は第4章にいて、著者がIoCとDIについて説明しています。彼はGenericXmlApplicationContextを使用して構成ファイルを指定します。彼は次のことをします:
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();
    }
}
私の構造は
src / main / resources / app-context-annotation.xml
クラスパスリソース[app-context-annotation.xml]からXMLドキュメントを解析するIOException; ネストされた例外はjava.io.FileNotFoundExceptionです:クラスパスリソース[app-context-annotation.xml]が存在しないため、開くことができません