Is this a bug?

fun main(args: Array<String>) {
    var application =
        runApplication<SpringDemoApplication>(*args) as AnnotationConfigServletWebServerApplicationContext
    var urls = arrayOf(File("/home/HouXinLin/project/java/GradleDemo/build/libs/GradleDemo-1.0-SNAPSHOT.jar").toURI().toURL())

    var urlClassLoader_1 = URLClassLoader(urls)
    var urlClassLoader_2 = URLClassLoader(urls)

    var testClass1 = urlClassLoader_1.loadClass("com.hxl.test.TestClass")
    application.registerBean(testClass1, BeanDefinitionCustomizer {  })
    println(application.getBean(testClass1))//ok

    application.removeBeanDefinition("com.hxl.test.TestClass")
    var testClass2 = urlClassLoader_2.loadClass("com.hxl.test.TestClass")
    application.registerBean(testClass2, BeanDefinitionCustomizer {  })
    println(application.getBean(testClass2))// No qualifying bean of type 'com.hxl.test.TestClass' available
}

Why did this error occur?Is it my code problem? Or spring internal reasons

 No qualifying bean of type 'com.hxl.test.TestClass' available

Comment From: snicoll

Thanks for getting in touch, but it feels like this is a question that would be better suited to Stack Overflow. As mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.