[252077] [hotbug] Fail to deploy an EAR project if it contains a module
diff --git a/bundles/org.eclipse.jst.ws.consumption/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.consumption/META-INF/MANIFEST.MF
index e954c8b..0a50cb0 100644
--- a/bundles/org.eclipse.jst.ws.consumption/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws.consumption/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.jst.ws.consumption; singleton:=true
-Bundle-Version: 1.0.307.qualifier
+Bundle-Version: 1.0.308.qualifier
Bundle-ClassPath: wsc.jar,
webserviceutils.jar
Bundle-Activator: org.eclipse.jst.ws.internal.consumption.plugin.WebServiceConsumptionPlugin
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/AddModuleToServerCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/AddModuleToServerCommand.java
index 2e0e524..c8073e0 100644
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/AddModuleToServerCommand.java
+++ b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/AddModuleToServerCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 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
@@ -11,6 +11,8 @@
* -------- -------- -----------------------------------------------------------
* 20060921 [158210] kathy@ca.ibm.com - Kathy Chan, Calling incremental build on the project before adding to server
* 20080415 227237 gilberta@ca.ibm.com - Gilbert Andrews
+ * 20090518 [252077] tangg@emc.com - Gary Tang, Fail to deploy an EAR project if it contains a module
+ * kchong@ca.ibm.com - Keith Chong, (updated patch)
*******************************************************************************/
package org.eclipse.jst.ws.internal.consumption.command.common;
@@ -71,8 +73,10 @@
//Ensure the module is not a Java utility
IProject iproject = ProjectUtilities.getProject(project);
if (!J2EEUtils.isJavaComponent(iproject))
- {
- IModule imodule = ServerUtils.getModule(iproject);
+ {
+ // Get the IModule as specified by the module name
+ IModule imodule = ServerUtils.getModule(iproject, module);
+
// TODO: This workaround for 156768 should be removed once the defect is fixed
if (imodule == null) {
// calling incremental build on the project before trying again
@@ -144,6 +148,4 @@
{
this.serverInstanceId = serverInstanceId;
}
-
-
}
diff --git a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java
index 087d515..d13a8a2 100644
--- a/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java
+++ b/bundles/org.eclipse.jst.ws/src/org/eclipse/jst/ws/internal/common/ServerUtils.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 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
@@ -13,6 +13,8 @@
* 20060330 124667 kathy@ca.ibm.com - Kathy Chan
* 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen
* 20070119 159458 mahutch@ca.ibm.com - Mark Hutchinson
+ * 20090518 [252077] tangg@emc.com - Gary Tang, Fail to deploy an EAR project if it contains a module
+ * kchong@ca.ibm.com - Keith Chong, (updated patch)
*******************************************************************************/
package org.eclipse.jst.ws.internal.common;
@@ -396,6 +398,27 @@
public static IModule getModule(IProject project) {
return ServerUtil.getModule(project);
}
+ /**
+ * Find the specific module with module name in a project
+ * @param project - the project
+ * @param module - name of desired module
+ * @return IModule
+ */
+ public static IModule getModule(IProject project, String module) {
+ // If module is null, then just return the first one
+ if (module == null)
+ return getModule(project);
+
+ IModule[] modules = ServerUtil.getModules(project);
+ int length = modules.length;
+ for (int i = 0; i < length; i++)
+ {
+ IModule aModule = modules[i];
+ if (module.equals(aModule.getName()))
+ return aModule;
+ }
+ return null;
+ }
// Workaround for 113621
//public static IModule getModule(IProject project) {