This is an automated email from the ASF dual-hosted git repository.

sergeykamov pushed a commit to branch NLPCRAFT-315
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git

commit 69eda8c912353270910e53d5e20fac30abec7bea
Author: Sergey Kamov <[email protected]>
AuthorDate: Mon May 3 18:18:17 2021 +0300

    WIP.
---
 .../scala/org/apache/nlpcraft/common/config/NCConfigurable.scala   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
index 7fcab34..446d240 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/config/NCConfigurable.scala
@@ -20,6 +20,8 @@ package org.apache.nlpcraft.common.config
 import com.typesafe.config.{Config, ConfigFactory}
 import com.typesafe.scalalogging.LazyLogging
 import org.apache.nlpcraft.common._
+import org.apache.nlpcraft.common.util.NCUtils
+import org.apache.nlpcraft.common.util.NCUtils.getClass
 
 import java.io.File
 import java.net.{MalformedURLException, URL}
@@ -316,7 +318,10 @@ object NCConfigurable extends LazyLogging {
                     case _: MalformedURLException ⇒ // No-op.
                 }
 
-                cfg = cfg.withFallback(ConfigFactory.parseResources(name))
+                val allRes = getClass.getClassLoader.getResources(name)
+
+                if (allRes != null)
+                    allRes.asScala.foreach(res ⇒ cfg = 
cfg.withFallback(ConfigFactory.parseURL(res)))
 
                 if (dfltCfg.isDefined)
                     cfg = cfg.withFallback(dfltCfg.get)

Reply via email to