The asadmin command-line utility

An alternate way of deploying an application through the command line is to use the following command:

asadmin deploy [path to file]/simpleapp-1.0.war
The preceding command must be run from the [glassfish installation directory]/glassfish4/bin.

We should see confirmation on the command-line terminal letting us know that the file was deployed successfully:

Application deployed with name simpleapp-1.0.
    
Command deploy executed successfully.

The server log file should show a message similar to the following:

    [2017-11-22T19:06:36.342-0500] [glassfish 5.0] [INFO] [AS-WEB-GLUE-00172] [javax.enterprise.web] [tid: _ThreadID=128 _ThreadName=admin-listener(6)] [timeMillis: 1511395596342] [levelValue: 800] [[
      Loading application [simpleapp-1.0] at [/simpleapp-1.0]]]
    
    [2017-11-22T19:06:36.349-0500] [glassfish 5.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=128 _ThreadName=admin-listener(6)] [timeMillis: 1511395596349] [levelValue: 800] [[
    
simpleapp-1.0 was successfully deployed in 51 milliseconds.]]

The asadmin executable can be used to undeploy an application as well by issuing a command like the following:

asadmin undeploy simpleapp-1.0

The following message should be shown at the bottom of the terminal window:

[2017-11-22T19:06:36.349-0500] [glassfish 5.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=128 _ThreadName=admin-listener(6)] [timeMillis: 1511395596349] [levelValue: 800] [[
simpleapp-1.0 was successfully deployed in 51 milliseconds.]]

Please note that the file extension is not used to undeploy the application, the argument to asadmin undeploy should be the application name, which defaults to the WAR file name (minus the extension).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.59.192