If the web module is specified as the default web module of a virtual server, and you try to redeploy or undeploy it, you will get the following error:
Trying to undeploy application from domain failed; Virtual Servers [server] have <WEB-MODULE-NAME\> as default web module. Please remove the default web module references first. ; requested operation cannot be completed Virtual Servers [server] have <WEB-MODULE-NAME\> as default web module. Please remove the default web module references first.
At this point, domain.xml is in an error state, and the Admin Console may not be able to display the table that shows the deployed web applications. The condition will persist even if the domain is stopped and started again.
Change the default web module.
Using the Admin Console, go to the virtual server page, and change the default web module to empty or specify another web module.
Using the CLI, undeploy the web module by specifying domain as the target.
# asadmin undeploy --target domain <WEB-MODULE-NAME\> |
The Admin Console should be fine now, and the web module can be deployed again, if desired.