[328093] EAR Library Directory field should not have preceding slash
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/buildnotes_org.eclipse.jst.enterprise_ui.feature.patch.html b/features/org.eclipse.jst.enterprise_ui.feature.patch/buildnotes_org.eclipse.jst.enterprise_ui.feature.patch.html
index a7f2709..a46086c 100644
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/buildnotes_org.eclipse.jst.enterprise_ui.feature.patch.html
+++ b/features/org.eclipse.jst.enterprise_ui.feature.patch/buildnotes_org.eclipse.jst.enterprise_ui.feature.patch.html
@@ -35,6 +35,8 @@
 <p>Bug <a href='https://bugs.eclipse.org/321884'>321884</a>. Backport 289113: Linux: usability issue when selecting a Java Project in the Specify Client Project Settings dialog</p>
 <p>Bug <a href='https://bugs.eclipse.org/322436'>322436</a>. AddModulestoEARPropertiesPage.updateLibDir() method should call getModelObject() method from inside modify block</p>
 <p>Bug <a href='https://bugs.eclipse.org/322938'>322938</a>. Internal component path info bleeding through EAR J2EE Module Dependencies properties page</p>
+<p>Bug <a href='https://bugs.eclipse.org/328093'>328093</a>. EAR Library Directory field should not have preceding slash</p>
+<p>Bug <a href='https://bugs.eclipse.org/328652'>328652</a>. Sample JSPs: SOAPElement or Element parameters result in compile errors in sample</p>
 
 </body>
 </html>
\ No newline at end of file
diff --git a/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.properties b/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.properties
index 4b826a8..ddfd1e4 100644
--- a/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.properties
+++ b/features/org.eclipse.jst.enterprise_ui.feature.patch/feature.properties
@@ -52,6 +52,8 @@
 Bug https://bugs.eclipse.org/321884 Backport 289113: Linux: usability issue when selecting a Java Project in the Specify Client Project Settings dialog\n\
 Bug https://bugs.eclipse.org/322436 AddModulestoEARPropertiesPage.updateLibDir() method should call getModelObject() method from inside modify block\n\
 Bug https://bugs.eclipse.org/322938 Internal component path info bleeding through EAR J2EE Module Dependencies properties page\n\
+Bug https://bugs.eclipse.org/328093 EAR Library Directory field should not have preceding slash\n\
+Bug https://bugs.eclipse.org/328652 Sample JSPs: SOAPElement or Element parameters result in compile errors in sample\n\
 \n\
 
 # "copyright" property - text of the "Feature Update Copyright"
diff --git a/plugins/org.eclipse.jst.j2ee.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee.ui/META-INF/MANIFEST.MF
index 9bec09c..372d268 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.j2ee.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.jst.j2ee.ui; singleton:=true
-Bundle-Version: 1.1.213.qualifier
+Bundle-Version: 1.1.214.qualifier
 Bundle-Activator: org.eclipse.jst.j2ee.internal.plugin.J2EEUIPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AddModulestoEARPropertiesPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AddModulestoEARPropertiesPage.java
index da7a438..106c434 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AddModulestoEARPropertiesPage.java
+++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/AddModulestoEARPropertiesPage.java
@@ -163,7 +163,7 @@
 				Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
 				if (app != null)
 					oldLibDir = app.getLibraryDirectory();
-				if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+				if (oldLibDir == null) oldLibDir = new Path(J2EEConstants.EAR_DEFAULT_LIB_DIR).makeRelative().toString();
 				libDir = oldLibDir;
 			}
 		}
@@ -276,7 +276,7 @@
 		final IEARModelProvider earModel = (IEARModelProvider)ModelProviderManager.getModelProvider(project);
 		Application app = (Application) earModel.getModelObject();
 		oldLibDir = app.getLibraryDirectory();
-		if (oldLibDir == null) oldLibDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+		if (oldLibDir == null) oldLibDir = new Path(J2EEConstants.EAR_DEFAULT_LIB_DIR).makeRelative().toString();
 		earModel.modify(new Runnable() {
 			public void run() {
 			Application app2 = (Application)earModel.getModelObject();			
@@ -382,8 +382,9 @@
 								execAddOp1(monitor, javaProjectsList, j2eeComponentList, J2EEConstants.EAR_ROOT_DIR);								
 							} 
 							if (shouldBndRun) {
-								execAddOp(monitor, bndList, libDir);
-								execAddOp1(monitor, javaLibProjectsList, j2eeLibElementList, libDir);																
+								String libDirPath = new Path(libDir).makeAbsolute().toString();
+								execAddOp(monitor, bndList, libDirPath);
+								execAddOp1(monitor, javaLibProjectsList, j2eeLibElementList, libDirPath);																
 							} 
 						}
 					};
@@ -427,7 +428,8 @@
 				List[] list = getComponentsToRemoveUpdate(!libDir.equals(oldLibDir)); 
 				remComps(list[0], J2EEConstants.EAR_ROOT_DIR);
 				
-				remComps(list[1], oldLibDir);
+				String oldLibDirPath = new Path(oldLibDir).makeAbsolute().toString();
+				remComps(list[1], oldLibDirPath);
 			}
 		}
 		return stat;
@@ -488,7 +490,7 @@
 					list[0].add(handle);
 				}
 				if((!j2eeLibElementList.contains(handle) || dirUpdated) &&
-						ref.getRuntimePath().toString().equals(oldLibDir)) {	
+						ref.getRuntimePath().makeRelative().equals(new Path(oldLibDir).makeRelative())) {	
 					list[1].add(handle);
 				}
 			}
@@ -618,16 +620,13 @@
 		Application app = (Application)ModelProviderManager.getModelProvider(project).getModelObject();
 		if (libDir == null) {
 			libDir = app.getLibraryDirectory();
-			if (libDir == null) libDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+			if (libDir == null) libDir = new Path(J2EEConstants.EAR_DEFAULT_LIB_DIR).makeRelative().toString();
 		}
 		
 		ChangeLibDirDialog dlg = new ChangeLibDirDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow()
                 .getShell(), libDir, warnBlank);
 		if (dlg.open() == Dialog.CANCEL) return;
 		libDir = dlg.getValue().trim();
-		if (libDir.length() > 0) {
-			if (!libDir.startsWith(J2EEConstants.EAR_ROOT_DIR)) libDir = IPath.SEPARATOR + libDir;
-		}
 		setLibDirInContentProvider();
 		refresh();
 	}
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/JARDependencyPropertiesPage.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/JARDependencyPropertiesPage.java
index 915f976..9c08cfd 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/JARDependencyPropertiesPage.java
+++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/JARDependencyPropertiesPage.java
@@ -945,6 +945,8 @@
 		IStatus stat = IDataModelProvider.OK_STATUS;
 		String libDir = ((Application)ModelProviderManager.getModelProvider(earComponent.getProject()).getModelObject()).getLibraryDirectory();
 		libDir = (libDir == null) ? J2EEConstants.EAR_DEFAULT_LIB_DIR : libDir;
+		if(libDir != null)
+			libDir = new Path(libDir).makeAbsolute().toString();
 		Map dependentComps = getEARModuleDependencies(earComponent, compsToUncheckList);
 		try {
 			IDataModelOperation op = removeComponentFromEAROperation(earComponent, compsToUncheckList, libDir);
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ChangeLibDirDialog.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ChangeLibDirDialog.java
index 0326fa4..713e369 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ChangeLibDirDialog.java
+++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/dialogs/ChangeLibDirDialog.java
@@ -36,22 +36,27 @@
     					J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR), 
     					J2EEUIMessages.getResourceString(J2EEUIMessages.BLANK_LIB_DIR_CONFIRM))) return;
         	} else {
-    			if (res.startsWith("" + IPath.SEPARATOR)); //$NON-NLS-1$
-    			res = res.substring(1);	
-    			String[] segments = res.split("" + IPath.SEPARATOR); //$NON-NLS-1$
-    			Path p = new Path(""); //$NON-NLS-1$
-    			boolean valid = true;
-    			for (int i = 0; i < segments.length; i++) {
-    				valid = p.isValidSegment(segments[i]);
-    				if (!valid)
-    					break;
-    			}
-    			if (!valid) {
+    			if (res.startsWith("" + IPath.SEPARATOR)) { //$NON-NLS-1$
     				MessageDialog.openError(null, 
     						J2EEUIMessages.getResourceString(J2EEUIMessages.INVALID_PATH), 
-    						J2EEUIMessages.getResourceString(J2EEUIMessages.INVALID_PATH_MSG));	
+    						J2EEUIMessages.getResourceString(J2EEUIMessages.INVALID_PATH_STARTS_WITH_SLASH_MSG));	
     				return;
-    			}	        		
+    			} else {
+	    			String[] segments = res.split("" + IPath.SEPARATOR); //$NON-NLS-1$
+	    			Path p = new Path(""); //$NON-NLS-1$
+	    			boolean valid = true;
+	    			for (int i = 0; i < segments.length; i++) {
+	    				valid = p.isValidSegment(segments[i]);
+	    				if (!valid)
+	    					break;
+	    			}
+	    			if (!valid) {
+	    				MessageDialog.openError(null, 
+	    						J2EEUIMessages.getResourceString(J2EEUIMessages.INVALID_PATH), 
+	    						J2EEUIMessages.getResourceString(J2EEUIMessages.INVALID_PATH_MSG));	
+	    				return;
+	    			}
+    			}
         	}
         } 
         super.buttonPressed(buttonId);
diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java
index ddcf5bc..80e8734 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java
+++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIMessages.java
@@ -201,6 +201,7 @@
 	public static final String BLANK_LIB_DIR_WARN_QUESTION = "BLANK_LIB_DIR_WARN_QUESTION";//$NON-NLS-1$	
 	public static final String INVALID_PATH = "INVALID_PATH";//$NON-NLS-1$
 	public static final String INVALID_PATH_MSG = "INVALID_PATH_MSG";//$NON-NLS-1$
+	public static final String INVALID_PATH_STARTS_WITH_SLASH_MSG = "INVALID_PATH_STARTS_WITH_SLASH_MSG";//$NON-NLS-1$
 	public static final String DEPENDENCY_CONFLICT_TITLE = "DEPENDENCY_CONFLICT_TITLE";//$NON-NLS-1$
 	public static final String DEPENDENCY_CONFLICT_MSG_1 = "DEPENDENCY_CONFLICT_MSG_1";//$NON-NLS-1$
 	public static final String DEPENDENCY_CONFLICT_MSG_2 = "DEPENDENCY_CONFLICT_MSG_2";//$NON-NLS-1$	
diff --git a/plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties b/plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties
index 54e05e3..c9b1a76 100644
--- a/plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties
+++ b/plugins/org.eclipse.jst.j2ee.ui/property_files/j2ee_ui.properties
@@ -348,6 +348,7 @@
 BLANK_LIB_DIR_WARN_QUESTION=The specified library directory is blank. In result, all the libraries will be packed in the root directory. Are you sure you want this? (If you want to leave the bundled libraries directory blank, click 'Yes'. If you want to change it, click 'No')
 INVALID_PATH=Invalid Path
 INVALID_PATH_MSG=The entered path is invalid for a library directory. Please enter a valid path, different from root!
+INVALID_PATH_STARTS_WITH_SLASH_MSG=Library directory value cannot begin with a slash ('/') character.
 DEPENDENCY_CONFLICT_TITLE=Dependencies Conflict
 DEPENDENCY_CONFLICT_MSG_1=This JAR is a bundled library of an EAR project and is supposed to be packed in the EAR's library directory. It conflicts with the manifest class path dependency you are trying to create. If you create this dependency, the JAR will be packed in the root (not library) directory of the EAR. Are you sure you want to proceed?
 DEPENDENCY_CONFLICT_MSG_2=This JAR is also a manifest class path dependency of a module in this EAR. It conflicts with packing the JAR in the library directory. If you want this JAR packed in the library directory, then it will be removed as a manifest class path dependency from all modules in this EAR. Are you sure you want to proceed?  
diff --git a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF
index f1a7fdb..c1c3d24 100644
--- a/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.j2ee/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.jst.j2ee; singleton:=true
-Bundle-Version: 1.1.215.qualifier
+Bundle-Version: 1.1.216.qualifier
 Bundle-Activator: org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin
 Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
diff --git a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java
index f314ddd..bd56ff3 100644
--- a/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java
+++ b/plugins/org.eclipse.jst.j2ee/archiveops/org/eclipse/jst/j2ee/internal/archive/JavaEEArchiveUtilities.java
@@ -789,7 +789,7 @@
 			
 			// default lib dir if there is no deployment descriptor
 			// or if the deployment descriptor does not override
-			String libDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+			String libDir = new Path(J2EEConstants.EAR_DEFAULT_LIB_DIR).makeRelative().toString();
 			
 			// retrieve the model provider
 			IModelProvider modelProvider = ModelProviderManager.getModelProvider(earProject);
@@ -819,14 +819,15 @@
 		}
 			
 		private boolean isInLibDir(IVirtualComponent earComp, IVirtualComponent component, String libDir){
-			if (libDir != null) {
+			if (libDir != null && libDir.length() > 0) {
 				IVirtualReference earRef = earComp.getReference(component.getName());
+				IPath libDirPath = new Path(libDir).makeRelative();
 				if(earRef != null){
-					if(libDir.equals(earRef.getRuntimePath().toString())){
+					if(libDirPath.equals(earRef.getRuntimePath().makeRelative())){
 						return true;
 					}
 					IPath fullPath = earRef.getRuntimePath().append(earRef.getArchiveName());
-					if(fullPath.removeLastSegments(1).toString().equals(libDir)){
+					if(fullPath.removeLastSegments(1).makeRelative().equals(libDirPath)){
 						return true;
 					}
 				}
diff --git a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java
index 39f3384..b4fe51d 100644
--- a/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java
+++ b/plugins/org.eclipse.jst.j2ee/common/org/eclipse/jst/j2ee/internal/common/classpath/J2EEComponentClasspathContainer.java
@@ -324,20 +324,27 @@
 				// retrieve the EAR's library directory 
 				String libDir = getEARLibDir(earComp);
 				// if the EAR version is lower than 5, then the library directory will be null
-				if (libDir != null) {
+				// or if it is the empty string, do nothing.
+				if (libDir != null && libDir.trim().length() != 0) {
+					IPath libDirPath = new Path(libDir).makeRelative();
 					// check if the component itself is not in the library directory of this EAR - avoid cycles in the build patch
-					if (!libDir.equals(earComp.getReference(component.getName()).getRuntimePath().toString())) {
-						// retrieve the referenced components from the EAR
-						IVirtualReference[] earRefs = earComp.getReferences();
-						for (IVirtualReference earRef : earRefs) {
-							// check if the referenced component is in the library directory
-							boolean isInLibDir = libDir.equals(earRef.getRuntimePath().toString());
-							if(!isInLibDir){
-								IPath fullPath = earRef.getRuntimePath().append(earRef.getArchiveName());
-								isInLibDir = fullPath.removeLastSegments(1).toString().equals(libDir);
-							}
-							if (isInLibDir) {
-								libRefs.add(earRef);
+					IVirtualReference ref = earComp.getReference(component.getName());
+					if(ref != null){
+						IPath refPath = ref.getRuntimePath().makeRelative();
+						if (!libDirPath.equals(refPath)) {
+							// retrieve the referenced components from the EAR
+							IVirtualReference[] earRefs = earComp.getReferences();
+							for (IVirtualReference earRef : earRefs) {
+								// check if the referenced component is in the library directory
+								IPath runtimePath = earRef.getRuntimePath().makeRelative();
+								boolean isInLibDir = libDirPath.equals(runtimePath);
+								if(!isInLibDir){
+									IPath fullPath = earRef.getRuntimePath().append(earRef.getArchiveName());
+									isInLibDir = fullPath.removeLastSegments(1).makeRelative().equals(libDirPath);
+								}
+								if (isInLibDir) {
+									libRefs.add(earRef);
+								}
 							}
 						}
 					}
@@ -421,7 +428,7 @@
 		
 		// default lib dir if there is no deployment descriptor
 		// or if the deployment descriptor does not override
-		String libDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+		String libDir = new Path(J2EEConstants.EAR_DEFAULT_LIB_DIR).makeRelative().toString();
 		
 		// retrieve the model provider
 		IModelProvider modelProvider = ModelProviderManager.getModelProvider(earProject);
diff --git a/plugins/org.eclipse.jst.jee.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.jst.jee.ui/META-INF/MANIFEST.MF
index 9a31307..f1599cc 100644
--- a/plugins/org.eclipse.jst.jee.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jst.jee.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name.0
 Bundle-SymbolicName: org.eclipse.jst.jee.ui;singleton:=true
-Bundle-Version: 1.0.105.qualifier
+Bundle-Version: 1.0.106.qualifier
 Bundle-Activator: org.eclipse.jst.jee.ui.plugin.JEEUIPlugin
 Require-Bundle: org.eclipse.ui;bundle-version="[3.2.0,4.0.0)",
  org.eclipse.core.runtime;bundle-version="[3.2.0,4.0.0)",
diff --git a/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/dnd/AddProjectToEARDropAssistant.java b/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/dnd/AddProjectToEARDropAssistant.java
index eb4d4be..6fbf6ba 100644
--- a/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/dnd/AddProjectToEARDropAssistant.java
+++ b/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/dnd/AddProjectToEARDropAssistant.java
@@ -27,6 +27,7 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
@@ -116,7 +117,10 @@
 					 * directory check for conflicts with projects referenced by
 					 * the ear referencing the same lib
 					 */
-					if (libDir.length() > 0 && !libDir.equals(reference.getRuntimePath().toString())) {
+					IPath libDirPath = null;
+					if(libDir != null)
+						libDirPath = new Path(libDir).makeRelative();
+					if (libDir.length() > 0 && libDirPath != null && !libDirPath.equals(reference.getRuntimePath().makeRelative())) {
 						if (hasConflictingProjectInMetaInf(reference)) {
 							DependencyConflictResolveDialog dlg = new DependencyConflictResolveDialog(getShell(), DependencyConflictResolveDialog.DLG_TYPE_2);
 							if (dlg.open() == DependencyConflictResolveDialog.BTN_ID_CANCEL) {
@@ -215,7 +219,7 @@
 				if (target instanceof BundledNode && ((BundledNode) target).getBundledLibsDirectoryNode() == null) {
 					libDir = ((Application) ModelProviderManager.getModelProvider(earProject).getModelObject()).getLibraryDirectory();
 					if (libDir == null) {
-						libDir = J2EEConstants.EAR_DEFAULT_LIB_DIR;
+						libDir = new Path(J2EEConstants.EAR_DEFAULT_LIB_DIR).makeRelative().toString();
 					}
 				}
 
@@ -505,7 +509,10 @@
 		datamodel.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, earComponent);
 		datamodel.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, components);
 		datamodel.setProperty(IAddComponentToEnterpriseApplicationDataModelProperties.TARGET_COMPONENTS_TO_URI_MAP, componentToURIMap);
-		datamodel.setProperty(IAddComponentToEnterpriseApplicationDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, libDir);
+		String libDirPath = libDir; 
+		if(libDir != null && libDir.length() > 0)
+			libDirPath = new Path(libDir).makeAbsolute().toString();
+		datamodel.setProperty(IAddComponentToEnterpriseApplicationDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, libDirPath);
 		try {
 			return datamodel.getDefaultOperation().execute(new NullProgressMonitor(), null);
 		} catch (ExecutionException e) {
@@ -547,7 +554,7 @@
 		model.setProperty(ICreateReferenceComponentsDataModelProperties.SOURCE_COMPONENT, sourceComponent);
 		model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENT_LIST, components);
 		if (libDir.length() > 0) {
-			model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, libDir);
+			model.setProperty(ICreateReferenceComponentsDataModelProperties.TARGET_COMPONENTS_DEPLOY_PATH, new Path(libDir).makeAbsolute().toString());
 		}
 		try {
 			return model.getDefaultOperation().execute(null, null);
diff --git a/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/ear/AbstractEarNode.java b/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/ear/AbstractEarNode.java
index c9afda4..bb4fd97 100644
--- a/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/ear/AbstractEarNode.java
+++ b/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/ear/AbstractEarNode.java
@@ -68,6 +68,10 @@
 		List components = new ArrayList();
 		IVirtualComponent earComponent = virtualComponent;
 		if (earComponent != null ) {
+			IPath relativeRuntimePath = null;
+			if (runtimePath != null){
+				relativeRuntimePath = runtimePath.makeRelative();
+			}
 			IVirtualReference[] refComponents = earComponent.getReferences();
 			for (int i = 0; i < refComponents.length; i++) {
 				IVirtualComponent module = refComponents[i].getReferencedComponent();
@@ -75,9 +79,9 @@
 				// if component types passed in is null then return all components
 				if (componentTypes == null || componentTypes.size() == 0) {
 					components.add(refComponents[i]);
-				} else {
+				} else if (relativeRuntimePath != null){
 					IPath runtimePath2 = getRealRuntimePath(refComponents[i]);
-					if (runtimePath2.equals(runtimePath) && componentTypes.contains(JavaEEProjectUtilities.getJ2EEComponentType(module))) {
+					if (!relativeRuntimePath.isEmpty() && runtimePath2.makeRelative().equals(relativeRuntimePath) && componentTypes.contains(JavaEEProjectUtilities.getJ2EEComponentType(module))) {
 						components.add(refComponents[i]);
 					}
 				}
@@ -97,14 +101,18 @@
 		List components = new ArrayList();
 		IVirtualComponent earComponent = virtualComponent;
 		if (earComponent != null ) {
+			IPath relativeRuntimePath = null;
+			if (runtimePath != null){
+				relativeRuntimePath = runtimePath.makeRelative();
+			}
 			IVirtualReference[] refComponents = earComponent.getReferences();
 			for (int i = 0; i < refComponents.length; i++) {
 				IVirtualComponent module = refComponents[i].getReferencedComponent();
 				if (module == null) continue;
 				// if component types passed in is null then return all components
-				if (module.isBinary() && getRealRuntimePath(refComponents[i]).equals(runtimePath)) {
+				if (module.isBinary() && relativeRuntimePath != null && !relativeRuntimePath.isEmpty() && getRealRuntimePath(refComponents[i]).makeRelative().equals(relativeRuntimePath)) {
 					if (componentTypes != null && !componentTypes.contains(JavaEEProjectUtilities.getJ2EEComponentType(module)) ) {
-						if (!runtimePath.equals(new Path("/"))){//$NON-NLS-1$
+						if (runtimePath != null && !runtimePath.equals(new Path("/"))){//$NON-NLS-1$
 							components.add(refComponents[i]);
 						}
 					} else {
@@ -139,7 +147,7 @@
 		Object modelObject = modelProvider.getModelObject();
 		if (Application.class.isInstance(modelObject)){
 			String libraryDirectory = ((Application)modelObject).getLibraryDirectory();
-			return libraryDirectory != null && libraryDirectory.length()>0 ? libraryDirectory : EAR_DEFAULT_LIB;
+			return libraryDirectory != null ? libraryDirectory : EAR_DEFAULT_LIB;
 		}
 		return EAR_DEFAULT_LIB;
 	}
diff --git a/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/ear/BundledNode.java b/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/ear/BundledNode.java
index d16f6a5..7eac820 100644
--- a/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/ear/BundledNode.java
+++ b/plugins/org.eclipse.jst.jee.ui/src/org/eclipse/jst/jee/ui/internal/navigator/ear/BundledNode.java
@@ -77,8 +77,8 @@
 			
 			IPath runtimePath =  getRealRuntimePath(reference);
 
-			if (runtimePath != null && runtimePath.segment(0) != null && 
-					runtimePath.equals(libPath)) {
+			if (runtimePath != null && runtimePath.segment(0) != null && !libPath.makeRelative().isEmpty() &&
+					runtimePath.makeRelative().equals(libPath.makeRelative())) {
 				if (bundledLibsDirectoryNode == null){
 					modules.add(libs.get(i));
 				}