aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/osgi
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2023-01-03 13:05:03 +0100
committergjoranv <gv@verizonmedia.com>2023-01-06 09:30:48 +0100
commit9cdfc22741f1f7935ed04d1a78288446d0dc4568 (patch)
tree22677e94a3f05a36ad7f47d5b80f5c59c7af168b /container-core/src/main/java/com/yahoo/osgi
parent1319d959d05779da814bf8109c6af1279366bf54 (diff)
Include list of installed application bundles in error message
Diffstat (limited to 'container-core/src/main/java/com/yahoo/osgi')
-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")