glassfish
  1. glassfish
  2. GLASSFISH-16307

NPE and issues when deploying applications with same name - different case

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 4.0_b53
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      WinXP

      Description

      I deploy my app 'web25.war' using the CUI. Later I deploy another app 'WEB25.war'. No errors in console or server log, but I noticed domains\domain1\applications only has a directory WEB25, no web25.
      I undeploy 'web25', again seemingly successful. But when I then try to disable WEB25 I get an error:

      D:\GFv3.1\glassfish-3.1\glassfish3\glassfish>bin\asadmin disable
      Enter the value for the name operand> WEB25
      remote failure:
      Command disable failed.

      In server.log an NPE:

      [#|2011-04-03T11:41:31.796+1000|SEVERE|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=56;_ThreadName=Thread-1;|Error during disabling:
      java.lang.NullPointerException
      at com.sun.enterprise.deploy.shared.FileArchive.getDirectories(FileArchive.java:175)
      at org.glassfish.deployment.common.DeploymentUtils.isEARFromIntrospecting(DeploymentUtils.java:332)
      at org.glassfish.deployment.common.DeploymentUtils.isEAR(DeploymentUtils.java:320)
      at org.glassfish.javaee.full.deployment.EarHandler.handles(EarHandler.java:146)
      [...]
      [#|2011-04-03T11:42:22.218+1000|WARNING|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.deployment.admin|_ThreadID=82;_ThreadName=Thread-1;|Cannot find application bits at D:\tests\GFv3.1\glassfish-3.1\glassfish3\glassfish\domains\domain1\applications\WEB25|#]

      If deployment of apps only differing in case is not supported it would be better not to allow it.

        Activity

        Hide
        Hong Zhang added a comment -

        A couple comments on the new diffs:

        1. For the if block, I think we should compare the path of the repository directories instead of the File object itself (e.g. you can use File.getAbsolutePath() to compare). I don't think we should use an else if block here, you should use the else block for everything else, and we will delete the left over directories. We only want to limit the change to this particular corner use case, and everything else should stay same.

        2. For the error message, please say something like Application <the name of the new app> is trying to use the same repository directory as application <the one that's already deployed>, please choose a different application name to deploy.

        Show
        Hong Zhang added a comment - A couple comments on the new diffs: 1. For the if block, I think we should compare the path of the repository directories instead of the File object itself (e.g. you can use File.getAbsolutePath() to compare). I don't think we should use an else if block here, you should use the else block for everything else, and we will delete the left over directories. We only want to limit the change to this particular corner use case, and everything else should stay same. 2. For the error message, please say something like Application <the name of the new app> is trying to use the same repository directory as application <the one that's already deployed>, please choose a different application name to deploy.
        Hide
        Hong Zhang added a comment -

        And please run these two manual tests to make sure things work fine, the one reported in this issue, and the one where we do need to do clean up and the deployment should proceed (you could manually create some left over contents in the repository and see if the deployment with the right application name will clean those up as expected in the beginning of the deployment lifecycle).

        Show
        Hong Zhang added a comment - And please run these two manual tests to make sure things work fine, the one reported in this issue, and the one where we do need to do clean up and the deployment should proceed (you could manually create some left over contents in the repository and see if the deployment with the right application name will clean those up as expected in the beginning of the deployment lifecycle).
        Hide
        Jeremy_Lv added a comment -

        Hong:
        I have fixed the source again under your suggestion.please check it.

        BTW:

        And please run these two manual tests to make sure things work fine, the one reported in this issue, and the one where we do need to do clean up and the deployment should proceed (you could manually create some left over contents in the repository and see if the deployment with the right application name will clean those up as expected in the beginning of the deployment lifecycle).

        I have run these two manual tests and it seems fine.

        Show
        Jeremy_Lv added a comment - Hong: I have fixed the source again under your suggestion.please check it. BTW: And please run these two manual tests to make sure things work fine, the one reported in this issue, and the one where we do need to do clean up and the deployment should proceed (you could manually create some left over contents in the repository and see if the deployment with the right application name will clean those up as expected in the beginning of the deployment lifecycle). I have run these two manual tests and it seems fine.
        Hide
        Hong Zhang added a comment - - edited

        The latest changes look pretty good, please go ahead and check in (after running the usual set of the tests).

        Show
        Hong Zhang added a comment - - edited The latest changes look pretty good, please go ahead and check in (after running the usual set of the tests).
        Hide
        Jeremy_Lv added a comment -

        all QL tests and dev tests passed according to the latest version of GF.
        Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\DeployCommand.java
        Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\LocalStrings.properties
        Transmitting file data ..
        Committed revision 55893.

        Show
        Jeremy_Lv added a comment - all QL tests and dev tests passed according to the latest version of GF. Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\DeployCommand.java Sending nucleus\deployment\admin\src\main\java\org\glassfish\deployment\admin\LocalStrings.properties Transmitting file data .. Committed revision 55893.

          People

          • Assignee:
            Hong Zhang
            Reporter:
            Dies Koper
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: