Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2014-12-12 08:56:33 -0500
committerJan Bartel2014-12-12 08:56:33 -0500
commit32c27d146c1597c4576de0f6f8ce1851cf8ed509 (patch)
treeacf9a02b52b33d839fbfb41ee183c5d3108519b4 /jetty-osgi/jetty-osgi-boot/src
parenteb06d7cf5f81c6f99902dbe0826a7fd297ff790f (diff)
downloadorg.eclipse.jetty.project-32c27d146c1597c4576de0f6f8ce1851cf8ed509.tar.gz
org.eclipse.jetty.project-32c27d146c1597c4576de0f6f8ce1851cf8ed509.tar.xz
org.eclipse.jetty.project-32c27d146c1597c4576de0f6f8ce1851cf8ed509.zip
454954 Jetty osgi should skip fragment and required bundles that are in the uninstalled state
Diffstat (limited to 'jetty-osgi/jetty-osgi-boot/src')
-rw-r--r--jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java8
-rw-r--r--jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java4
-rw-r--r--jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java3
3 files changed, 15 insertions, 0 deletions
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
index 254a853892..08eca6c2b8 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/annotations/AnnotationConfiguration.java
@@ -103,6 +103,10 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot
//index and scan fragments
for (Bundle bundle : fragAndRequiredBundles)
{
+ //skip bundles that have been uninstalled since we discovered them
+ if (bundle.getState() == Bundle.UNINSTALLED)
+ continue;
+
Resource bundleRes = oparser.indexBundle(bundle);
if (!context.getMetaData().getWebInfJars().contains(bundleRes))
{
@@ -127,6 +131,10 @@ public class AnnotationConfiguration extends org.eclipse.jetty.annotations.Annot
//scan the required bundles
for (Bundle requiredBundle : fragAndRequiredBundles)
{
+ //skip bundles that have been uninstalled since we discovered them
+ if (requiredBundle.getState() == Bundle.UNINSTALLED)
+ continue;
+
if (requiredBundle.getHeaders().get(Constants.FRAGMENT_HOST) == null)
{
//a bundle indeed:
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java
index 3d006779cc..a5e8f11fe1 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java
@@ -174,6 +174,10 @@ public class OSGiWebInfConfiguration extends WebInfConfiguration
for (Bundle b : bundles)
{
+ //skip bundles that are not installed
+ if (b.getState() == Bundle.UNINSTALLED)
+ continue;
+
//add to context attribute storing associated fragments and required bundles
fragsAndReqsBundles.add(b);
File f = BundleFileLocatorHelperFactory.getFactory().getHelper().getBundleInstallLocation(b);
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java
index 8f22f9768d..7469bc529c 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/internal/serverfactory/DefaultJettyAtJettyHomeHelper.java
@@ -128,6 +128,9 @@ public class DefaultJettyAtJettyHomeHelper
jettyHomeBundleSysProp = Util.resolvePropertyValue(jettyHomeBundleSysProp);
for (Bundle b : bundleContext.getBundles())
{
+ if (b.getState() == Bundle.UNINSTALLED)
+ continue;
+
if (b.getSymbolicName().equals(jettyHomeBundleSysProp))
{
jettyHomeBundle = b;

Back to the top