I am following this tutorial online to the letter. http://www.tutorialspoint.com/spring/spring_bean_life_cycle.htm
But I get the errors when using Eclipse when I get to
Here is the code that worked for me.
package arjun;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.FileSystemResource;
public class Main {
public static void main(String[] args) {
AbstractApplicationContext context= new ClassPathXmlApplicationContext("spring.xml");
context.registerShutdownHook();
Triangle triangle=(Triangle) context.getBean("triangle");
triangle.draw();
}
}