java解决循环依赖


package com.xQuant.m2.foundation.context;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.web.context.support.XmlWebApplicationContext;


public class TolerantXmlWebApplicationContext extends XmlWebApplicationContext {

@Override
protected DefaultListableBeanFactory createBeanFactory() {
DefaultListableBeanFactory beanFactory = super.createBeanFactory();
beanFactory.setAllowRawInjectionDespiteWrapping(true);
return beanFactory;
}
}

猜你喜欢

转载自www.cnblogs.com/eternal-X/p/12482342.html