glassfish
  1. glassfish
  2. GLASSFISH-15690

spaces in the names of jar files cause deployment problems

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1_b38
    • Fix Version/s: 4.0_b55
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      mac os x 10.6.6

      Description

      steps to reproduce

      unzip the attached file.
      start the server
      asadmin deploy Domain/Departement/Product\ Portal/dist/gfdeploy/Product_Portal

      You will see the error message "remote failure: Error occurred during deployment: com/company/domain/web/controller/WebController. Please see server.log for more details.
      Command deploy failed."

      But wait... it gets better!

      if you retry the deployment, you get a new different error message.

      remote failure: Error occurred during deployment: Application name Product_Portal is already in use. Please pick a different name.. Please see server.log for more details.
      Command deploy failed.

      BUT.. if you list applications (asadmin list-applications), there isn't a Product_Portal there.

      You have to restart the server to clear this second error.

      See the netbeans issues http://netbeans.org/bugzilla/show_bug.cgi?id=188740 and http://netbeans.org/bugzilla/show_bug.cgi?id=194711 for more details.

      I am marking this issue as critical for a couple reasons:

      1. the first error message from deployment is not very informative... there is no mention that embedded spaces are not allowed in the names of jars that are part of an ear.... and it seems like that is an arbitrary constraint anyway.

      2. the first deployment error puts the server into an inconsistent state that is impossible to resolve without restarting the server.

        Activity

        Hide
        Hong Zhang added a comment - - edited

        Thanks for looking into this. A few comments:

        1. I revisited this part of the code today, and I think the check will be best made in this method of ApplicationArchivist for unsupported module uri:

        public boolean readModulesDescriptors(Application app, ReadableArchive appArchive)
        This is where we have already parsed the application.xml and begin to read the modules of the application. We should check for module URI (to see if contains space, if yes, throw an exception which will fail the deployment) in the beginning of this for loop,
        for (ModuleDescriptor aModule : sortedModules) {
        if (aModule.getArchiveUri().indexOf(SPACE_CHAR) != -1)

        { // throw exception }

        ...

        please try it to see if it works for the test cases or not.

        2. We should fail the deployment instead of proceeding so user could correct it before runs into any other cryptic errors later on.

        3. The error message needs to be i10ned, please put the error string in the LocalStrings.properties when throwing the exception to fail the deployment. And the error message should be something like "Unsupported module URI

        {0}

        , it contains space(s)" so user knows why it failed and how they could fix it.

        Show
        Hong Zhang added a comment - - edited Thanks for looking into this. A few comments: 1. I revisited this part of the code today, and I think the check will be best made in this method of ApplicationArchivist for unsupported module uri: public boolean readModulesDescriptors(Application app, ReadableArchive appArchive) This is where we have already parsed the application.xml and begin to read the modules of the application. We should check for module URI (to see if contains space, if yes, throw an exception which will fail the deployment) in the beginning of this for loop, for (ModuleDescriptor aModule : sortedModules) { if (aModule.getArchiveUri().indexOf(SPACE_CHAR) != -1) { // throw exception } ... please try it to see if it works for the test cases or not. 2. We should fail the deployment instead of proceeding so user could correct it before runs into any other cryptic errors later on. 3. The error message needs to be i10ned, please put the error string in the LocalStrings.properties when throwing the exception to fail the deployment. And the error message should be something like "Unsupported module URI {0} , it contains space(s)" so user knows why it failed and how they could fix it.
        Hide
        Jeremy_Lv added a comment -

        Thanks for your patient suggestion. I'm agree with your modification and I will test about it before I check in.

        Show
        Jeremy_Lv added a comment - Thanks for your patient suggestion. I'm agree with your modification and I will test about it before I check in.
        Hide
        Jeremy_Lv added a comment - - edited

        Hong:
        I have reattached the modification source and test results to the JIRA.
        All of the QL tests and DEV tests can be passed.
        I will check in the code soon.
        Shall I closed this issue as fixed?

        Show
        Jeremy_Lv added a comment - - edited Hong: I have reattached the modification source and test results to the JIRA. All of the QL tests and DEV tests can be passed. I will check in the code soon. Shall I closed this issue as fixed?
        Hide
        Jeremy_Lv added a comment -

        Sending E:\GF_MAIN\SOURCE_0921\appserver\deployment\dol\src\main\java\com\sun\enterprise\deployment\archivist\ApplicationArchivist.java
        Sending E:\GF_MAIN\SOURCE_0921\appserver\deployment\dol\src\main\java\com\sun\enterprise\deployment\archivist\LocalStrings.properties
        Transmitting file data .
        Committed revision 56079.

        Show
        Jeremy_Lv added a comment - Sending E:\GF_MAIN\SOURCE_0921\appserver\deployment\dol\src\main\java\com\sun\enterprise\deployment\archivist\ApplicationArchivist.java Sending E:\GF_MAIN\SOURCE_0921\appserver\deployment\dol\src\main\java\com\sun\enterprise\deployment\archivist\LocalStrings.properties Transmitting file data . Committed revision 56079.
        Hide
        Hong Zhang added a comment -

        yes, you can close the issue as fixed, thanks.

        Show
        Hong Zhang added a comment - yes, you can close the issue as fixed, thanks.

          People

          • Assignee:
            Hong Zhang
            Reporter:
            vince kraemer
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: