Ensure ClassLoader is set in BeanFactory