Old:
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;
// This fails in Spring 6.1
XmlBeanFactory factory = new XmlBeanFactory(new ClassPathResource("beans.xml"));
New:
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.core.io.ClassPathResource;
// Use the modern definition reader
DefaultListableBeanFactory factory = new DefaultListableBeanFactory();
XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(factory);
reader.loadBeanDefinitions(new ClassPathResource("beans.xml"));
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)