The Autodeploy directory

Now that we have undeployed the simpleapp.war file, we are ready to deploy it using the command line. To deploy the application in this manner, simply copy simpleapp.war to [glassfish installation directory]/glassfish4/glassfish/domains/domain1/autodeploy. The application will automatically be deployed just by copying it to this directory.

We can verify that the application has successfully been deployed by looking at the server log. The server log can be found at [glassfish installation directory]/glassfish4/glassfish/domains/domain1/logs/server.log. The last few lines of this file should look something like this:

    [2017-11-22T19:02:41.206-0500] [glassfish 5.0] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=91 _ThreadName=AutoDeployer] [timeMillis: 1511395361206] [levelValue: 800] [[
      visiting unvisited references]]
    
    [2017-11-22T19:02:41.237-0500] [glassfish 5.0] [INFO] [AS-WEB-GLUE-00172] [javax.enterprise.web] [tid: _ThreadID=91 _ThreadName=AutoDeployer] [timeMillis: 1511395361237] [levelValue: 800] [[
      Loading application [simpleapp-1.0] at [/simpleapp-1.0]]]
    
    [2017-11-22T19:02:41.246-0500] [glassfish 5.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=91 _ThreadName=AutoDeployer] [timeMillis: 1511395361246] [levelValue: 800] [[
      simpleapp-1.0 was successfully deployed in 50 milliseconds.]]
    
    [2017-11-22T19:02:41.247-0500] [glassfish 5.0] [INFO] [NCLS-DEPLOYMENT-02035] [javax.enterprise.system.tools.deployment.autodeploy] [tid: _ThreadID=91 _ThreadName=AutoDeployer] [timeMillis: 1511395361247] [levelValue: 800] [[
    
[AutoDeploy] Successfully autodeployed : /home/heffel/glassfish-5/glassfish5/glassfish/domains/domain1/autodeploy/simpleapp-1.0.war.]]

We can, of course, also verify the deployment by navigating to the URL for the application, which will be the same one we used when deploying through the web console, http://localhost:8080/simpleapp/simpleservlet, the application should execute properly.

An application deployed this way can be undeployed by simply deleting the artifact (the WAR file, in our case) from the autodeploy directory. After deleting the file, we should see a message similar to the following in the server log:

    [2017-11-22T19:04:23.198-0500] [glassfish 5.0] [INFO] [NCLS-DEPLOYMENT-02026] [javax.enterprise.system.tools.deployment.autodeploy] [tid: _ThreadID=91 _ThreadName=AutoDeployer] [timeMillis: 1511395463198] [levelValue: 800] [[
      Autoundeploying application:  simpleapp-1.0]]
    
    [2017-11-22T19:04:23.218-0500] [glassfish 5.0] [INFO] [NCLS-DEPLOYMENT-02035] [javax.enterprise.system.tools.deployment.autodeploy] [tid: _ThreadID=91 _ThreadName=AutoDeployer] [timeMillis: 1511395463218] [levelValue: 800] [[
      [AutoDeploy] Successfully autoundeployed : /home/heffel/glassfish-5/glassfish5/glassfish/domains/domain1/autodeploy/simpleapp-1.0.war.]]
  
..................Content has been hidden....................

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