Hi All,

Great work with JavaConfig it has allowed myself and my team to solve a lot of problems with our project that would difficult or impossible to do otherwise.

We are currently in the process of moving all of configuration from spring xml to spring java config but I am getting this error:

Code:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'userService': Requested bean is currently in creation: Is there an unresolvable circular reference?
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.beforeSingletonCreation(DefaultSingletonBeanRegistry.java:296)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:215)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:168)
	at org.springframework.config.java.context.TypeSafeBeanFactoryUtils.getBean(TypeSafeBeanFactoryUtils.java:74)
	at org.springframework.config.java.support.ConfigurationSupport.getBean(ConfigurationSupport.java:76)
	at com.symark.smc.service.impl.Config.userGroupService(Config.java:94)
	at com.symark.smc.service.impl.Config$$EnhancerByCGLIB$$548db0a3.CGLIB$appUserGroupService$5(<generated>)
	at com.symark.smc.service.impl.Config$$EnhancerByCGLIB$$548db0a3$$FastClassByCGLIB$$38617fed.invoke(<generated>)
	at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
	at org.springframework.config.java.enhancement.cglib.BeanMethodMethodInterceptor$1.invokeOriginalClass(BeanMethodMethodInterceptor.java:65)
	at org.springframework.config.java.core.MethodBeanWrapper.wrapResult(MethodBeanWrapper.java:118)
	at org.springframework.config.java.core.StandardBeanMethodProcessor.createNewOrGetCachedSingletonBean(StandardBeanMethodProcessor.java:82)
	... 137 more
There are ciruclar references in the configuration but this same configuration worked just fine as spring xml. All I had to do was extend the ApplicationContext and override the AllowRawInjectionDespiteWrapping property and set it to true.

I have done the samething with JavaConfigWebApplicationContext:

Code:
package com.product.web;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.config.java.context.JavaConfigWebApplicationContext;
public class MyWebApplicationContext extends JavaConfigWebApplicationContext {

	protected void customizeBeanFactory(DefaultListableBeanFactory beanFactory) {
		beanFactory.setAllowRawInjectionDespiteWrapping(true);
	}
}
And that is the class I am using in my web.xml, but it is erroring any help would be greatly appreicated.

Thanks,
Mike