**[Gildas Cuisinier](https://jira.spring.io/secure/ViewProfile.jspa?name=hikage)** opened **[SPR-6638](https://jira.spring.io/browse/SPR-6638?redirect=false)** and commented In http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html#beans-java-instantiating-container-register : ``` public static void main(String[] args) { ApplicationContext ctx = new AnnotationConfigApplicationContext(); ctx.register(AppConfig.class, OtherConfig.class); ctx.register(AdditionalConfig.class); ctx.refresh(); MyService myService = ctx.getBean(MyService.class); myService.doStuff(); } ``` The register method is defined on AnnotationConfigApplicationContext and not ApplicationContext interface. The code must be : ``` public static void main(String[] args) { AnnotationConfigApplicationContext = new AnnotationConfigApplicationContext(); ctx.register(AppConfig.class, OtherConfig.class); ctx.register(AdditionalConfig.class); ctx.refresh(); MyService myService = ctx.getBean(MyService.class); myService.doStuff(); } ``` --- **Affects:** 3.0 GA **Referenced from:** commits https://github.com/spring-projects/spring-framework/commit/f7b0a2c0a218a1278ae1c71d340a99e60d69128e