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
I also got the same issue. I solved it using this way.
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("Bean.xml");
HelloWorld obj =(HelloWorld)context.getBean("helloWorld");
obj.getMessage();
((AbstractApplicationContext) context).registerShutdownHook();
}