How to Deploy a WAR file on Wildfly Server
How to Deploy a WAR File on Wildfly Server
Prerequisites for Deployment
- Installed Wildfly/JBoss Server: Download and install the latest version of Wildfly/JBoss from the official website.
- Java Development Kit (JDK): Ensure the JDK is properly installed and configured.
- WAR File Ready: Have your WAR file prepared and tested locally.
Start the Wildfly Server
Follow the below steps to start the server:
- Navigate to the Wildfly installation directory.
- Open the command prompt or terminal.
- Run the following command to start the server:
./standalone.sh # For Linux/MacOS
standalone.bat # For Windows
Ensure the server starts without errors by checking the logs.
Access the Management Console
Open your web browser and navigate to the Wildfly Admin Console:
http://localhost:9990
Log in using your administrator credentials.
Deploy the WAR File
Through the Admin Console
- Navigate to the Deployments section.
- Click on the Add Deployment button.
- Choose the Upload Deployment option.
- Browse your local system and select the WAR file.
- Click Next and confirm the deployment.
- Verify that the deployment status shows as \”Enabled.\”
Another Method
Manually Copy the WAR File
-
- Locate the deployment folder in the Wildfly installation directory:
<em><WILDFLY_HOME>/standalone/deployments</em>
- Copy your WAR file to this folder.
- Wildfly automatically detects the WAR file and starts the deployment process.
- Check the server log to confirm successful deployment.
Verify the Deployment
Open your web browser.
Access the deployed application using the following URL:
<em>http://localhost:8080/<application-context></em>
Replace <application-context>
with your application’s context root defined in web.xml
.
Troubleshooting Deployment Issues
- Check Logs: If deployment fails, review the server logs for error messages.
- Verify Configuration: Ensure all configuration files, such as
web.xml
, are correctly set up. - Port Conflicts: Make sure no other services are using the default Wildfly ports.