aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStoyan Boshev2011-11-22 08:58:21 (EST)
committerStoyan Boshev2011-11-22 08:58:21 (EST)
commite7e671db3f0e0b30007d6411b66fc188c6e3f6f8 (patch)
tree06edd81f2b482054a96665f12ea06e393e4a52dd
parentf25b89f5879c9ee436272dee42a0a8951faaa519 (diff)
downloadrt.equinox.bundles-e7e671db3f0e0b30007d6411b66fc188c6e3f6f8.zip
rt.equinox.bundles-e7e671db3f0e0b30007d6411b66fc188c6e3f6f8.tar.gz
rt.equinox.bundles-e7e671db3f0e0b30007d6411b66fc188c6e3f6f8.tar.bz2
Bug 342613 [DS] ClassCircularityError when activating servicesv20111122-1358
-rw-r--r--bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/InstanceProcess.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/InstanceProcess.java b/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/InstanceProcess.java
index 16c93b6..09c9e90 100644
--- a/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/InstanceProcess.java
+++ b/bundles/org.eclipse.equinox.ds/src/org/eclipse/equinox/internal/ds/InstanceProcess.java
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.eclipse.equinox.internal.ds;
+import java.lang.reflect.InvocationTargetException;
import java.util.*;
import org.apache.felix.scr.Component;
import org.eclipse.equinox.internal.ds.impl.ComponentFactoryImpl;
@@ -587,12 +588,18 @@ public class InstanceProcess {
try {
componentInstance = scp.build(usingBundle, instance, security);
} catch (ClassCircularityError e) {
- Vector component = new Vector(1);
- component.add(scp.serviceComponent);
- resolver.mgr.enqueueWork(resolver.mgr, resolver.mgr.ENABLE_COMPONENTS, component, false);
+ processSCPInClassCircularityError(scp);
throw new ComponentException(NLS.bind(Messages.ERROR_BUILDING_COMPONENT_INSTANCE, scp.serviceComponent), e);
} catch (ComponentException e) {
Activator.log(null, LogService.LOG_ERROR, e.getMessage(), e.getCause());
+ Throwable t = e.getCause();
+ if (t instanceof InvocationTargetException) {
+ Throwable cause = t.getCause();
+ if (cause instanceof ClassCircularityError) {
+ processSCPInClassCircularityError(scp);
+ }
+ }
+
throw e;
} catch (Throwable t) {
Activator.log(null, LogService.LOG_ERROR, NLS.bind(Messages.ERROR_BUILDING_COMPONENT_INSTANCE, scp.serviceComponent), t);
@@ -628,6 +635,12 @@ public class InstanceProcess {
}
}
+ private void processSCPInClassCircularityError(ServiceComponentProp currentScp) {
+ Vector component = new Vector(1);
+ component.add(currentScp.serviceComponent);
+ resolver.mgr.enqueueWork(resolver.mgr, resolver.mgr.ENABLE_COMPONENTS, component, false);
+ }
+
public void modifyComponent(ServiceComponentProp scp, Dictionary newProps) throws ComponentException {
if (Activator.DEBUG) {
Activator.log.debug("Modifying component " + scp.name, null); //$NON-NLS-1$