Announcement Announcement Module
Collapse

JavaConfig forum decommissioned in favor of Core Container

As described at

http://static.springsource.org/sprin...fig/README.TXT

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:

http://static.springsource.org/sprin...tml#beans-java

For any questions related to @Configuration classes and @Bean methods in Spring 3.0, please post in the dedicated 'Core Container' forum at

http://forum.springsource.org/forumdisplay.php?f=26
See more
See less
about MethodInvokingFactoryBean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • about MethodInvokingFactoryBean

    hi,

    i try to convert spring xml beans to javaConfig, but had encounter an issue. I couldn't find any documentation about MethodInvokingFactoryBean for javaConfig.

    my code like this

    Code:
    	@Bean
    	public MethodInvokingFactoryBean ehCacheMBeanRegistration()
    	{
    		MethodInvokingFactoryBean bean = new MethodInvokingFactoryBean();		
    		bean.setStaticMethod("net.sf.ehcache.management.ManagementService.registerMBeans");
    		bean.setArguments(new Object[]{cacheManager(), mbeanServer(), true, true, true, true});
    		
    		return bean;
    	}
    however, it throw exception

    Code:
    org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'ehCacheMBeanRegistration': Requested bean is currently in creation: Is there an unresolvable circular reference?
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:297)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:216)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	.......
    any idea ?

    kiwi
    ----
    happy hacking !
Working...
X