Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-5533

KarArtifactInstaller does not properly detect already installed KAR files

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.3, 4.2.0.M1
    • Fix Version/s: 4.1.4, 4.2.0.M2
    • Component/s: karaf
    • Labels:
      None
    • Environment:

      All platforms

      Description

      When Karaf is restarted the KarArtifactInstaller does not properly detect that a previously installed KAR is already installed. As a result it always proceeds to reinstall the KAR which causes to uninstall the respective repository including all its features.

      The check in KarArtifactInstaller.install(File file) (see master) that does this seems to compare the whole file name (including .kar) with the name of the repository (without .kar).

      The existing code is:

              // check if the KAR is not already installed
              if (karService.list().contains(file.getName())) {
                  LOGGER.info("KAR {} is already installed. Please uninstall it first.", file.getName());
                  return;
              }
      

      What seems to resolve this issue is to change the code to:

              // check if the KAR is not already installed
              if (karService.list().contains(getKarName(file))) {
                  LOGGER.info("KAR {} is already installed. Please uninstall it first.", file.getName());
                  return;
              }
      

      When there is agreement on this fix I can submit a PR for this.

      We ran into this issue with openHAB which uses Karaf 4.1.3. The respective code has not changed with 4.2.0.M1.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                splatch Łukasz Dywicki
                Reporter:
                wborn Wouter Born
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: