Deploy an App on GlassFish
This tutorial describes how to deploy an application on GlassFish. It assumes you have the GlassFish plugin installed.
Step 1 - Connect to your infrastructure
Connect Deploy to the host on which GlassFish is running. Follow the instructions for the host's operating system and the connection protocol that you want Deploy to use. For more information, see :
Step 2 - Add your middleware
When Deploy can communicate with your host, it will scan for middleware containers and automatically add them to the Repository for you.
To add a GlassFish domain:
-
Hover over the host you created, click , and select Discover > glassfish > Domain.
If you do not see the glassfish option in the menu, verify that the GlassFish plugin is installed.
- In the Name field, enter the name of the domain. This must match the domain name in your GlassFish installation.
- In the Home field, enter the path to
bin/asadmin
. For example,/opt/glassfish4
. - Optionally, in the Administrative port and Administrative Host fields, set the port and host that will be used to log in to the Domain Administration Server. The default is 4848 and
localhost
. - In the Administrative username field, enter the user name that Deploy will use to log in to the DAS.
- In the Administrative password field, enter the password for the user.
- If the connection to the DAS should use HTTPS, select Secure.
- Click Next. A plan appears with the steps that Deploy will execute to discover the middleware on the host.
- Click Execute. Deploy executes the plan. If it succeeds, the steps state will be DONE.
- Click Next. Deploy shows the items that it discovered.
You can click each item to view its properties. If an item is missing a property value that is required, a red triangle appears next to it. Provide the missing value and click Apply to save your changes.
- Click Save. Deploy saves the items in the Repository.
Step 3 - Create an environment
An environment is a grouping of infrastructure and middleware items such as hosts, servers, clusters, and so on. An environment is used as the target of a deployment, enabling you to map deployables to members of the environment.
To create an environment where you can deploy a sample application, follow the procedure described in Create an environment in Deploy.
To deploy to GlassFish, select glassfish.Domain when creating the environment.
Step 4 - Import the sample application
Deploy includes two versions of a sample application called PetClinic-ear, that is already packaged in the Deploy deployment package format (DAR).
To import the PetClinic-ear/1.0 sample application, follow the steps described in Import a package instructions.
Step 5 - Deploy the sample application
To deploy the sample application, follow the steps described in Deploy an application.
If the deployment succeeds, the state of the deployment plan is EXECUTED.
If the deployment fails, click the failed step to see information about the failure. In some cases, you can correct the error and try again.
Step 6 - Verify the deployment
To verify the deployment, log in to the GlassFish Administration Console and check the list of applications for the PetClinic application.
Learn more
After you have connected Deploy to your middleware and deployed a sample application, you can start thinking about how to package and deploy your own applications with Deploy. To learn more, see:
- Introduction to the GlassFish plugin
- Preparing your application for Deploy
- Understanding deployables and deployeds
Get help
To ask questions and connect with other users, visit our forums.