Minor clean-up of the 4.2.1 migration.

- eliminated annotations in a few remaining abstract component classes
- cleaned up gui/gui2 feature bundle lists
- added version to the karaf features patch
- loading onos-rest by default in karaf features patch
- onos-gui loading still WIP

Change-Id: Ie5a74c0daee939a9d2de30e1737e4f88dd2ae478
diff --git a/core/common/src/main/java/org/onosproject/common/net/AbstractDeviceProvider.java b/core/common/src/main/java/org/onosproject/common/net/AbstractDeviceProvider.java
index 7912102..8b3cae4 100644
--- a/core/common/src/main/java/org/onosproject/common/net/AbstractDeviceProvider.java
+++ b/core/common/src/main/java/org/onosproject/common/net/AbstractDeviceProvider.java
@@ -17,7 +17,6 @@
 package org.onosproject.common.net;
 
 import org.osgi.service.component.annotations.Activate;
-import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Deactivate;
 import org.osgi.service.component.annotations.Reference;
 import org.osgi.service.component.annotations.ReferenceCardinality;
@@ -46,7 +45,6 @@
  * configuration.
  * </p>
  */
-@Component(immediate = true)
 public abstract class AbstractDeviceProvider extends AbstractProvider
         implements DeviceProvider {
 
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ConnectivityIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ConnectivityIntentCompiler.java
index 82729be..666128c 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ConnectivityIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/ConnectivityIntentCompiler.java
@@ -18,7 +18,6 @@
 import com.google.common.collect.FluentIterable;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
-import org.osgi.service.component.annotations.Component;
 import org.osgi.service.component.annotations.Reference;
 import org.osgi.service.component.annotations.ReferenceCardinality;
 import org.onlab.graph.DefaultEdgeWeigher;
@@ -66,7 +65,6 @@
  * Base class for compilers of various
  * {@link org.onosproject.net.intent.ConnectivityIntent connectivity intents}.
  */
-@Component(immediate = true)
 public abstract class ConnectivityIntentCompiler<T extends ConnectivityIntent>
         implements IntentCompiler<T> {
 
diff --git a/tools/package/etc/org.apache.karaf.features.cfg b/tools/package/etc/org.apache.karaf.features.cfg
index 9578400..88818f6 100644
--- a/tools/package/etc/org.apache.karaf.features.cfg
+++ b/tools/package/etc/org.apache.karaf.features.cfg
@@ -53,12 +53,12 @@
     webconsole/4.2.1, \
     scr/4.2.1, \
     war/4.2.1, \
-    onos-api, \
-    onos-core, \
-    onos-incubator, \
-    onos-cli,
-    #onos-gui,
-    #onos-rest
+    onos-api/1.15.0.SNAPSHOT, \
+    onos-core/1.15.0.SNAPSHOT, \
+    onos-incubator/1.15.0.SNAPSHOT, \
+    onos-cli/1.15.0.SNAPSHOT, \
+    onos-rest/1.15.0.SNAPSHOT
+    #onos-gui
 
 
 #
diff --git a/tools/package/features/BUILD b/tools/package/features/BUILD
index d9ae32b..de3fd20 100644
--- a/tools/package/features/BUILD
+++ b/tools/package/features/BUILD
@@ -169,7 +169,6 @@
     description = "ONOS GUI console components",
     included_bundles = [
         "//web/gui:onos-gui",
-        "@jetty_websocket//jar",
         "//utils/rest:onlab-rest",
     ],
     required_features = [
@@ -184,7 +183,6 @@
     description = "ONOS GUI2 components",
     included_bundles = [
         "//web/gui2:onos-gui2",
-        "@jetty_websocket//jar",
         "//utils/rest:onlab-rest",
     ],
     required_features = [
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/MainIndexResource.java b/web/gui/src/main/java/org/onosproject/ui/impl/MainIndexResource.java
index 12a8621..1e72b94 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/MainIndexResource.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/MainIndexResource.java
@@ -94,7 +94,8 @@
         // FIXME: use global opaque auth token to allow secure failover
 
         // for now, just use the user principal name...
-        String userName = ctx.getUserPrincipal().getName();
+        String userName = ctx != null && ctx.getUserPrincipal() != null ?
+                ctx.getUserPrincipal().getName() : "unknown";
 
         // get a session token to use for UI-web-socket authentication
         UiSessionToken token = tokens.issueToken(userName);
diff --git a/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java b/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
index bb07de1..77f0f1f 100644
--- a/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
+++ b/web/gui/src/main/java/org/onosproject/ui/impl/UiWebSocket.java
@@ -245,7 +245,7 @@
     }
 
     @OnWebSocketMessage
-    public void onMessage(String data) {
+    public void onText(Session session, String data) {
         lastActive = System.currentTimeMillis();
         try {
             ObjectNode message = (ObjectNode) mapper.reader().readTree(data);