From 5108908aa6d2169af5a15b156791e53afeeb08be Mon Sep 17 00:00:00 2001 From: David Dykstal Date: Thu, 20 Dec 2012 18:04:01 -0600 Subject: [PATCH 1/2] Test moving the scheduling of the RSEInitJob to the RSEUIPlugin The RSEInitJob loads profiles which instantiates subsystem configurations. If these subsystem configurations are located in plugins that depend on UI plugins then we run the risk of activating these plugins before the platform is ready resulting in load errors of various kinds. There appears to be a change in job scheduling timing that makes this error more apparent. --- .../schema/modelInitializers.exsd | 30 +++++++++---------- .../org/eclipse/rse/core/RSECorePlugin.java | 2 ++ .../eclipse/rse/internal/core/RSEInitJob.java | 5 ++-- .../UI/org/eclipse/rse/ui/RSEUIPlugin.java | 3 ++ 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.core/schema/modelInitializers.exsd b/rse/plugins/org.eclipse.rse.core/schema/modelInitializers.exsd index 1027cb2bd70..d56951971de 100644 --- a/rse/plugins/org.eclipse.rse.core/schema/modelInitializers.exsd +++ b/rse/plugins/org.eclipse.rse.core/schema/modelInitializers.exsd @@ -2,19 +2,19 @@ - + - + - A model initializer is used to create supplemental connections and filter pools after the RSE model has been restored from its persistent form. The base RSE uses this extension point to supply the "Local" connection if one has not already been created for this workspace. Other extenders of RSE may use this to augment the mode in other ways. An initializer is run at the end of the initialization job begun by RSE when it is activated. + A model initializer is used to create supplemental connections and filter pools after the RSE model has been restored from its persistent form. The base RSE uses this extension point to supply the "Local" connection if one has not already been created for this workspace. Other extenders of RSE may use this to augment the model in other ways. An initializer is run at the end of the initialization job begun by RSE when it is activated. - + - + @@ -39,9 +39,9 @@ - + - + @@ -54,9 +54,9 @@ A class that extends <b>org.eclipse.rse.core.IRSEModelInitializer</b>. - + - + @@ -78,18 +78,18 @@ - + - + RSE 3.0 - + - + An example taken from the plug-in org.eclipse.rse.ui: <pre> @@ -103,9 +103,9 @@ - + - + Copyright (c) 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java index 3ea90e23e66..9ce9edf3f66 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java @@ -307,8 +307,10 @@ public class RSECorePlugin extends Plugin { public void start(BundleContext context) throws Exception { super.start(context); registerKeystoreProviders(); + /* RSEInitJob job = RSEInitJob.getInstance(); job.schedule(); + */ } /* diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java index 551e1960159..0b0cbb6c400 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java @@ -11,6 +11,7 @@ * David Dykstal (IBM) = [226958] add status values to waitForInitCompletion(phase) * David Dykstal (IBM) - [235581] Initialize RSE should be a daemon job * David McKnight (IBM) - [283033] remoteFileTypes extension point should include "xml" type + * David Dykstal (IBM) - [] RSEInitJob runs too early ********************************************************************************/ package org.eclipse.rse.internal.core; @@ -230,10 +231,10 @@ public final class RSEInitJob extends Job { return ResourcesPlugin.getEncoding(); } }); -*/ + */ initializerPhase.done(result); - // finish up - propogate cancel if necessary + // finish up - propagate cancel if necessary if (monitor.isCanceled()) { result = Status.CANCEL_STATUS; } else { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java index 98daf13a0cf..52a8ba2c862 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java @@ -53,6 +53,7 @@ import org.eclipse.rse.core.model.ISystemProfileManager; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; +import org.eclipse.rse.internal.core.RSEInitJob; import org.eclipse.rse.internal.core.model.SystemProfileManager; import org.eclipse.rse.internal.core.model.SystemRegistry; import org.eclipse.rse.internal.ui.RSESystemTypeAdapterFactory; @@ -385,6 +386,8 @@ public class RSEUIPlugin extends SystemBasePlugin public void start(BundleContext context) throws Exception { super.start(context); + + RSEInitJob.getInstance().schedule(); messageFile = getMessageFile("systemmessages.xml"); //$NON-NLS-1$ defaultMessageFile = getDefaultMessageFile("systemmessages.xml"); //$NON-NLS-1$ From 447d39eec104bf33c815475f473c2f1e758bad3b Mon Sep 17 00:00:00 2001 From: David Dykstal Date: Mon, 14 Jan 2013 15:14:17 -0600 Subject: [PATCH 2/2] fixes [397995] RSEInitJob runs too early --- rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF | 2 +- rse/plugins/org.eclipse.rse.core/pom.xml | 2 +- .../src/org/eclipse/rse/core/RSECorePlugin.java | 7 ++----- .../src/org/eclipse/rse/internal/core/RSEInitJob.java | 4 ++-- rse/plugins/org.eclipse.rse.ui/META-INF/MANIFEST.MF | 2 +- .../UI/org/eclipse/rse/ui/RSEUIPlugin.java | 3 ++- rse/plugins/org.eclipse.rse.ui/pom.xml | 2 +- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF index 38cd455ebb3..17f080a00b6 100644 --- a/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.rse.core;singleton:=true -Bundle-Version: 3.3.0.qualifier +Bundle-Version: 3.3.1.qualifier Bundle-Activator: org.eclipse.rse.core.RSECorePlugin Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, diff --git a/rse/plugins/org.eclipse.rse.core/pom.xml b/rse/plugins/org.eclipse.rse.core/pom.xml index 7eedba206c2..4c0b6405bf6 100644 --- a/rse/plugins/org.eclipse.rse.core/pom.xml +++ b/rse/plugins/org.eclipse.rse.core/pom.xml @@ -10,6 +10,6 @@ org.eclipse.tm org.eclipse.rse.core - 3.3.0-SNAPSHOT + 3.3.1.qualifier eclipse-plugin diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java index 9ce9edf3f66..27ce11b39c0 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2011 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2013 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 http://www.eclipse.org/legal/epl-v10.html @@ -25,6 +25,7 @@ * Martin Oberhuber (Wind River) - [190231] Prepare API for UI/Non-UI Splitting * David Dykstal (IBM) = [226958] add status values to waitForInitCompletion(phase) * David McKnight (IBM) - [354874] persistence manager hits a NPE during shutdown + * David Dykstal (IBM) - [397995] RSEInitJob runs too early ********************************************************************************/ package org.eclipse.rse.core; @@ -307,10 +308,6 @@ public class RSECorePlugin extends Plugin { public void start(BundleContext context) throws Exception { super.start(context); registerKeystoreProviders(); - /* - RSEInitJob job = RSEInitJob.getInstance(); - job.schedule(); - */ } /* diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java index 0b0cbb6c400..5676cf89678 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/internal/core/RSEInitJob.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2008, 2010 IBM Corporation and others. All rights reserved. + * Copyright (c) 2008, 2013 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 http://www.eclipse.org/legal/epl-v10.html @@ -11,7 +11,7 @@ * David Dykstal (IBM) = [226958] add status values to waitForInitCompletion(phase) * David Dykstal (IBM) - [235581] Initialize RSE should be a daemon job * David McKnight (IBM) - [283033] remoteFileTypes extension point should include "xml" type - * David Dykstal (IBM) - [] RSEInitJob runs too early + * David Dykstal (IBM) - [397995] RSEInitJob runs too early ********************************************************************************/ package org.eclipse.rse.internal.core; diff --git a/rse/plugins/org.eclipse.rse.ui/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.ui/META-INF/MANIFEST.MF index b76f8d70241..25bfe4e4cbc 100644 --- a/rse/plugins/org.eclipse.rse.ui/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.rse.ui;singleton:=true -Bundle-Version: 3.3.1.qualifier +Bundle-Version: 3.3.2.qualifier Bundle-Activator: org.eclipse.rse.ui.RSEUIPlugin Bundle-Localization: plugin Require-Bundle: org.eclipse.core.runtime, diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java index 52a8ba2c862..fbfc25208a2 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006, 2009 IBM Corporation and others. All rights reserved. + * Copyright (c) 2006, 2013 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 http://www.eclipse.org/legal/epl-v10.html @@ -34,6 +34,7 @@ * David McKnight (IBM) - [225506] [api][breaking] RSE UI leaks non-API types * David McKnight (IBM) - [236505] Remote systems dialog not working * David McKnight (IBM) - [238288] use ImageRegistry to store/retrieve images for RSE label providers + * David Dykstal (IBM) - [397995] RSEInitJob runs too early ********************************************************************************/ package org.eclipse.rse.ui; diff --git a/rse/plugins/org.eclipse.rse.ui/pom.xml b/rse/plugins/org.eclipse.rse.ui/pom.xml index 0da971a8826..21865fcc69d 100644 --- a/rse/plugins/org.eclipse.rse.ui/pom.xml +++ b/rse/plugins/org.eclipse.rse.ui/pom.xml @@ -10,6 +10,6 @@ org.eclipse.tm org.eclipse.rse.ui - 3.3.1-SNAPSHOT + 3.3.2.qualifier eclipse-plugin