private <T extends Object> T getService(Class<T> clazz)
throws ServiceNotFoundException, ContextNotActiveException {
T bean = null;
try {
if(!this.servicesCtx.isRunning()) {
throw new ContextNotActiveException("#### Context is not RUNNING....");
}
if(!this.servicesCtx.isActive()) {
throw new ContextNotActiveException("#### Context is not ACTIVE....");
}
bean = this.servicesCtx.getBean(clazz);
} catch(NoSuchBeanDefinitionException ex) {
this.servicesCtx.setConfigLocation("services-config.xml");
this.servicesCtx.stop();