This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Comment

I get the exact same exception with Spring 3.0.0.M3 and java-config 1.0.0.M4 while it works just fine if I switch to Spring 2.5.6.

It indeed appears to be a version problem as the default Autowire value defined in the @Configuration interface (Autowire.INHERITED) doesn't exist in Spring-beans 3.0.0.M3 org.springframework.beans.factory.annotation.Autow ire (this enum only has 3 values : NO, BY_TYPE and BY_NAME)

If CGLIB is not used, then scoping semantics for @Bean methods cannot be managed by the framework. In the case above, it means that all calls to foo() will essentially be prototype-scoped. If this works for you, go for it.