dev@glassfish.java.net

Re: About GLASSFISH-18916

From: Hong Zhang <hong.hz.zhang_at_oracle.com>
Date: Thu, 19 Jul 2012 10:56:01 -0400

Hi Jeremy
    Thanks for looking into this issue. I think we need to do some
thinking first on this issue on what is the desirable behavior here.
    Normally when you redeploy an application, it undeploys the old
version of the application, and deploys the new version of the
application. But here the old version of the application and the new
version of the application are very different, one is a lifecycle module
and the other is a regular Java EE application, and the code paths for
deploy and undeploy lifecycle module and Java EE application are quite
different also. Two options here, one is to delete the lifecycle module
as part of the undeployment, and then deploy the new application. The
other option is to disallow this type of redeployment, and print a
meaningful error message to user.
     I prefer the second option as it is the simpler approach (without
needing to write a lot of code), and should be sufficient to handle this
not too common use case. The checks would need to be made from both
sides for handling the two cases (create a lifecycle module first, then
deploy an application with same name, or deploy an application first,
and then create a lifecycle module with same name), so you would need to
change both CreateLifecycleModuleCommand and DeployCommand. For
DeployCommand, the check could be made in the handleRedeploy method
after we get the current app. And in CreateLifecyleModuleCommand, the
check could be made inside the validateTarget method.

    Thanks,

- Hong

On 7/18/2012 10:28 PM, Lv Songping wrote:
> Dear Hong Zhang
> Cc:Glassfish deployment team
>
> I have revised the issue(GLASSFISH-18916) about the " Create a
> LifecycleModule, then deploy a application Module that has the same name
> with the LifecycleModule, NullPointerException happened " and reflected the
> modified files into https://github.com/LvSongping/GLASSFISH-18916 and
> please review it and give me some advices.
>
> The NPE is occurred because of the LifecycleModule don't have the attribute
> named "Location", when execute the " uri = new
> URI(application.getLocation())" in UndeployCommand.java, it will throw out
> the NPE.
>
> The issue url is as follows:
> http://java.net/jira/browse/GLASSFISH-18916
>
> --Best Regard!
> --Jeremy Lv
>
>