GlassFish is a flexible, lightweight, and production-ready open-source application server built for the Java EE platform. We will see in the following how to deploy a specific .ear or .war file in Glassfish Payara 4 on different environments. There are two methods to do this:
1. Deployment by staging: install free software WinSCP and Putty
Open the WinSCP and connect to the server using user name and password:
After login, the server configuration will be displayed. The clusterDomain, config and nodes are the most important folders.
In the config file, please copy the .ear or .war file. In the config file there is a folder conf.d which contains some files for operations and one file -ex. 10_sampleConfig.xml file where you have to put in the tag the name of your ear ex. Test.ear and the other configuration for the database(host, password, classpath for drivers).
In Putty, login to the server and then execute the following steps:
– ./GFserver4 stop –all
The next step is to remove the clusterDomain and nodes because after restore these folders will be automatically created.
– ./GFserver4 restore
– ./Gfserver4 start –all
The application will be installed, the clusterDomain and nodes folder are created and you can start testing the application on the server.
2. Deployment using admin console
Login to the admin console on that server and the administration page will be opened.
Open the Applications menu and click on the button Deploy and start loading the application.
In the Resources Menu in JDBC, add the Connection pool and the configurations to the Database.