-
Bug
-
Resolution: Done
-
Medium
-
Frankfurt Release
-
None
When USE_SCRIPT_COMPILATION_CACHE is set to false the classLoader is closed after the class is instantiated. This is causing an issue when lazy loading is happening during the script execution.
Lazy loading occurs when a suspendible function returning something is called from "processNB", kotlin will create a second class that will be loaded during execution (needs to be in the classpath during execution).
Here's a sample script reproducing the error
package cba.RuntimeCBA import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.processor.ResourceAssignmentProcessor import org.onap.ccsdk.cds.blueprintsprocessor.functions.resource.resolution.utils.ResourceAssignmentUtils import org.onap.ccsdk.cds.controllerblueprints.resource.dict.ResourceAssignment import org.slf4j.LoggerFactory open class RResolution : ResourceAssignmentProcessor() { private val log = LoggerFactory.getLogger(RResolution::class.java)!! override fun getName(): String { return "RResolution" } override suspend fun processNB(resourceAssignment: ResourceAssignment) { log.info("Start resolving RResolution") // Set resulting value val retValue = getRetsolvedValue(resourceAssignment) ResourceAssignmentUtils.setResourceDataValue(resourceAssignment, raRuntimeService, retValue) } suspend fun getResolvedValue(resourceAssignment: ResourceAssignment): String { return "resolved value 8" } override suspend fun recoverNB(runtimeException: RuntimeException, resourceAssignment: ResourceAssignment) { log.info("Recovering RResolution") // Nothing to do at this point } }