Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2216

Web console needs to be able to use service bundles like obr installed after it

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • webconsole-2.0.6
    • webconsole-3.0.0
    • Web Console
    • None
    • generic

    Description

      When I started web console, I didn't have any obr service bundle in my system. Since obr is an optional dependency, webconsole started and when I navigated to obr tab, it printed a nice message stating:
      "RepositoryAdmin Service not available." Then I installed and started obr bundle. Upon refreshing the obr page in web console, I got:
      java.lang.NoClassDefFoundError: org/osgi/service/obr/RepositoryAdmin
      at org.apache.felix.webconsole.internal.obr.BundleRepositoryRender.getRepositoryAdmin(BundleRepositoryRender.java:434)
      at org.apache.felix.webconsole.internal.obr.BundleRepositoryRender.renderContent(BundleRepositoryRender.java:109)
      at org.apache.felix.webconsole.AbstractWebConsolePlugin.doGet(AbstractWebConsolePlugin.java:116)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
      at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:325)

      When I refreshed web console bundle, it started working.

      Looking at the code, I fail to understand why I did not getting NCDFE when I navigated to that tab for the first time. Any explanation for this?

      I think if web console had a dynamic dependency on org.osgi.service.obr, it could have been avoided. So, add something like:
      DynamicImport-Package: org.osgi.service.obr

      To make it work, we may also have to pass true while opening the ServiceTracker in BaseWebConsolePlugin.getService and have appropriate checks to deal with possible ClassCastException.

      This may be applicable to other optional dependencies as well.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sahoo Sanjeeb Kumar Sahoo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: