karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-5533) KarArtifactInstaller does not properly detect already installed KAR files
Date Wed, 13 Dec 2017 01:00:04 GMT

    [ https://issues.apache.org/jira/browse/KARAF-5533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16288551#comment-16288551
] 

ASF subversion and git services commented on KARAF-5533:
--------------------------------------------------------

Commit 33e8a2e258a567650a692833c8d5e448f13aa1f5 in karaf's branch refs/heads/karaf-4.1.x from
[~splatch]
[ https://gitbox.apache.org/repos/asf?p=karaf.git;h=33e8a2e ]

[KARAF-5533] Make sure KarArtifactInstaller does not install same KAR twice.


> KarArtifactInstaller does not properly detect already installed KAR files
> -------------------------------------------------------------------------
>
>                 Key: KARAF-5533
>                 URL: https://issues.apache.org/jira/browse/KARAF-5533
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-kar
>    Affects Versions: 4.1.3, 4.2.0.M1
>         Environment: All platforms
>            Reporter: Wouter Born
>            Assignee: Ɓukasz Dywicki
>
> 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|https://github.com/apache/karaf/blob/2da30f975f1403a324d43db219ccc2dd585a2956/deployer/kar/src/main/java/org/apache/karaf/deployer/kar/KarArtifactInstaller.java#L43])
that does this seems to compare the whole file name (including .kar) with the name of the
repository (without .kar).
> The existing code is:
> {code}
>         // 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;
>         }
> {code}
> What seems to resolve this issue is to change the code to:
> {code}
>         // 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;
>         }
> {code}
> When there is agreement on this fix I can submit a PR for this.
> We ran into this [issue with openHAB|https://github.com/openhab/openhab-distro/issues/519]
which uses Karaf 4.1.3. The respective code has not changed with 4.2.0.M1.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message