From 6a37d3028f95baf9f61f97725f7e46913af11668 Mon Sep 17 00:00:00 2001 From: Maksim Pelevin Date: Fri, 4 Aug 2023 09:12:18 +0300 Subject: [PATCH] Block parent classloader for instrumentation process #2477 --- .../kotlin/org/utbot/framework/process/EngineProcessMain.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineProcessMain.kt b/utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineProcessMain.kt index a2d54d6511..d495764475 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineProcessMain.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineProcessMain.kt @@ -74,9 +74,10 @@ private var idCounter: Long = 0 private fun EngineProcessModel.setup(kryoHelper: KryoHelper, watchdog: IdleWatchdog, realProtocol: IProtocol) { val model = this watchdog.measureTimeForActiveCall(setupUtContext, "UtContext setup") { params -> + // we use parent classloader with null to disable autoload classes from system classloader UtContext.setUtContext(UtContext(URLClassLoader(params.classpathForUrlsClassloader.map { File(it).toURI().toURL() - }.toTypedArray()))) + }.toTypedArray(), null))) } watchdog.measureTimeForActiveCall(getSpringBeanDefinitions, "Getting Spring bean definitions") { params -> try {