glassfish
  1. glassfish
  2. GLASSFISH-19838

asadmin redeploy --upload command does not work

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b79
    • Fix Version/s: 4.0_b84_RC1
    • Component/s: admin
    • Labels:
      None

      Description

      asadmin redeploy --upload FAILS
      while:
      asadmin redeploy OK
      asadmin deploy --upload OK

      Together with it I see also related minnot issue that command fails by NullPointerExceptin created in catch block. It is because there is unchecked manipulation with field assigned from the middle of related try block. So, when try block fails before this assignment then original exception is hidden by non-relevant NPE. See DeployCommand around line 305.

      What I know

      After very short investigation I found out that core of issue is that file to deploy (refered by DeployCommand.path) exists (in standard upload directory) but it is empty.
      I also have theory why it is. Originally is path param injected into ReDeployCommand . Then ReDeployCommand calls DeployCommand using standard invocation in CommandRunnerImpl. Path is loaded from Payload.inbound. But Payload.inboud use stream as data source for its parts. So, for second call when injecting into DeployCommand.path it has no more data in stream because all of original stream was loaded when injecting into ReDeployCommand.

      Contract of Payload that can contains stream is there from history but in current version we really use it in command call case. Before it was created from Zip file entry. So, it was possible to reenter it.
      We need first to choose what to do with Payload contract. If payload part is created from stream we can

      • copy stream to file just after construction
      • copy stream to file while loading
      • update entry when we move data to file from Payload somewhere in CommandRunnerImpl or related class. = This solution is my favorite because max one file for one Payload.part will be created.

        Activity

        Hide
        martin.mares added a comment -

        I assigned this issue to Tom because I need opponent for choosing fix method.

        Show
        martin.mares added a comment - I assigned this issue to Tom because I need opponent for choosing fix method.
        Hide
        Tom Mueller added a comment -

        Agree with your analysis and the recommended solution (#3).

        Show
        Tom Mueller added a comment - Agree with your analysis and the recommended solution (#3).
        Hide
        martin.mares added a comment -

        Fixed

        Show
        martin.mares added a comment - Fixed

          People

          • Assignee:
            martin.mares
            Reporter:
            martin.mares
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: