Community
Participate
Working Groups
public ServerManager() { final IExtensionRegistry reg = Activator.getDefault().getExtensionRegistry(); try { if (reg != null) { createServersFromExtensionRegistry(reg); } else { createServersFromConfigurationFile(Activator.getDefault().getBundle().getEntry("server.xml").openStream()); } } catch (final Exception e) { Activator.log("Exception creating servers", e); //$NON-NLS-1$ } } .... some lines later: private void createServersFromExtensionRegistry(IExtensionRegistry registry) throws Exception { final IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_POINT); if (extensionPoint == null) return; ---------------- so: if the EXTENSION_POINT wasn't found then: * no config from extension and * no config from server.xml the test should be in the first method: if (reg != null && reg.getExtensionPoint(EXTENSION_POINT) != null) { createServersFromExtensionRegistry(reg); } else { createServersFromConfigurationFile(A...).openStream()); }
Would you like to attach a fix? (i.e. a revised version of the relevant file)? Then I could apply, test, and release fairly quickly.
(In reply to comment #1) > Would you like to attach a fix? (i.e. a revised version of the relevant file)? > Then I could apply, test, and release fairly quickly. no problem - will provide this later ekke
Created attachment 188006 [details] added test for extension point only in line 69 && reg.getExtensionPoint(EXTENSION_POINT) != null inserted
Released fix to master. Resolving as fixed. Thanks for the bug report and fix. BTW, the ServerManager is kind of an old class...which predates a lot of the more recent work in IGenericServerContainerGroupFactory (a osgi service for creating/using generic server instances), and all the work on the discovery API and OSGi remote services/remote service admin.
(In reply to comment #4) > > BTW, the ServerManager is kind of an old class...which predates a lot of the > more recent work in IGenericServerContainerGroupFactory (a osgi service for > creating/using generic server instances), and all the work on the discovery API > and OSGi remote services/remote service admin. ECF is new for me and I got the hint to try out the GenericServer and the Activator creates the ServerManager so I thought this is the recommended way
(In reply to comment #5) > (In reply to comment #4) > > > > > BTW, the ServerManager is kind of an old class...which predates a lot of the > > more recent work in IGenericServerContainerGroupFactory (a osgi service for > > creating/using generic server instances), and all the work on the discovery API > > and OSGi remote services/remote service admin. > > ECF is new for me and I got the hint to try out the GenericServer > and the Activator creates the ServerManager > so I thought this is the recommended way The Activator starting the ServerManager is for backward compatibility (i.e. so those using the ServerManager don't have things stop working). Notice the Activator also now creates an IGenericServerContainerGroupFactory and registers it as an OSGi service...so that generic server instances can be created/started/stopped dynamically via an OSGi service (rather than statically via configuration file or extension registry). It would obviously be desirable to have documentation for all this, but alas our resources don't currently allow it.