Do me a favor and change the following.
Remove the try catch, no Idea why you need that there. It looks to me like you are trying things out, and the exception if thrown will be printed out anyway.
change
BeanFactory beanFactory = null;
beanFactory = new ClassPathXmlApplicationContext("bean-prac-cfg.xml");
so your code to start should look like this
That is much cleaner and what
you should be doing using either Spring 2.5.6 or Spring 3.x
If you are trying to learn on an older version of Spring, I recommend using the latest.
Mark