</BUG>
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(ServerFactoryBean.class.getClassLoader());
<BUG>Server server = factory.create();
return new ExportResult(endpointProps, new ServerWrapper(server));
} catch (Exception e) {
return new ExportResult(endpointProps, e);</BUG>
} finally {
Thread.currentThread().setContextClassLoader(oldClassLoader);

if (contextRoot != null) {
httpServiceManager.registerServlet(bus, contextRoot, callingContext, sref);
}
return bus;
}
protected Endpoint createServerFromFactory(ServerFactoryBean factory, Map<String, Object> endpointProps) {
ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(ServerFactoryBean.class.getClassLoader());
Server server = factory.create();
EndpointDescription epd = new EndpointDescription(endpointProps);
return new ServerWrapper(epd, server);
} finally {
Thread.currentThread().setContextClassLoader(oldClassLoader);
