Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeConfigurator.java11
-rw-r--r--bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java8
2 files changed, 15 insertions, 4 deletions
diff --git a/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeConfigurator.java b/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeConfigurator.java
index 90c86a99c..b545a0a70 100644
--- a/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeConfigurator.java
+++ b/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeConfigurator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2009 IBM Corporation and others.
+ * Copyright (c) 2008, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -171,7 +171,14 @@ public class CompositeConfigurator implements SynchronousBundleListener, HookCon
if ((data.getType() & (BundleData.TYPE_COMPOSITEBUNDLE | BundleData.TYPE_SURROGATEBUNDLE)) == 0)
return null;
// only create composite class loaders for bundles that are of type composite | surrogate
- ClassLoaderDelegate companionDelegate = ((CompositeModule) ((CompositeBase) data.getBundle()).getCompanionBundle()).getDelegate();
+ CompositeModule compositeModule = (CompositeModule) ((CompositeBase) data.getBundle()).getCompanionBundle();
+ if (compositeModule == null) {
+ throw new IllegalStateException("Could not find companion bundle for " + data.getBundle());
+ }
+ ClassLoaderDelegate companionDelegate = compositeModule.getDelegate();
+ if (companionDelegate == null) {
+ throw new IllegalStateException("Could not find the companion bundle delegate for" + compositeModule);
+ }
return new CompositeClassLoader(parent, delegate, companionDelegate, data);
}
diff --git a/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java b/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java
index 807fb5bc7..021ee9e5a 100644
--- a/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java
+++ b/bundles/org.eclipse.osgi/core/composite/org/eclipse/osgi/internal/composite/CompositeImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2011 IBM Corporation and others.
+ * Copyright (c) 2008, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -171,7 +171,11 @@ public class CompositeImpl extends CompositeBase implements CompositeBundle {
protected void stopHook() throws BundleException {
// bug 363561; need to make sure the class loader is created
// before stopping the composite framework
- checkClassLoader();
+ try {
+ checkClassLoader();
+ } catch (Throwable t) {
+ framework.publishFrameworkEvent(FrameworkEvent.ERROR, this, t);
+ }
trackerManager.stoppedComposite();
// do not stop the framework unless we are persistently stopped
if ((bundledata.getStatus() & Constants.BUNDLE_STARTED) == 0)

Back to the top