Source:
<code>public ElideDynamicEntityCompiler(String path, DBPasswordExtractor dbPasswordExtractor) throws Exception { if (DynamicConfigHelpers.isNullOrEmpty(path)) { throw new IllegalArgumentException("Config path is null"); } HandlebarsHydrator hydrator = new HandlebarsHydrator(); DynamicConfigValidator dynamicConfigValidator = new DynamicConfigValidator(path); dynamicConfigValidator.readAndValidateConfigs(); ElideTableConfig tableConfig = dynamicConfigValidator.getElideTableConfig(); ElideSecurityConfig securityConfig = dynamicConfigValidator.getElideSecurityConfig(); ElideDBConfig elideSQLDBConfig = dynamicConfigValidator.getElideSQLDBConfig(); tableClasses = hydrator.hydrateTableTemplate(tableConfig); securityClasses = hydrator.hydrateSecurityTemplate(securityConfig); for (Entry<String, String> entry : tableClasses.entrySet()) { classNames.add(PACKAGE_NAME + entry.getKey()); } for (Entry<String, String> entry : securityClasses.entrySet()) { classNames.add(PACKAGE_NAME + entry.getKey()); } StringBuilder sb = new StringBuilder(); Enumeration<URL> resources = Thread.currentThread().getContextClassLoader().getResources("/"); while (resources.hasMoreElements()) { URL url = resources.nextElement(); String fileName = url.getFile(); sb.append(fileName.substring(0, fileName.lastIndexOf("!"))).append(File.pathSeparator); } String classpath = sb.toString(); if (classpath != null && !classpath.equals("")) { log.debug("Classpath = " + classpath); compiler.useOptions("-classpath", sb.toString()); } <START> compiler.useParentClassLoader(Thread.currentThread().getContextClassLoader()); <END> compile(); elideSQLDBConfig.getDbconfigs().forEach(config -> { connectionDetailsMap.put(config.getName(), new ConnectionDetails(getDataSource(config, dbPasswordExtractor), config.getDialect())); }); }</code><technical_language>some strong recommendations context class loader instead this.class.getClassLoader instead: <LINK_0>,currentThread()</technical_language>

Target:
public ElideDynamicEntityCompiler(String path, DBPasswordExtractor dbPasswordExtractor) throws Exception { if (DynamicConfigHelpers.isNullOrEmpty(path)) { throw new IllegalArgumentException("Config path is null"); } HandlebarsHydrator hydrator = new HandlebarsHydrator(); DynamicConfigValidator dynamicConfigValidator = new DynamicConfigValidator(path); dynamicConfigValidator.readAndValidateConfigs(); ElideTableConfig tableConfig = dynamicConfigValidator.getElideTableConfig(); ElideSecurityConfig securityConfig = dynamicConfigValidator.getElideSecurityConfig(); ElideDBConfig elideSQLDBConfig = dynamicConfigValidator.getElideSQLDBConfig(); tableClasses = hydrator.hydrateTableTemplate(tableConfig); securityClasses = hydrator.hydrateSecurityTemplate(securityConfig); for (Entry<String, String> entry : tableClasses.entrySet()) { classNames.add(PACKAGE_NAME + entry.getKey()); } for (Entry<String, String> entry : securityClasses.entrySet()) { classNames.add(PACKAGE_NAME + entry.getKey()); } compiler.useParentClassLoader(getClass().getClassLoader()); compile(); elideSQLDBConfig.getDbconfigs().forEach(config -> { connectionDetailsMap.put(config.getName(), new ConnectionDetails(getDataSource(config, dbPasswordExtractor), config.getDialect())); }); }