[120707] Workaround for Eclipse install failure
diff --git a/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd b/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd
index 15748f2..0a63f1d 100644
--- a/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/moduleArtifactAdapters.exsd
@@ -92,13 +92,11 @@
<meta.section type="examples"/>
</appInfo>
<documentation>
- <!--
-The following is an example of a module object adapter extension point:
+ The following is an example of a module object adapter extension point:
<pre>
</pre>
--->
</documentation>
</annotation>
diff --git a/plugins/org.eclipse.wst.server.core/schema/moduleFactories.exsd b/plugins/org.eclipse.wst.server.core/schema/moduleFactories.exsd
index 2ed37e5..7181577 100644
--- a/plugins/org.eclipse.wst.server.core/schema/moduleFactories.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/moduleFactories.exsd
@@ -117,13 +117,11 @@
<meta.section type="examples"/>
</appInfo>
<documentation>
- <!--
-The following is an example of a module factory extension point:
+ The following is an example of a module factory extension point:
<pre>
</pre>
--->
</documentation>
</annotation>
@@ -135,7 +133,7 @@
Value of the attribute <b>class</b> must be a fully qualified name of a Java class that extends <code>org.eclipse.wst.server.core.model.ModuleFactoryDelegate</code> and contains a public 0-arg constructor.
</documentation>
</annotation>
-
+
<annotation>
<appInfo>
<meta.section type="implementation"/>
diff --git a/plugins/org.eclipse.wst.server.core/schema/publishTasks.exsd b/plugins/org.eclipse.wst.server.core/schema/publishTasks.exsd
index 034b3b6..1730958 100644
--- a/plugins/org.eclipse.wst.server.core/schema/publishTasks.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/publishTasks.exsd
@@ -90,13 +90,11 @@
<meta.section type="examples"/>
</appInfo>
<documentation>
- <!--
-The following is an example of a publish task extension point:
+ The following is an example of a publish task extension point:
<pre>
</pre>
--->
</documentation>
</annotation>
@@ -108,7 +106,7 @@
Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <code>org.eclipse.wst.server.core.model.PublishTaskDelegate</code>.
</documentation>
</annotation>
-
+
<annotation>
<appInfo>
<meta.section type="implementation"/>
diff --git a/plugins/org.eclipse.wst.server.core/schema/serverMonitors.exsd b/plugins/org.eclipse.wst.server.core/schema/serverMonitors.exsd
index 34ec8b2..f0f49b4 100644
--- a/plugins/org.eclipse.wst.server.core/schema/serverMonitors.exsd
+++ b/plugins/org.eclipse.wst.server.core/schema/serverMonitors.exsd
@@ -104,15 +104,11 @@
<meta.section type="examples"/>
</appInfo>
<documentation>
- <!--
-The following is an example of a server monitor extension point:
+ The following is an example of a server monitor extension point:
-<p>
<pre>
</pre>
-</p>
--->
</documentation>
</annotation>
@@ -124,7 +120,7 @@
Value of the attribute <b>class</b> must be a fully qualified name of a Java class that implements the interface <code>org.eclipse.wst.server.core.internal.ServerMonitorDelegate</code>.
</documentation>
</annotation>
-
+
<annotation>
<appInfo>
<meta.section type="implementation"/>
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableServer.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableServer.java
index 2f9b8e2..d716f6d 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableServer.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/InstallableServer.java
@@ -126,10 +126,16 @@
try {
InstallCommand command = new InstallCommand(featureId, featureVersion, fromSite, null, "false");
command.run(monitor);
- command.applyChangesNow();
+ //command.applyChangesNow();
} catch (Exception e) {
Trace.trace(Trace.SEVERE, "Error installing feature", e);
}
+
+ try {
+ Thread.sleep(1000);
+ } catch (Exception e) {
+ // ignore
+ }
}
public String toString() {
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java
index dac78c6..99ae345 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ModulePublishInfo.java
@@ -216,6 +216,8 @@
} catch (CoreException ce) {
Trace.trace(Trace.WARNING, "Couldn't fill publish cache for " + module);
}
+ if (delta == null)
+ delta = new IModuleResourceDelta[0];
}
protected void clearCache() {
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
index 3d081d5..93877c0 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/internal/ServerPlugin.java
@@ -31,6 +31,7 @@
public static final String PROJECT_PREF_FILE = ".serverPreference";
private static final String SHUTDOWN_JOB_FAMILY = "org.eclipse.wst.server.core.family";
+ //public static final String REGISTRY_JOB_FAMILY = "org.eclipse.wst.server.registry.family";
protected static final DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
protected static int num = 0;
@@ -271,7 +272,7 @@
bundleListener = new BundleListener() {
public void bundleChanged(BundleEvent event) {
String bundleId = event.getBundle().getSymbolicName();
- //System.out.println(event.getType() + " " + bundleId);
+ //Trace.trace(Trace.INFO, event.getType() + " " + bundleId);
// TODO should also look for UNINSTALLED and UNRESOLVED
if (BundleEvent.STOPPED == event.getType() && ResourceManager.getInstance().isActiveBundle(bundleId))
stopBundle(bundleId);
diff --git a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java
index 122e935..4eed74b 100644
--- a/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java
+++ b/plugins/org.eclipse.wst.server.core/servercore/org/eclipse/wst/server/core/util/ProjectModule.java
@@ -156,7 +156,7 @@
} else if (resource instanceof IFile) {
IFile file = (IFile) resource;
if (file != null && file.exists())
- list.add(new ModuleFile(file, file.getName(), path, file.getModificationStamp()));
+ list.add(new ModuleFile(file, file.getName(), path));
}
}
}
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
index c04b00d..c30270c 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.java
@@ -280,6 +280,7 @@
public static String launchingClientTask;
public static String wizNewInstallableServerTitle;
public static String wizNewInstallableServerDescription;
+ public static String wizNewInstallableServerRestart;
public static String installableServerCompTree;
public static String installableServerLink;
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
index 2f9d036..475da09 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/Messages.properties
@@ -52,7 +52,8 @@
# New Installable Server Wizard
wizNewInstallableServerTitle=Install New Server
-wizNewInstallableServerDescription=Download and install support for a new server
+wizNewInstallableServerDescription=Download and install support for a new server. The workbench must be restarted for the changes to take effect.
+wizNewInstallableServerRestart=Installation complete. The new server will not be available until after the workbench is restarted. Do you want to restart now?
# Add/Remove Modules
wizModuleWizardTitle=Add and Remove Projects
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewInstallableServerWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewInstallableServerWizard.java
index be5c3fa..4210cf5 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewInstallableServerWizard.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/NewInstallableServerWizard.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2006 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
@@ -14,7 +14,10 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.server.core.internal.IInstallableServer;
import org.eclipse.wst.server.ui.internal.Messages;
import org.eclipse.wst.server.ui.internal.wizard.fragment.NewInstallableServerWizardFragment;
@@ -33,11 +36,45 @@
list.add(new WizardFragment() {
public void performFinish(IProgressMonitor monitor) throws CoreException {
IInstallableServer is = (IInstallableServer) getTaskModel().getObject("installableServer");
- if (is != null)
+ if (is != null) {
is.install(monitor);
+ promptRestart();
+ }
}
});
}
});
}
+
+ /**
+ * Prompt the user to restart.
+ */
+ public static void promptRestart() {
+ final Display display = Display.getDefault();
+ display.asyncExec(new Runnable() {
+ public void run() {
+ boolean restart = MessageDialog.openQuestion(display.getActiveShell(),
+ Messages.defaultDialogTitle, Messages.wizNewInstallableServerRestart
+ );
+ if (restart) {
+ Thread t = new Thread("Restart thread") {
+ public void run() {
+ try {
+ sleep(1000);
+ } catch (Exception e) {
+ // ignore
+ }
+ display.asyncExec(new Runnable() {
+ public void run() {
+ PlatformUI.getWorkbench().restart();
+ }
+ });
+ }
+ };
+ t.setDaemon(true);
+ t.start();
+ }
+ }
+ });
+ }
}
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizard.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizard.java
index 4a3dcd6..dc29ca9 100644
--- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizard.java
+++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/wizard/TaskWizard.java
@@ -232,9 +232,12 @@
// TODO: show better error dialog, e.g. when Tomcat config is corrupt while doing Add/Remove
// it currently displays the error message twice
+ Trace.trace(Trace.WARNING, "Error completing wizard", t);
if (t instanceof CoreException) {
EclipseUtil.openError(t.getLocalizedMessage(), ((CoreException)t).getStatus());
- } else
+ } else if (t instanceof NullPointerException)
+ EclipseUtil.openError("NullPointerException");
+ else
EclipseUtil.openError(t.getLocalizedMessage());
return false;