summaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2023-01-03 13:05:03 +0100
committergjoranv <gv@verizonmedia.com>2023-01-09 13:00:04 +0100
commit516a0b0c6ab03e9a6f42b4f08f6964db90970a21 (patch)
tree4fc963380c34f2275a74cea71a2ee85c3ca86891 /container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
parentbe55b80e2c1af8ce7e1d640c7de6cb642281fb9a (diff)
Include list of installed application bundles in error message
Diffstat (limited to 'container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java')
-rw-r--r--container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
index 2c7a0c2b86b..f0f9de9fe36 100644
--- a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
+++ b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
@@ -67,8 +67,8 @@ public class OsgiImpl implements Osgi {
}
/**
- * Tries to resolve the given class from this class' bundle classloader.
- * If unsuccessful, resolves the class from .
+ * Tries to resolve the given class from this class' bundle.
+ * If unsuccessful, resolves the class from the system bundle (jdisc_core).
*/
@SuppressWarnings("unchecked")
private Class<Object> resolveFromThisBundleOrSystemBundle(BundleInstantiationSpecification spec) {
@@ -86,9 +86,14 @@ public class OsgiImpl implements Osgi {
}
}
throw new IllegalArgumentException(
- "Could not create a component with id '" + spec.classId.getName() + "'. Tried to load class directly, " +
- "since no bundle was found for spec: " + spec.bundle + ". If a bundle with the same name is installed, " +
- "there is a either a version mismatch or the installed bundle's version contains a qualifier string.");
+ "Could not create a component with id '" + spec.classId.getName() +
+ "'. Tried to load class directly, since no bundle was found for spec: " + spec.bundle +
+ ". " + bundleResolutionErrorMessage());
+ }
+
+ protected String bundleResolutionErrorMessage() {
+ return " If a bundle with the same name is installed, there is a either a version mismatch " +
+ "or the installed bundle's version contains a qualifier string.";
}
@SuppressWarnings("unchecked")