Undeploy any applications protected by the Application Server and GlassFish agent.
Restore the deployment descriptors of these applications to their original deployment descriptors. (Backup files are useful here if you have them.)
Conditionally, if you are permanently removing the Application Server and GlassFish agent, undeploy the agent application.
However, if you plan to re-install this agent , you don't need to undeploy the agent application.
Ensure that the following server instances are stopped:
Domain Administration Server (DAS)
Application Server or GlassFish instance that is being protected by the agent.