Fixing GUI packaging and web-socket code to allow onos-gui feature to load properly.

Change-Id: Idb3ed6ec1b96b3bfae75039de4644983ac4014bd
diff --git a/tools/package/etc/org.apache.karaf.features.cfg b/tools/package/etc/org.apache.karaf.features.cfg
index 33cb5cf..ed40d61 100644
--- a/tools/package/etc/org.apache.karaf.features.cfg
+++ b/tools/package/etc/org.apache.karaf.features.cfg
@@ -57,8 +57,8 @@
     onos-core/$ONOS_VERSION, \
     onos-incubator/$ONOS_VERSION, \
     onos-cli/$ONOS_VERSION, \
-    onos-rest/$ONOS_VERSION
-    #onos-gui/$ONOS_VERSION
+    onos-rest/$ONOS_VERSION, \
+    onos-gui/$ONOS_VERSION
 
 
 #
diff --git a/tools/package/onos-run-karaf b/tools/package/onos-run-karaf
index e86306b..c22ab95 100755
--- a/tools/package/onos-run-karaf
+++ b/tools/package/onos-run-karaf
@@ -10,7 +10,7 @@
 
 function killServer() {
     echo "Killing ONOS server..."
-    ps -e | grep apache.karaf.main.Main | grep -v grep | cut -d\  -f1 | xargs kill -9 &>/dev/null
+    ps -e | grep apache.karaf.main.Main | grep -v grep | cut -c1-6 | xargs kill -9 &>/dev/null
 }
 
 # Kill any running instances
diff --git a/web/gui/BUILD b/web/gui/BUILD
index 44b292f..302e793 100644
--- a/web/gui/BUILD
+++ b/web/gui/BUILD
@@ -194,7 +194,7 @@
 """
 
 osgi_jar_with_tests(
-    name = "_onos-gui-base-jar",
+    name = "onos-gui-jar",
     exclude_tests = [
         "org.onosproject.ui.impl.AbstractUiImplTest",
         "org.onosproject.ui.impl.topo.model.AbstractTopoModelTest",
@@ -227,7 +227,7 @@
     name = "onos-gui",
     srcs = [
         ":_onos-gui-npm-build",
-        ":_onos-gui-base-jar",
+        ":onos-gui-jar",
         ":_root_level_files",
         ":_web_inf_classes_files",
         ":_raw_classes_files",
@@ -243,7 +243,7 @@
           " for i in $(locations :_web_inf_classes_files); do cp $$ROOT/$$i ./WEB-INF/classes/; done &&" +
           " mkdir ./WEB-INF/classes/raw && " +
           " for i in $(locations :_raw_classes_files); do cp $$ROOT/$$i ./WEB-INF/classes/raw/; done &&" +
-          " jar xf $$ROOT/$(location :_onos-gui-base-jar) &&" +
+          " jar xf $$ROOT/$(location :onos-gui-jar) &&" +
           " find . -type f -exec touch -t 201806280000 {} \; &&" +
           " jar cmf META-INF/MANIFEST.MF $$ROOT/$@ .",
     output_to_bindir = 1,
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocketServlet.java b/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocketServlet.java
index 040e98a..8d5d1c9 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocketServlet.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocketServlet.java
@@ -124,7 +124,7 @@
     }
 
     // FIXME: This should not be necessary
-    private static final String FAKE_USERNAME = "UI-user";
+    private static final String FAKE_USERNAME = "unknown";
 
     public class UiWebSocketCreator implements WebSocketCreator {
         @Override
@@ -136,6 +136,7 @@
 
                 UiWebSocket socket = new UiWebSocket(directory, userName);
                 sockets.add(socket);
+                return socket;
             }
             return null;
         }