glassfish
  1. glassfish
  2. GLASSFISH-18929

Executing "get-client-stubs" commands related to the applications without client files can be successful.

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0_b45
    • Fix Version/s: 4.0_b56_ms5
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Windows Xp

      Description

      [Bug Description]
      "get-client-stubs" command is used for getting JAR file from an application client module or an application containing the application client module to the local directory. But the result shows "Command get-client-stubs executed successfully." even the appointed application has no client module and nothing was downloaded to local. The output "Command get-client-stubs executed successfully." may cause users' misunderstanding.

      [Operations]
      1.Deploy two ears:Jar.ear(has client files) and War.ear(has no client files)
      execute:
      asadmin deploy Jar.ear
      asadmin deploy War.ear

      2.create "temp" folder under c:\ ,make sure c:\temp is exsts.

      3.execute:
      asadmin get-client-stubs --appname Jar C:¥temp
      >Command get-client-stubs executed successfully. -->this is common

      >asadmin get-client-stubs --appname War C:¥temp
      Command get-client-stubs executed successfully. -->this is uncommon

      [Modify plan]
      I think if user appointed an application without client file module, executing result should be:
      "remote failure: Invalid application name:

      {appName}

      .
      Command get-client-stubs failed."

      [Affected versions ]
      1 4.0_b45
      2 gf's trunk until 2012/07/23

        Issue Links

          Activity

          Hide
          Jeremy_Lv added a comment -

          1. I would suggest slightly different wording for the message:

          there are no files to retrieve for application

          Unknown macro: {0}

          The reason is that the downloaded files can be more than just client stubs. For a client, they can include libraries, the client JAR itself, etc. I know that the command name itself refers to client stubs, but for a long time the command has downloaded more than just client stubs. Changing the command name is difficult for reasons of backward compatibility, but let's not limit ourselves to stubs in the message.

          2. I'm glad to see that the revision checks to see if there are any downloadable artifacts, rather than checking to see if the app is or contains an app client. For example, users can deploy an EJB module with stubs generation turned on and should be able to retrieve those stubs, even though the EJB module does not contain a client module.

          3. Is get-client-stubs.noStubApp already defined in the strings file or do you need to add that? It was not in the patch you attached.

          4. I agree with Hong's comment about reporting success rather than failure, even if there are no files to download.

          I have fix my source under your comments.please review them.


          5. We should do something similar with the --retrieve option on the deploy command. If the user deploys an app that creates no downloadable files but specifies --retrieve, we should include an informational message back to the user that there were no files to download for the app.c

          I add an INFO message to server.log if there are no files to retrieve when deploy an application but not set the message to the console. The reason is because there's only one message can be list on command.

          I try to set the admin console show as
          "there are no files to retrieve for this application.
          Application deployed with name appname
          Command deploy executed successfully."
          But it is difficult for me because the method about setting the message to the admin console can be useful for the last time.
          for example:The second time to set the Message can overwrite the first one.

          Because of the reason above, I decided to write the message like "there are no files to retrieve for this application." in server.log

          Thanks.

          Show
          Jeremy_Lv added a comment - 1. I would suggest slightly different wording for the message: there are no files to retrieve for application Unknown macro: {0} The reason is that the downloaded files can be more than just client stubs. For a client, they can include libraries, the client JAR itself, etc. I know that the command name itself refers to client stubs, but for a long time the command has downloaded more than just client stubs. Changing the command name is difficult for reasons of backward compatibility, but let's not limit ourselves to stubs in the message. 2. I'm glad to see that the revision checks to see if there are any downloadable artifacts, rather than checking to see if the app is or contains an app client. For example, users can deploy an EJB module with stubs generation turned on and should be able to retrieve those stubs, even though the EJB module does not contain a client module. 3. Is get-client-stubs.noStubApp already defined in the strings file or do you need to add that? It was not in the patch you attached. 4. I agree with Hong's comment about reporting success rather than failure, even if there are no files to download. I have fix my source under your comments.please review them. 5. We should do something similar with the --retrieve option on the deploy command. If the user deploys an app that creates no downloadable files but specifies --retrieve, we should include an informational message back to the user that there were no files to download for the app.c I add an INFO message to server.log if there are no files to retrieve when deploy an application but not set the message to the console. The reason is because there's only one message can be list on command. I try to set the admin console show as "there are no files to retrieve for this application. Application deployed with name appname Command deploy executed successfully." But it is difficult for me because the method about setting the message to the admin console can be useful for the last time. for example:The second time to set the Message can overwrite the first one. Because of the reason above, I decided to write the message like "there are no files to retrieve for this application." in server.log Thanks.
          Hide
          Jeremy_Lv added a comment -

          The latest changes about this issue(update by 2012/10/12)

          Show
          Jeremy_Lv added a comment - The latest changes about this issue(update by 2012/10/12)
          Hide
          Jeremy_Lv added a comment -

          All of the QL tests passed.

          Show
          Jeremy_Lv added a comment - All of the QL tests passed.
          Hide
          Jeremy_Lv added a comment -

          All of the dev tests passed.
          ready to check in:
          Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\DeployCommand.java
          Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\GetClientStubsCommand.java
          Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\LocalStrings.properties
          Transmitting file data ..
          Committed revision 56466.

          Show
          Jeremy_Lv added a comment - All of the dev tests passed. ready to check in: Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\DeployCommand.java Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\GetClientStubsCommand.java Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\LocalStrings.properties Transmitting file data .. Committed revision 56466.
          Hide
          Jeremy_Lv added a comment -

          has been implemented in the version of GF4.0_b56_ms5.

          Show
          Jeremy_Lv added a comment - has been implemented in the version of GF4.0_b56_ms5.

            People

            • Assignee:
              Jeremy_Lv
              Reporter:
              Jeremy_Lv
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: