[97756] fix up deployables: committed for JL
diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEFlexProjWebDeployable.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEFlexProjWebDeployable.java
index 24ced62..2c7976d 100644
--- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEFlexProjWebDeployable.java
+++ b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/deployables/J2EEFlexProjWebDeployable.java
@@ -21,13 +21,13 @@
 import org.eclipse.jst.j2ee.internal.J2EEConstants;
 import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
 import org.eclipse.jst.j2ee.internal.common.J2EEVersionUtil;
+import org.eclipse.jst.j2ee.internal.deployables.FlexibleProjectServerUtil;
 import org.eclipse.jst.j2ee.internal.deployables.J2EEFlexProjDeployable;
-import org.eclipse.jst.j2ee.internal.deployables.LooseArchiveDeployable;
-import org.eclipse.jst.j2ee.internal.deployables.LooseArchiveDeployableFactory;
-import org.eclipse.jst.server.core.ILooseArchive;
-import org.eclipse.jst.server.core.ILooseArchiveSupport;
+import org.eclipse.jst.j2ee.internal.plugin.IJ2EEModuleConstants;
 import org.eclipse.jst.server.core.IWebModule;
+import org.eclipse.wst.common.componentcore.ComponentCore;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IModuleType;
 import org.eclipse.wst.web.internal.operation.ILibModule;
@@ -36,18 +36,13 @@
  * @version 1.0
  * @author
  */
-public class J2EEFlexProjWebDeployable extends J2EEFlexProjDeployable implements IWebModule, ILooseArchiveSupport, IModuleType {
+public class J2EEFlexProjWebDeployable extends J2EEFlexProjDeployable implements IWebModule, IModuleType {
     protected String contextRoot;
 
-    protected ILooseArchive[] archives;
     public IPath rootfolder = null;
 
     protected Map uris = new HashMap();
 
-	public static final String WEB_MODULE_TYPE = "jst.web";
-
-    
-
     /**
      * @param aNature
      * @param aFactoryId
@@ -85,8 +80,7 @@
 	public String getJ2EESpecificationVersion() {
 		if (component != null)
 			return J2EEVersionUtil.convertVersionIntToString(J2EEVersionUtil.convertWebVersionStringToJ2EEVersionID(component.getVersion()));
-		else
-			return null;
+		return null;
 	}
 
     public String getJSPFileMapping(String jspFile) {
@@ -121,8 +115,7 @@
 
 		if (component != null)
 			return component.getVersion();
-		else
-			return null;
+		return null;
 	}
 
     
@@ -135,74 +128,18 @@
         return false;
     }
 
-    protected LooseArchiveDeployableFactory getLooseArchiveDeployableFactory() {
-        /*
-         * Iterator factories =
-         * Arrays.asList(ServerCore.getModuleFactories()).iterator(); while
-         * (factories.hasNext()) { ModuleFactory deployableFactory =
-         * (ModuleFactory) factories.next(); ModuleFactoryDelegate
-         * deployableFactoryDelegate = deployableFactory.getDelegate(); if
-         * (deployableFactoryDelegate instanceof LooseArchiveDeployableFactory)
-         * return (LooseArchiveDeployableFactory) deployableFactoryDelegate; }
-         */
-        return null;
-    }
-
-/*    protected ILooseArchive getArchiveDeployable(IProject aProject, LooseArchiveDeployableFactory fact) {
-        return (ILooseArchive) fact.getModuleProject(aProject);
-    }*/
-
     protected ILibModule[] getLibModules() {
     	return null;	
     }
-
-  /*  public ILooseArchive[] getLooseArchives() {
-        return this.archives;
-    }*/
-
-    /*
-     * @see com.ibm.etools.server.core.util.DeployableProject#getRootFolder()
-     */
     
-
-
-    public ILooseArchive[] getUncachedLooseArchives() {
-        ILibModule[] libModules = getLibModules();
-        if (libModules == null)
-            return null;
-
-        LooseArchiveDeployableFactory fact = getLooseArchiveDeployableFactory();
-        if (fact == null)
-            return null;
-
-        List arcs = new ArrayList(libModules.length);
-        for (int i = 0; i < libModules.length; i++) {
-            ILibModule libModule = libModules[i];
-            IProject proj = libModule.getProject();
-           /* if (proj != null && proj.exists())
-                arcs.add(getArchiveDeployable(proj, fact));*/
-        }
-        ILooseArchive[] result = new ILooseArchive[arcs.size()];
-        arcs.toArray(result);
-        return result;
-    }
-
-    public String getURI(ILooseArchive jar) {
-        try {
-            return (String) this.uris.get(jar);
-        } catch (Exception e) {
-        		// ignore
-        }
-        return null;
-    }
-
-    public String getUncachedURI(ILooseArchive jar) {
-        if (!(jar instanceof LooseArchiveDeployable))
-            return null;
-
-        LooseArchiveDeployable dep = (LooseArchiveDeployable) jar;
-        IProject proj = dep.getProject();
-        return getURI(proj);
+    public String getURI(IModule module) {
+    	String result = ""; //$NON-NLS-1$
+    	IVirtualComponent comp = ComponentCore.createComponent(module.getProject());
+    	if (!comp.isBinary()) {
+    		IVirtualReference ref = component.getReference(comp.getName());
+    		result = ref.getRuntimePath().append(comp.getName()+IJ2EEModuleConstants.JAR_EXT).toString();
+    	}
+    	return result;
     }
 
     protected String getURI(IProject looseJARProject) {
@@ -213,52 +150,6 @@
         return false;
     }
 
-    protected void update() {
-        ILooseArchive[] oldArchives = this.archives;
-        this.archives = getUncachedLooseArchives();
-        if (this.archives == null)
-            this.archives = new ILooseArchive[0];
-        String oldContextRoot = this.contextRoot;
-        this.contextRoot = getUncachedContextRoot();
-
-        boolean changed = false;
-        if (oldContextRoot == null && this.contextRoot != null)
-            changed = true;
-        else if (oldContextRoot != null && !oldContextRoot.equals(this.contextRoot))
-            changed = true;
-
-        // fire remove events
-        List add = new ArrayList(2);
-        addRemovedObjects(add, oldArchives, this.archives);
-
-        // fire add events
-        List remove = new ArrayList(2);
-        addAddedObjects(remove, oldArchives, this.archives);
-
-        // fire change events
-        int size = this.archives.length;
-        List change = new ArrayList(size);
-        for (int i = 0; i < size; i++) {
-            String newURI = getUncachedURI(this.archives[i]);
-            String oldURI = getURI(this.archives[i]);
-
-            if (oldURI != null && !oldURI.equals(newURI)) {
-                change.add(this.archives[i]);
-            }
-            this.uris.put(this.archives[i], newURI);
-        }
-
-        if (!add.isEmpty() || !remove.isEmpty() || !change.isEmpty() || changed) {
-            IModule[] added = new IModule[add.size()];
-            add.toArray(added);
-            IModule[] changed2 = new IModule[change.size()];
-            change.toArray(changed2);
-            IModule[] removed = new IModule[remove.size()];
-            remove.toArray(removed);
-           // fireModuleChangeEvent(changed, added, changed2, removed);
-        }
-    }
-
     /**
      * Return the objects that have been added between array a and array b.
      * Assumes that there are no null objects in the array.
@@ -332,17 +223,7 @@
      * @return org.eclipse.wst.server.core.model.IModule[]
      */
     public IModule[] getChildModules() {
-        List list = new ArrayList();
-
-        if (this.archives != null) {
-            int size = this.archives.length;
-            for (int i = 0; i < size; i++)
-                list.add(this.archives[i]);
-        }
-
-        IModule[] children = new IModule[list.size()];
-        list.toArray(children);
-        return children;
+    	return getModules();
     }
 
    
@@ -353,10 +234,17 @@
     public String getModuleTypeVersion(){
         return getVersion();
     }
-
-	public IModule[] getLooseArchives() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
+    
+    public IModule[] getModules() {
+    	List modules = new ArrayList();
+    	IVirtualReference[] components = component.getReferences();
+    	for (int i=0; i<components.length; i++) {
+			IVirtualReference reference = components[i];
+			IVirtualComponent virtualComp = reference.getReferencedComponent();
+			Object module = FlexibleProjectServerUtil.getModule(virtualComp);
+			if (module!=null)
+				modules.add(module);
+		}
+        return (IModule[]) modules.toArray(new IModule[modules.size()]);
+    }
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java
index ff06304..5c12430 100644
--- a/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java
+++ b/plugins/org.eclipse.jst.j2ee/earproject/org/eclipse/jst/j2ee/componentcore/util/EARArtifactEdit.java
@@ -11,7 +11,6 @@
 
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 
 import org.eclipse.core.resources.IProject;
@@ -420,19 +419,16 @@
 			WorkbenchComponent component = core.getComponent();
 			List referencedComponents = component.getReferencedComponents();
 			
-			for (Iterator iter = referencedComponents.iterator(); iter
-					.hasNext();) {
-				ReferencedComponent ref = (ReferencedComponent) iter.next();
-				 {
+			for (int i=0; i<referencedComponents.size(); i++) {
+				ReferencedComponent ref = (ReferencedComponent) referencedComponents.get(i);
 				if( !moduleComp.isBinary()) {
 					if (ref.getHandle().equals(ModuleURIUtil.fullyQualifyURI(moduleComp.getProject())))
 						return ((Module)ref.getDependentObject()).getUri();
-				}	else {
-					if (ref.getHandle().equals(ModuleURIUtil.archiveComponentfullyQualifyURI(moduleComp.getName())));
-						return ((Module)ref.getDependentObject()).getUri();
-				}
-					
-			}
+				} 
+//				else if (moduleComp.isBinary()) {
+//					if (ref.getHandle().equals(ModuleURIUtil.archiveComponentfullyQualifyURI(moduleComp.getName())));
+//						return ((Module)ref.getDependentObject()).getUri();
+//				}	
 			}
 		} finally {
 			if (core != null)
diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployable.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployable.java
index 0a1327a..8bd776e 100644
--- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployable.java
+++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployable.java
@@ -14,9 +14,6 @@
 import org.eclipse.core.resources.IProject;
 import org.eclipse.jst.j2ee.componentcore.util.EARArtifactEdit;
 import org.eclipse.jst.server.core.IEnterpriseApplication;
-import org.eclipse.jst.server.core.IJ2EEModule;
-import org.eclipse.jst.server.core.ILooseArchive;
-import org.eclipse.jst.server.core.ILooseArchiveSupport;
 import org.eclipse.wst.common.componentcore.ComponentCore;
 import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -25,7 +22,7 @@
 
 
 
-public class EnterpriseApplicationDeployable extends J2EEFlexProjDeployable implements IEnterpriseApplication, ILooseArchiveSupport {
+public class EnterpriseApplicationDeployable extends J2EEFlexProjDeployable implements IEnterpriseApplication {
 
 	public static final String EAR_MODULE_TYPE = IModuleConstants.JST_EAR_MODULE;
 	
@@ -44,30 +41,16 @@
 		}
 
 	public IModule[] getModules() {
-		List modules = new ArrayList(3);
-		EARArtifactEdit earEdit = null;
-		try {
-			earEdit = EARArtifactEdit.getEARArtifactEditForRead(component);
-			if (earEdit != null) {
-				IVirtualReference[] components = earEdit.getComponentReferences();
-				for (int i=0; i<components.length; i++) {
-					IVirtualReference reference = components[i];
-					IVirtualComponent virtualComp = reference.getReferencedComponent();
-					Object module = FlexibleProjectServerUtil.getModule(virtualComp);
-					if (module!=null)
-						modules.add(module);
-				}
-			}
-		} catch (Exception e) {
-			e.printStackTrace();
-		} finally {
-			if (earEdit != null)
-				earEdit.dispose();
+		List modules = new ArrayList();
+    	IVirtualReference[] components = component.getReferences();
+    	for (int i=0; i<components.length; i++) {
+			IVirtualReference reference = components[i];
+			IVirtualComponent virtualComp = reference.getReferencedComponent();
+			Object module = FlexibleProjectServerUtil.getModule(virtualComp);
+			if (module!=null)
+				modules.add(module);
 		}
-		IModule[] moduleArray = new IModule[modules.size()];
-		modules.toArray(moduleArray);
-		return moduleArray;
-
+        return (IModule[]) modules.toArray(new IModule[modules.size()]);
 	}
     
     /**
@@ -79,10 +62,8 @@
         return getModules();
     }
 
-	public String getURI(IJ2EEModule module) {
-		// TODO Auto-generated method stub
-		J2EEFlexProjDeployable mod = (J2EEFlexProjDeployable)module;
-		IVirtualComponent comp = ComponentCore.createComponent(mod.getProject());
+	public String getURI(IModule module) {
+		IVirtualComponent comp = ComponentCore.createComponent(module.getProject());
 		EARArtifactEdit earEdit = null;
 		String aURI = null;
 		try {
@@ -96,27 +77,10 @@
 			if (earEdit != null)
 				earEdit.dispose();
 		}
-		
 		return aURI;
 	}
 	
-
-	public boolean containsLooseModules() {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-
-	public IModule[] getLooseArchives() {
-		// TODO Auto-generated method stub
-		return null;
-	}
 	public String getType() {
 		return "j2ee.ear"; //$NON-NLS-1$
 	}
-	public String getURI(ILooseArchive archive) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployableFactory.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployableFactory.java
index 33b5c15..41f8276 100644
--- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployableFactory.java
+++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/EnterpriseApplicationDeployableFactory.java
@@ -29,7 +29,7 @@
  */
 public class EnterpriseApplicationDeployableFactory extends J2EEDeployableFactory {
 
-	protected static final String ID = "org.eclipse.jst.j2ee.server.application"; //$NON-NLS-1$
+	public static final String ID = "org.eclipse.jst.j2ee.server.application"; //$NON-NLS-1$
 
 	protected static final IPath[] PATHS = new IPath[]{new Path("META-INF/application.xml"), //$NON-NLS-1$
 				new Path("META-INF/.modulemaps") //$NON-NLS-1$
diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/LooseArchiveDeployable.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/LooseArchiveDeployable.java
deleted file mode 100644
index 2506378..0000000
--- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/LooseArchiveDeployable.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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
- * 
- * Contributors: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.j2ee.internal.deployables;
-
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jem.workbench.utility.JemProjectUtilities;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.jst.server.core.ILooseArchive;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleType;
-import org.eclipse.wst.server.core.util.ProjectModule;
-
-
-public class LooseArchiveDeployable extends ProjectModule implements ILooseArchive{
-	protected String factoryId;
-
-	/**
-	 * Constructor for LooseArchiveDeployable.
-	 */
-	public LooseArchiveDeployable(IProject aProject, String aFactoryId) {
-		super(aProject);
-		factoryId = aFactoryId;
-	}
-
-	/*
-	 * @see ILooseArchive#getLocation()
-	 */
-	public IPath getLocation() {
-		return J2EEProjectUtilities.getRuntimeLocation(project);
-	}
-
-	/*
-	 * @see com.ibm.etools.server.core.util.DeployableProject#isBinary()
-	 */
-	public boolean isBinary() {
-		return JemProjectUtilities.isBinaryProject(getProject());
-	}
-
-	/*
-	 * @see com.ibm.etools.server.core.util.DeployableProject#getRootFolder()
-	 */
-	public IPath getRootFolder() {
-		if (isBinary())
-			return null;
-		IContainer c = JemProjectUtilities.getJavaProjectOutputContainer(getProject());
-		if (c != null)
-			return c.getProjectRelativePath();
-		return null;
-	}
-
-	/*
-	 * @see getFactoryId()
-	 */
-	public String getFactoryId() {
-		return factoryId;
-	}
-
-	public String getType() {
-		return "j2ee.loosearchive"; //$NON-NLS-1$
-	}
-
-	public String getVersion() {
-		return "1.0"; //$NON-NLS-1$
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.server.core.IModule#validate(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public IStatus validate(IProgressMonitor monitor) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.server.core.IModule#getModuleType()
-	 */
-	public IModuleType getModuleType() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.server.core.IModule#getChildModules(org.eclipse.core.runtime.IProgressMonitor)
-	 */
-	public IModule[] getChildModules(IProgressMonitor monitor) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
-	 */
-	public Object getAdapter(Class adapter) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/LooseArchiveDeployableFactory.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/LooseArchiveDeployableFactory.java
deleted file mode 100644
index f069443..0000000
--- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/LooseArchiveDeployableFactory.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 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
- * 
- * Contributors: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.jst.j2ee.internal.deployables;
-
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.model.ModuleDelegate;
-import org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate;
-
-public class LooseArchiveDeployableFactory extends ProjectModuleFactoryDelegate {
-	private static final String ID = "org.eclipse.jst.j2ee.server.looseArchive"; //$NON-NLS-1$
-
-	/*
-	 * @see DeployableProjectFactoryDelegate#getFactoryID()
-	 */
-	public String getFactoryId() {
-		return ID;
-	}
-
-	/**
-	 * Returns true if the project represents a deployable project of this type.
-	 * 
-	 * @param project
-	 *            org.eclipse.core.resources.IProject
-	 * @return boolean
-	 */
-	protected boolean isValidModule(IProject project) {
-
-		return false;
-	}
-
-	/**
-	 * Creates the deployable project for the given project.
-	 * 
-	 * @param project
-	 *            org.eclipse.core.resources.IProject
-	 * @return com.ibm.etools.server.core.model.IProjectModule
-	 */
-
-
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModuleDelegate(org.eclipse.wst.server.core.IModule)
-	 */
-	public ModuleDelegate getModuleDelegate(IModule module) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.wst.server.core.model.ModuleFactoryDelegate#getModules()
-	 */
-	public IModule[] getModules() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.wst.server.core.util.ProjectModuleFactoryDelegate#createModules(org.eclipse.core.resources.IProject)
-	 */
-	protected IModule[] createModules(IProject project) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-}
\ No newline at end of file
diff --git a/plugins/org.eclipse.jst.j2ee/plugin.xml b/plugins/org.eclipse.jst.j2ee/plugin.xml
index 4c8a000..06fecf9 100644
--- a/plugins/org.eclipse.jst.j2ee/plugin.xml
+++ b/plugins/org.eclipse.jst.j2ee/plugin.xml
@@ -509,7 +509,7 @@
                types="j2ee.ear">
          </moduleType>
       </moduleFactory>
-      <moduleFactory
+ <!--    <moduleFactory
             projects="true"
           
             class="org.eclipse.jst.j2ee.internal.deployables.LooseArchiveDeployableFactory"
@@ -518,7 +518,7 @@
                versions="*"
                types="j2ee.loosearchive">
          </moduleType>
-      </moduleFactory>
+      </moduleFactory> -->
    </extension>
 
 <!-- =============================================================== -->
diff --git a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java
index 5668ea8..4f1cea1 100644
--- a/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java
+++ b/plugins/org.eclipse.jst.servlet.ui/servlet_ui/org/eclipse/jst/servlet/ui/internal/wizard/AddServletWizard.java
@@ -16,7 +16,10 @@
 import org.eclipse.emf.ecore.resource.ResourceSet;
 import org.eclipse.jem.java.JavaClass;
 import org.eclipse.jem.java.JavaRefFactory;
+import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
 import org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties;
+import org.eclipse.jst.j2ee.internal.deployables.EnterpriseApplicationDeployable;
+import org.eclipse.jst.j2ee.internal.deployables.EnterpriseApplicationDeployableFactory;
 import org.eclipse.jst.j2ee.internal.plugin.J2EEEditorUtility;
 import org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin;
 import org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModelProvider;
@@ -27,6 +30,7 @@
 import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
 import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
 import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
+import org.eclipse.wst.server.core.IModule;
 
 /**
  * New servlet wizard
@@ -40,6 +44,13 @@
 	 */
 	public AddServletWizard(IDataModel model) {
 		super(model);
+		IProject project = ProjectUtilities.getProject("DeployTestEAR");
+		EnterpriseApplicationDeployable deployable = new EnterpriseApplicationDeployable(project,EnterpriseApplicationDeployableFactory.ID, ComponentCore.createComponent(project));
+		IModule[] modules = deployable.getModules();
+		for (int i=0; i<modules.length; i++) {
+			String uri = deployable.getURI(modules[i]);
+			System.out.println(uri);
+		}
 		setWindowTitle(IWebWizardConstants.ADD_SERVLET_WIZARD_WINDOW_TITLE);
 		setDefaultPageImageDescriptor(J2EEUIPlugin.getDefault().getImageDescriptor("newservlet_wiz")); //$NON-NLS-1$
 	}