@EnableAutoConfiguration uses the bean class loader. @ImportAutoConfiguration uses the class loader of ImportAutoConfigurationImportSelector.class. Both should use the bean class loader.