These days I'm learning Spring Framework. And I'm following some youtube videos. According to the video I wrote my first code in Spring as same as the tutorial. But at a point I'm getting XmlBeanFactory deprecated warning which are not shown in tutorial.
I'm having two classes on MyPackage package.
package MyPackage;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.FileSystemResource;
public class DrawingApp {
public static void main(String[] args) {
// TODO Auto-generated method stub
BeanFactory factory=new XmlBeanFactory(new FileSystemResource("Spring.xml"));
Triangle triangle =(Triangle) factory.getBean("triangle");
triangle.draw();
}
}
Here my XmlBeanFactory is deprecated. I checked everywhere couldn't fix it
This is my Triangle class.
package MyPackage;
public class Triangle {
public void draw(){
System.out.println("Draw a Triangle");
}
}
And this is my xml file "spring.xml"
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<bean id="triangle" class="MyPackage.Triangle"></bean>
</beans>