ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext*.xml"); Bean bean=(IZoneJobTasksService) ctx.getBean("zoneJobTasksService");