From e0194dcac59fd656856f63030301012020ca77c9 Mon Sep 17 00:00:00 2001 From: Hongze Zhang Date: Thu, 9 Jan 2025 11:13:09 +0800 Subject: [PATCH] [GLUTEN-8462][CORE] Raise a meaningful error when no component is found from classpath (#8468) --- .../main/scala/org/apache/gluten/component/package.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gluten-core/src/main/scala/org/apache/gluten/component/package.scala b/gluten-core/src/main/scala/org/apache/gluten/component/package.scala index 032a32d04121..cf0181c39cf1 100644 --- a/gluten-core/src/main/scala/org/apache/gluten/component/package.scala +++ b/gluten-core/src/main/scala/org/apache/gluten/component/package.scala @@ -37,6 +37,12 @@ package object component extends Logging { // Output log so user could view the component loading order. // Call #sortedUnsafe than on #sorted to avoid unnecessary recursion. val components = Component.sortedUnsafe() + require( + components.nonEmpty, + s"No component files found in container directories named with " + + s"'META-INF/gluten-components' from classpath. JVM classpath value " + + s"is: ${System.getProperty("java.class.path")}" + ) logInfo(s"Components registered within order: ${components.map(_.name()).mkString(", ")}") } }