Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2016-02-08 00:00:55 +0000
committerslewis2016-02-08 00:00:55 +0000
commit33c46507ae1eac907f8b0c3239317d158e3562fe (patch)
tree20cc14b6babf8d43bd5b2c6b110cbc43dcf9e388 /osgi/bundles
parentf1046fafe066ad4be7fa22783afe4c17fdc2ea16 (diff)
downloadorg.eclipse.ecf-33c46507ae1eac907f8b0c3239317d158e3562fe.tar.gz
org.eclipse.ecf-33c46507ae1eac907f8b0c3239317d158e3562fe.tar.xz
org.eclipse.ecf-33c46507ae1eac907f8b0c3239317d158e3562fe.zip
Possible fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=487419
Diffstat (limited to 'osgi/bundles')
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF2
-rw-r--r--osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java23
2 files changed, 23 insertions, 2 deletions
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
index c466c0d3d..0d350f5e5 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundle.name
Bundle-SymbolicName: org.eclipse.ecf.osgi.services.remoteserviceadmin
-Bundle-Version: 4.3.300.qualifier
+Bundle-Version: 4.3.400.qualifier
Bundle-Activator: org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.Activator
Bundle-Vendor: %bundle.provider
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
index d9e884100..1bb8371c5 100644
--- a/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
+++ b/osgi/bundles/org.eclipse.ecf.osgi.services.remoteserviceadmin/src/org/eclipse/ecf/osgi/services/remoteserviceadmin/RemoteServiceAdmin.java
@@ -33,9 +33,11 @@ import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.ecf.core.ContainerConnectException;
+import org.eclipse.ecf.core.ContainerCreateException;
import org.eclipse.ecf.core.ContainerTypeDescription;
import org.eclipse.ecf.core.IContainer;
import org.eclipse.ecf.core.identity.ID;
+import org.eclipse.ecf.core.identity.StringID;
import org.eclipse.ecf.core.util.ECFException;
import org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.Activator;
import org.eclipse.ecf.internal.osgi.services.remoteserviceadmin.DebugOptions;
@@ -320,8 +322,27 @@ public class RemoteServiceAdmin implements
}
});
} catch (PrivilegedActionException e) {
+ Exception except = e.getException();
// see discussion on osgi bug https://www.osgi.org/members/bugzilla/show_bug.cgi?id=2591
- throw new IllegalArgumentException("Failed to select, create, or configure ECF host container",e.getException()); //$NON-NLS-1$
+ String errorMessage = "Failed to select host container"; //$NON-NLS-1$
+ if (except instanceof SelectContainerException) {
+ SelectContainerException sce = (SelectContainerException) except;
+ Throwable sceCause = sce.getCause();
+ if (sceCause instanceof ContainerCreateException) {
+ // Some dummy props need to be set to allow the creation of a dummy export registration
+ Map<String,Object> props = new HashMap<String,Object>(overridingProperties);
+ props.put(org.osgi.service.remoteserviceadmin.RemoteConstants.ENDPOINT_ID, "0"); //$NON-NLS-1$
+ props.put(org.osgi.service.remoteserviceadmin.RemoteConstants.SERVICE_IMPORTED_CONFIGS, "import.error.config"); //$NON-NLS-1$
+ props.put(RemoteConstants.ENDPOINT_ID,"export.error.id"); //$NON-NLS-1$
+ props.put(RemoteConstants.ENDPOINT_CONTAINER_ID_NAMESPACE, StringID.class.getName());
+ ExportRegistration errorRegistration = new RemoteServiceAdmin.ExportRegistration(sceCause,
+ new EndpointDescription(serviceReference,props));
+ addExportRegistration(errorRegistration);
+ resultRegistrations.add(errorRegistration);
+ } else
+ throw new IllegalArgumentException(errorMessage, except);
+ } else
+ throw new IllegalArgumentException(errorMessage, except);
}
// If no registration exist (no errorRegistration added above)
if (resultRegistrations.size() == 0) {

Back to the top