[GLASSFISH-21554] Undepoyment fails with message "Application not registered" Created: 29/Jul/16  Updated: 29/Jul/16

Status: Open
Project: glassfish
Component/s: deployment
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: shimano-a Assignee: Hong Zhang
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Undepoyment fails with message "Application not registered" under certain conditions.

[Case 1]
After deploying an application that fails to be loaded on a server instance, undeployment fails.
How to reproduce:
1. asadmin create-local-instance i1
2. asadmin start-local-instance i1
3. asadmin deploy --target i1 hello.war
--------
Application deployed with name hello.
Warning: Command _deploy did not complete successfully on server instance i1: remote failure: Failed to load the application on instance i1. The application will not run properly. Please fix your application and redeploy.
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.RuntimeException: HelloServlet. Please see server.log for more details.
Command deploy completed with warnings.
--------
4. asadmin undeploy --target i1 hello
--------
hello disabled failed
An error occurred during replication
Failure: Command disable failed on server instance i1: remote failure: Application not registered
Command undeploy executed successfully.
--------
Step 4 fails.

[case 2]
After deploying an application to domain, undeployment fails.
How to reproduce:
1. asadmin deploy --target domain hello.war
2. asadmin restart-domain
3. asadmin undeploy --target domain hello
--------
hello disabled failed
Application not registered
Command undeploy executed successfully.
--------
Stpe 3 fails.

This problem seems to be introduced by r48518.
--------
— ApplicationLifecycle.java (revision 48517)
+++ ApplicationLifecycle.java (revision 48518)
@@ -1950,13 +1967,17 @@
public void disable(UndeployCommandParameters commandParams,
Application app, ApplicationInfo appInfo, ActionReport report,
Logger logger) throws Exception {

  • // if the application is not loaded, do not unload
  • if (domain.isCurrentInstanceMatchingTarget(commandParams.target, commandParams.name, server.getName(), null)) {
  • if (appInfo == null || !appInfo.isLoaded()) { - return; - }

    + if (appInfo == null)

    { + report.failure(logger, "Application not registered", null); + return; }

    --------

This can be fixed by the following modification.


public void disable(UndeployCommandParameters commandParams,
Application app, ApplicationInfo appInfo, ActionReport report,
Logger logger) throws Exception {
if (appInfo == null)

{ - report.failure(logger, "Application not registered", null); return; }





Generated at Fri Jul 29 16:52:27 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.