ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("RentABike-context.xml"); CommandLineView clv = (CommandLineView)ctx.getBean("commandLineView"); clv.printAllBikes();