ClassLoader cl = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(DescriptorFactory.class.getClassLoader());
ResourceXmlApplicationContext context = new ResourceXmlApplicationContext(
new UrlResource(url),
Arrays.asList(new Object[] { new XBeanProcessor() }));
Descriptor descriptor = (Descriptor) context.getBean("jbi");
checkDescriptor(descriptor);
return descriptor;
} finally {
Thread.currentThread().setContextClassLoader(cl);