Index: web/web-glue/src/main/java/com/sun/enterprise/web/VirtualServer.java =================================================================== --- web/web-glue/src/main/java/com/sun/enterprise/web/VirtualServer.java (revision 3229) +++ web/web-glue/src/main/java/com/sun/enterprise/web/VirtualServer.java (working copy) @@ -2148,10 +2148,6 @@ _logger.log(Level.SEVERE, "Application "+params.name+" not found"); } - // Enable the app using the modified web.xml - // We can't use Deployment.enable since it doesn't take DeploymentContext with custom class loader - deployment.updateAppEnabledAttributeInDomainXML(params.name, params.target, true); - ReadableArchive source = appInfo.getSource(); UndeployCommandParameters undeployParams = new UndeployCommandParameters(params.name); undeployParams.origin = UndeployCommandParameters.Origin.undeploy; @@ -2172,6 +2168,10 @@ } deployment.deploy(deploymentContext); + // Enable the app using the modified web.xml + // We can't use Deployment.enable since it doesn't take DeploymentContext with custom class loader + deployment.updateAppEnabledAttributeInDomainXML(params.name, params.target, true); + if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Virtual server "+getName()+" enabled context "+params.name()); }