Fix jersey 2 WARNs in RestconfApplication 35/72535/2
authorTom Pantelis <tompantelis@gmail.com>
Thu, 31 May 2018 19:35:06 +0000 (15:35 -0400)
committerTom Pantelis <tompantelis@gmail.com>
Thu, 31 May 2018 23:02:54 +0000 (19:02 -0400)
16:11:13 2018-05-31T16:08:28,928 | WARN  | Blueprint Extender: 2 | Providers                        | 197 - org.glassfish.jersey.core.jersey-common - 2.25.1 | A provider org.opendaylight.netconf.sal.restconf.impl.ControllerContext registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.opendaylight.netconf.sal.restconf.impl.ControllerContext will be ignored.
16:11:13 2018-05-31T16:08:28,929 | WARN  | Blueprint Extender: 2 | Providers                        | 197 - org.glassfish.jersey.core.jersey-common - 2.25.1 | A provider org.opendaylight.netconf.sal.restconf.impl.BrokerFacade registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider org.opendaylight.netconf.sal.restconf.impl.BrokerFacade will be ignored.

We shouldn't return ControllerContext and BrokerFacade as singletons.

Change-Id: I64aa7c6da97fa12f0203b8664d07c1af04f93c6b
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/rest/impl/RestconfApplication.java
restconf/restconf-nb-bierman02/src/main/resources/org/opendaylight/blueprint/restconf-config.xml

index 54a81d6b9871f4cf7925865b932837fe0013ecd0..4a49edf69170e889429981671bc65d22900982e9 100644 (file)
@@ -14,19 +14,16 @@ import javax.ws.rs.core.Application;
 import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContentYangBodyWriter;
 import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContentYinBodyWriter;
 import org.opendaylight.netconf.md.sal.rest.schema.SchemaRetrievalServiceImpl;
-import org.opendaylight.netconf.sal.restconf.impl.BrokerFacade;
 import org.opendaylight.netconf.sal.restconf.impl.ControllerContext;
 import org.opendaylight.netconf.sal.restconf.impl.StatisticsRestconfServiceWrapper;
 
 public class RestconfApplication extends Application {
     private final ControllerContext controllerContext;
-    private final BrokerFacade brokerFacade;
     private final StatisticsRestconfServiceWrapper statsServiceWrapper;
 
-    public RestconfApplication(ControllerContext controllerContext, BrokerFacade brokerFacade,
+    public RestconfApplication(ControllerContext controllerContext,
             StatisticsRestconfServiceWrapper statsServiceWrapper) {
         this.controllerContext = controllerContext;
-        this.brokerFacade = brokerFacade;
         this.statsServiceWrapper = statsServiceWrapper;
     }
 
@@ -46,8 +43,6 @@ public class RestconfApplication extends Application {
     public Set<Object> getSingletons() {
         final Set<Object> singletons = new HashSet<>();
         final SchemaRetrievalServiceImpl schemaRetrieval = new SchemaRetrievalServiceImpl(controllerContext);
-        singletons.add(controllerContext);
-        singletons.add(brokerFacade);
         singletons.add(schemaRetrieval);
         singletons.add(new RestconfCompositeWrapper(statsServiceWrapper, schemaRetrieval));
         singletons.add(new RestconfDocumentedExceptionMapper(controllerContext));
index 75163a821cf0db7750faadd37ea14583b9506597..61201af0f398a3d5fc9d3532fca656b0efe00432 100644 (file)
@@ -85,7 +85,6 @@
 
   <bean id="restconfApplication" class="org.opendaylight.netconf.sal.rest.impl.RestconfApplication">
     <argument ref="controllerContext"/>
-    <argument ref="brokerFacade"/>
     <argument ref="statsServiceWrapper"/>
   </bean>