Announcement Announcement Module

JavaConfig forum decommissioned in favor of Core Container

As described at

key features of the Spring JavaConfig project have been migrated into the core Spring Framework as of version 3.0.

Please see the Spring 3.0 documentation on @Configuration and @Bean support:

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at
See more
See less
RequiredAnnotationBeanPostProcessor always runs contrary to documentation Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • RequiredAnnotationBeanPostProcessor always runs contrary to documentation

    The JavaDoc for @AnnotationDrivenConfig says

    Note: Unlike its <context:annotation-config/> XML counterpart, this annotation does not trigger the detection and handling of @Required methods. Due to fundamental differences between how JavaConfig and XML work, this must be enabled via AspectJ. See RequiredMethodInvocationTracker for more details. ...
    However I get the following exception when using this annotation (I need it for @Autowired support)

     org.springframework.beans.factory.BeanInitializationException: Property 'sessionFactory' is required for bean 'versionInfoProvider'
    	at org.springframework.beans.factory.annotation.RequiredAnnotationBeanPostProcessor.postProcessPropertyValues(
    	... 13 more
    I'm trying to migrate from XML configuration to Java configuration and I don't want to have to remove the @Required annotation from existing classes.

    I do not need the @Required checking for Java configuration.