try {
FederationConfigurator configurator = new FederationConfigurator();
final URL resource = Thread.currentThread().getContextClassLoader()
.getResource(CONFIG_FILE);
File f = new File(resource.toURI());
configurator.loadConfig(f);
return configurator.getFederationContext(context);
} catch (Exception e) {
e.printStackTrace();
return null;
}