Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-202

osgi install action deletes temp file before it gets installed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3
    • Console
    • None

    Description

      sometimes it happens that when uploading a new bundle it just doesn't get installed.
      this problem occurs more often when i'm using for example curl to upload it.
      i think the problem is that the request-thread deletes the file before the install thread gets hold of it.
      when i remove the tmpFile.delete finally block, it works just fine.

      Index: console-web/src/main/java/org/apache/sling/osgi/console/web/internal/core/InstallAction.java
      ===================================================================
      — console-web/src/main/java/org/apache/sling/osgi/console/web/internal/core/InstallAction.java (revision 615347)
      +++ console-web/src/main/java/org/apache/sling/osgi/console/web/internal/core/InstallAction.java (working copy)
      @@ -99,10 +99,9 @@
      }

      // install the bundle now

      • File tmpFile = null;
        try { // copy the data to a file for better processing - tmpFile = File.createTempFile("install", ".tmp"); + File tmpFile = File.createTempFile("install", ".tmp"); bundleItem.write(tmpFile); bundleLocation = "inputstream:" + bundleItem.getName(); @@ -110,10 +109,6 @@ }

        catch (Exception e)

        { getLog().log(LogService.LOG_ERROR, "Problem accessing uploaded bundle file", e); - }

        finally {

      • if (tmpFile != null) { - tmpFile.delete(); - }

        }

      return true;

      Attachments

        Activity

          People

            fmeschbe Felix Meschberger
            tripod Tobias Bocanegra
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: