Fixes for problems with starting and stopping apps in a minimal system

- Missing app dependencies
- Incorrect provider registrations
- Fatal execeptions thrown when external resources are not present

Change-Id: I3fdcf0666c88a47f399a722a9ab549d1104ff40e
diff --git a/apps/castor/BUILD b/apps/castor/BUILD
index 38b93ce..546453b 100644
--- a/apps/castor/BUILD
+++ b/apps/castor/BUILD
@@ -28,7 +28,10 @@
     category = "Utility",
     description = "Castor application",
     included_bundles = BUNDLES,
-    required_apps = ["org.onosproject.intentsynchronizer"],
+    required_apps = [
+        "org.onosproject.intentsynchronizer",
+        "org.onosproject.route-service",
+    ],
     title = "Castor",
     url = "http://onosproject.org",
 )
diff --git a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/DhcpManager.java b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/DhcpManager.java
index 6480e2b..51312e8 100644
--- a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/DhcpManager.java
+++ b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/impl/DhcpManager.java
@@ -104,7 +104,7 @@
 )
 public class DhcpManager implements DhcpService {
 
-    private static final ProviderId PID = new ProviderId("of", "org.onosproject.dhcp", true);
+    private static final ProviderId PID = new ProviderId("of", "org.onosproject.dhcp");
 
     private final Logger log = LoggerFactory.getLogger(getClass());
 
diff --git a/apps/gangliametrics/BUILD b/apps/gangliametrics/BUILD
index b76c08c..85402ba 100644
--- a/apps/gangliametrics/BUILD
+++ b/apps/gangliametrics/BUILD
@@ -4,7 +4,7 @@
     "@remotetea_oncrpc//jar",
 ]
 
-EXCLUDED_BUNDLES = [
+INCLUDED_BUNDLES = [
     "@gmetric4j//jar",
     "@metrics_ganglia//jar",
     "@remotetea_oncrpc//jar",
@@ -17,7 +17,7 @@
 onos_app(
     category = "Monitoring",
     description = "Performance metric service reporter",
-    excluded_bundles = EXCLUDED_BUNDLES,
+    included_bundles = INCLUDED_BUNDLES,
     title = "Ganglia Report and Query",
     url = "http://onosproject.org",
 )
diff --git a/apps/l3vpn/BUILD b/apps/l3vpn/BUILD
index 1c4b585..8e670a4 100644
--- a/apps/l3vpn/BUILD
+++ b/apps/l3vpn/BUILD
@@ -24,6 +24,8 @@
     "org.onosproject.models.common",
     "org.onosproject.models.l3vpn",
     "org.onosproject.bgpcep",
+    "org.onosproject.pcep",
+    "org.onosproject.bgp",
 ]
 
 osgi_jar_with_tests(
diff --git a/apps/rabbitmq/src/main/java/org/onosproject/rabbitmq/impl/MQSender.java b/apps/rabbitmq/src/main/java/org/onosproject/rabbitmq/impl/MQSender.java
index 0b22178..3058557 100644
--- a/apps/rabbitmq/src/main/java/org/onosproject/rabbitmq/impl/MQSender.java
+++ b/apps/rabbitmq/src/main/java/org/onosproject/rabbitmq/impl/MQSender.java
@@ -106,7 +106,7 @@
             channel.queueDeclare(this.queueName, true, false, false, null);
             channel.queueBind(queueName, exchangeName, routingKey);
         } catch (Exception e) {
-            log.error(E_CREATE_CHAN, e);
+            log.warn(E_CREATE_CHAN, e.getMessage());
         }
     }
 
diff --git a/apps/routing/cpr/BUILD b/apps/routing/cpr/BUILD
index 468a283..17a3696 100644
--- a/apps/routing/cpr/BUILD
+++ b/apps/routing/cpr/BUILD
@@ -18,11 +18,16 @@
     "//apps/routing-api:onos-apps-routing-api",
 ]
 
+APPS = [
+    "org.onosproject.route-service",
+]
+
 onos_app(
     app_name = "org.onosproject.cpr",
     category = "Traffic Engineering",
     description = "Redirects routing control traffic to a control plane",
     included_bundles = BUNDLES,
+    required_apps = APPS,
     title = "Control Plane Redirect",
     url = "http://onosproject.org",
 )
diff --git a/apps/simplefabric/BUILD b/apps/simplefabric/BUILD
index 3fabae0..358adcd 100644
--- a/apps/simplefabric/BUILD
+++ b/apps/simplefabric/BUILD
@@ -11,6 +11,7 @@
         "org.onosproject.openflow-base",
         "org.onosproject.lldpprovider",
         "org.onosproject.hostprovider",
+        "org.onosproject.route-service",
     ],
     title = "SONA SimpleFabric",
     url = "http://onosproject.org",
diff --git a/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java b/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java
index 209d11d..4ae5121 100644
--- a/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java
+++ b/apps/virtualbng/src/main/java/org/onosproject/virtualbng/VbngManager.java
@@ -138,7 +138,7 @@
                             vbngConfigurationService.getXosRestPort());
             map = restClient.getRest();
         } catch (Exception e) {
-            log.error("Could not contact XOS", e);
+            log.warn("Could not contact XOS {}", e.getMessage());
             return;
         }
         if (map == null) {