Uploaded image for project: 'Opencast'
  1. MH-12192

RestPublisher's CacheLoader continuous WARN log for SeriesServiceRemoteImpl

    Details

      Description

      The Engage server continually posts this log line:
      WARN | (RestPublisher$1:150) - No service reference found for class org.opencastproject.series.remote.SeriesServiceRemoteImpl

      From this snippet:

        private final CacheLoader<Class<?>, Object> servicePathLoader = new CacheLoader<Class<?>, Object>() {
          @Override
          public Object load(Class<?> clazz) {
            ServiceReference<?> ref = componentContext.getBundleContext().getServiceReference(clazz.getName());
            if (ref == null) {
              logger.warn("No service reference found for class {}", clazz.getName());
              return nullToken;
            }
            String servicePath = (String) ref.getProperty(SERVICE_PATH_PROPERTY);
            return StringUtils.isBlank(servicePath) ? nullToken : servicePath;
          }
        };
      

      Proposed Solution:
      The other Opencast REST classes provide their class name in their OSGI-INF scr component files. The RestPublisher uses this information to mange endpoints. The series-remote does not provide its class name in its scr component file. I believe this is an oversight: the series-remote is the only remote I know that implements the service Impl and also provides a REST endpoint. Most remotes do not provide the REST endpoint. The Engage server's RestPublisher stops the WARN logs when the SeriesServiceRemoteImpl provides it's class name in the scr component file. I cannot find any negatives for adding the remote service REST class name in addition to the api that it implements.

      From the current:

        <service>
          <provide interface="org.opencastproject.series.api.SeriesService" />
        </service>
      

      To declaring both interfaces:

        <service>
          <provide interface="org.opencastproject.series.api.SeriesService" />
          <provide interface="org.opencastproject.series.remote.SeriesServiceRemoteImpl" />
        </service>
      

      I will make a pull.

        TestRail: Results

          Attachments

            Activity

              People

              • Assignee:
                karen Karen Dolan (Inactive)
                Reporter:
                karen Karen Dolan (Inactive)
              • Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  TestRail: Cases