219627 NullPointerException Could not publish to the server
diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java
index d65995c..c61fbc8 100644
--- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java
+++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/deployables/J2EEFlexProjDeployable.java
@@ -424,15 +424,17 @@
     	else if (component!=null && J2EEProjectUtilities.isDynamicWebProject(component.getProject())) {
     		if (module != null) {
 				IVirtualComponent webComp = ComponentCore.createComponent(component.getProject());
-				IVirtualReference reference = webComp.getReference(module.getProject().getName());
+				String extension = IJ2EEModuleConstants.JAR_EXT;
 				if (J2EEProjectUtilities.isDynamicWebProject(module.getProject())) {
-					aURI = ComponentUtilities.getDeployUriOfComponent(reference, IJ2EEModuleConstants.WAR_EXT);
+					extension = IJ2EEModuleConstants.WAR_EXT;
+				} else if (J2EEProjectUtilities.isJCAProject(module.getProject())) {
+					extension = IJ2EEModuleConstants.RAR_EXT;
 				}
-				else if (J2EEProjectUtilities.isJCAProject(module.getProject())) {
-					aURI = ComponentUtilities.getDeployUriOfComponent(reference, IJ2EEModuleConstants.RAR_EXT);
-				}
-				else {
-					aURI = ComponentUtilities.getDeployUriOfComponent(reference, IJ2EEModuleConstants.JAR_EXT);
+				IVirtualReference reference = webComp.getReference(module.getProject().getName());
+				if(reference != null){
+					aURI = ComponentUtilities.getDeployUriOfComponent(reference, extension);
+				} else {
+					aURI = webComp.getDeployedName() + extension;
 				}
 			}
     	}