summaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
diff options
context:
space:
mode:
authorgjoranv <gv@verizonmedia.com>2023-01-06 10:49:29 +0100
committergjoranv <gv@verizonmedia.com>2023-01-11 10:40:33 +0100
commita09f6289a86465f754311a51e9dd3f5b64b99108 (patch)
treea12dc1471160a5a7a13ce42536723e3ea4fc8376 /container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
parente420f57dc74c53fb64bb6bf60b5180676b070b50 (diff)
Don't attempt to lookup class in internal bundles if a bundle was explicitly specified.
(Only for the felix framework. Internal test frameworks still load classes from the system bundles only.)
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.java5
1 files changed, 5 insertions, 0 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 4acdc3d544b..9d023e2a7ca 100644
--- a/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
+++ b/container-core/src/main/java/com/yahoo/osgi/OsgiImpl.java
@@ -62,6 +62,11 @@ public class OsgiImpl implements Osgi {
if (bundle != null) {
return resolveFromBundle(spec, bundle);
} else {
+ if (jdiscOsgi.isFelixFramework() && ! spec.bundle.equals(spec.classId)) {
+ // Bundle was explicitly specified, but not found.
+ throw new IllegalArgumentException("Could not find bundle " + spec.bundle + " to create a component with class '"
+ + spec.classId.getName() + ". " + bundleResolutionErrorMessage(spec.bundle));
+ }
return resolveFromThisBundleOrSystemBundle(spec);
}
}