### Eclipse Workspace Patch 1.0
#P org.jboss.tools.jst.web
Index: src/org/jboss/tools/jst/web/context/RegisterServerContext.java
===================================================================
--- src/org/jboss/tools/jst/web/context/RegisterServerContext.java	(revision 22803)
+++ src/org/jboss/tools/jst/web/context/RegisterServerContext.java	(working copy)
@@ -57,7 +57,7 @@
     
 	private static final String YES_STRING = "yes"; //$NON-NLS-1$
 	private static final String EMPTY_LOCATION = ""; //$NON-NLS-1$
-	
+	RegistrationHelper helper = new RegistrationHelper();
 	
 	public RegisterServerContext(int mode) {
 		this.mode = mode;
@@ -174,7 +174,7 @@
 			String contextRootError = RegistrationHelper.checkContextRoot(applicationName);
 			if(contextRootError != null) return contextRootError;
 			if(targetServers.length > 0) {
-				IModule module = RegistrationHelper.findModule(project);
+				IModule module = helper.findModule(project);
 				boolean isFakeModule = false;
 				if(module == null) {
 					if(serverErrorCache != null) {
@@ -187,16 +187,16 @@
 					serverErrorCache = null;
 				}
 				for (int i = 0; i < targetServers.length; i++) {
-					if(RegistrationHelper.isRegistered(applicationName, targetServers[i])) {
+					if(helper.isRegistered(applicationName, targetServers[i])) {
 						return NLS.bind(WebUIMessages.APPLICATION_IS_ALREADY_REGISTERED, applicationName, targetServers[i].getName());
 					}
 					if(this.project != null /*&& !this.project.exists()*/ && servletVersion != null && servletVersion.length() > 0) {
-						if(project.exists() && RegistrationHelper.isRegistered(project)) {
+						if(project.exists() && helper.isRegistered(project)) {
 							return MessageFormat
 									.format(WebUIMessages.PROJECT_IS_ALREADY_REGISTERED,
 											project.getName());
 						}
-						String m = (module == null) ? null : RegistrationHelper.getRegistrationError(module, applicationName, targetServers[i]);
+						String m = (module == null) ? null : helper.getRegistrationError(module, applicationName, targetServers[i]);
 						if(m != null) {
 							if(isFakeModule) {
 								serverErrorCache = m;
Index: src/org/jboss/tools/jst/web/server/RegistrationHelper.java
===================================================================
--- src/org/jboss/tools/jst/web/server/RegistrationHelper.java	(revision 22803)
+++ src/org/jboss/tools/jst/web/server/RegistrationHelper.java	(working copy)
@@ -11,13 +11,22 @@
 package org.jboss.tools.jst.web.server;
 
 import java.text.MessageFormat;
+import java.util.HashMap;
+
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-import org.eclipse.wst.server.core.*;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
 import org.eclipse.wst.server.core.internal.ServerType;
 import org.jboss.tools.common.model.XModel;
 import org.jboss.tools.common.model.XModelException;
@@ -31,6 +40,30 @@
 
 public class RegistrationHelper {
 	
+	private HashMap<IServer, IModule[]> childModules;
+	public RegistrationHelper() {
+		childModules = new HashMap<IServer, IModule[]>();
+	}
+	
+	public boolean isRegisteredCache(String appname, IServer server) {
+		IModule[] ms = childModules.get(server);
+		if( ms == null ) {
+			ms = server.getModules();
+			childModules.put(server, ms);
+		}
+		IProject project = null;
+		for (int i = 0; i < ms.length && project == null; i++) {
+			if(ms[i].getName().equals(appname)) {
+				IProject p = ms[i].getProject();
+				if(p != null && p.exists() && p.isOpen()) {
+					project = p;
+				}
+			}
+		}
+		return isRegistered(project, server, ms);
+	}
+	
+	
 	public static boolean isRegistered(String appname, IServer server) {
 		IProject project = null;
 		if(server != null) {
@@ -53,7 +86,10 @@
 	
 	public static boolean isRegistered(IProject project, IServer server) {
 		if(server == null || project == null) return false;
-		IModule[] ms = server.getModules();
+		return isRegistered(project, server, server.getModules());
+	}
+	
+	public static boolean isRegistered(IProject project, IServer server, IModule[] ms) {
 		IModule m = findModule(project);
 		return (contains(ms, m));
 	}
@@ -93,12 +129,12 @@
 		}
 		IModule[] add = new IModule[]{m};
 		IModule[] remove = new IModule[0];
-		try {
-			server.getRootModules(m, null);
-		} catch (CoreException ce) {
-			WebModelPlugin.getPluginLog().logError(ce);
-			return ce.getStatus().getMessage();
-		}
+//		try {
+//			server.getRootModules(m, null);
+//		} catch (CoreException ce) {
+//			WebModelPlugin.getPluginLog().logError(ce);
+//			return ce.getStatus().getMessage();
+//		}
 
 		IProgressMonitor monitor = new NullProgressMonitor();
 		IServerWorkingCopy copy = server.createWorkingCopy();
