Deploy two applications by using the management tools provided by JBoss EAP 7.
| Resources | |
|---|---|
| Files: |
/home/student/AD248/labs/deploying-standalone
|
| Application URL: | http://localhost:18080/example http://localhost:18080/version |
Outcomes
You should be able to deploy an application using the management console and using the management CLI.
Before beginning the guided exercise, run the following command to prepare the environment, and to copy the files for the exercise:
[student@workstation ~]$ lab start deploying-standalone
Instructions
Deploy using the management console
Open a terminal window from the workstation machine, and run the following commands to start the Red Hat JBoss Enterprise Application Platform (JBoss EAP) server using the /home/student/AD248/labs/deploying-standalone/standalone-instance as the base directory:
[student@workstation ~]$cd /opt/jboss-eap-7.4/bin[student@workstation bin]$./standalone.sh \-Djboss.server.base.dir=/home/student/AD248/labs\/deploying-standalone/standalone-instance/
The standalone.xml file from the base directory contains a port-offset set to 10000.
Thus, the management console is available at port 19990, and the deployed applications are available at port 18080.
Navigate to http://localhost:19990 to access the management console page, using admin as username and redhat123 as the password.
Click in the navigation menu bar. You do not have anything deployed yet, so the list of deployments is empty.
Click the plus sign icon, and select the option.
Click and select the kitchensink.war file, located in your /home/student/AD248/labs/deploying-standalone directory.
Click .
You can use the default values or you can change the name and runtime name of the deployment.
![]() |
Click and then to complete the wizard. You should now see kitchensink.war in the list of deployments.
Inspect the terminal window of your running JBoss EAP instance. You should see an output similar to the following:
...output omitted... 03:21:09,978 INFO [org.jboss.as.repository] (External Management Request Threads -- 1) WFLYDR0001: Content added at location /home/student/AD248/labs/deploying-standalone/standalone-instance/data/content/f9/418ea27525e0f3c02ea099405265246b22b55a/content03:21:10,034 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "kitchensink.war" (runtime-name: "kitchensink.war")...output omitted... 03:21:15,268 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 77) WFLYUT0021: Registered web context: '/kitchensink' for server 'default-server'03:21:15,365 INFO [org.jboss.as.server] (External Management Request Threads -- 1) WFLYSRV0010: Deployed "kitchensink.war" (runtime-name : "kitchensink.war")
Navigate to http://localhost:18080/kitchensink.
The kitchensink.war application is an example of a Jakarta EE 8 web-enabled database application using JSF, CDI, EJB, JPA, and Bean Validation.
![]() |
Open the /home/student/AD248/labs/deploying-standalone/standalone-instance/configuration/standalone.xml file to inspect its contents.
You should see a <deployments> section at the end of this file that contains your kitchensink.war
deployment:
<deployments>
<deployment name="kitchensink.war" runtime-name="kitchensink.war">
<content sha1="f9418ea27525e0f3c02ea099405265246b22b55a"/>
</deployment>
</deployments>Navigate to the /home/student/AD248/labs/deploying-standalone/standalone-instance/data/content
directory.
This directory contains child directories that are responsible for persisting all the applications that were deployed using the management tools provided by JBoss EAP.
You can identify each deployment using the SHA1 hash code provided in the standalone.xml file.
The first level of the directory contains a subdirectory named using the first and the second character from the hash code.
This directory contains another subdirectory named using the rest of the SHA1 code, and finally a content binary file, which is the application WAR file.
[student@workstation ~]$cd /home/student/AD248/labs/deploying-standalone\ /standalone-instance/data/content[student@workstation content]$tree. └── f9 └── 418ea27525e0f3c02ea099405265246b22b55a └── content ...output omitted...
Disable the deployment by using the management console.
You can disable a deployment to undeploy the application without removing it from the server. Go back to the page of the management console.
Click application.
In the page that shows in the right, click .
The application status changes to STOPPED.
Look in the terminal window of your running instance of JBoss EAP. You should see an output similar to the following:
06:02:06,274 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 75) WFLYUT0022: Unregistered web context: '/kitchensink' from server 'default-server'
06:02:06,405 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 75) WFLYJPA0011: Stopping Persistence Unit (phase 2 of 2) Service 'kitchensink.war#primary'
06:02:06,406 INFO [org.hibernate.tool.schema.internal.SchemaDropperImpl$DelayedDropActionImpl] (ServerService Thread Pool -- 75) HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'
06:02:06,438 INFO [org.hibernate.orm.beans] (ServerService Thread Pool -- 75) HHH10005004: Stopping BeanContainer : org.hibernate.resource.beans.container.internal.CdiBeanContainerExtendedAccessImpl@6cfb1114
06:02:06,454 INFO [org.jboss.as.jpa] (ServerService Thread Pool -- 77) WFLYJPA0011: Stopping Persistence Unit (phase 1 of 2) Service 'kitchensink.war#primary'
06:02:06,466 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0010: Unbound data source [java:jboss/datasources/KitchensinkQuickstartDS]
06:02:06,521 INFO [org.infinispan.manager.DefaultCacheManager] (ServerService Thread Pool -- 77) Stopping cache manager null on null
06:02:06,533 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment kitchensink.war (runtime-name: kitchensink.war) in 283ms
06:02:06,583 INFO [org.jboss.as.server] (External Management Request Threads -- 1) WFLYSRV0009: Undeployed "kitchensink.war" (runtime-name: "kitchensink.war")The application, and all the services that the application server provides to it, stop.
Reload the http://localhost:18080/kitchensink URL in your browser.
You get an HTTP 404 error.
Deploy the application by using the management CLI.
Open a new terminal window and start the management CLI by running the jboss-cli.sh script in the bin directory of JBoss EAP.
[student@workstation ~]$cd /opt/jboss-eap-7.4/bin[student@workstation bin]$./jboss-cli.sh --connect --controller=localhost:19990
You can deploy applications by using the deploy command, and passing the location of the file to deploy:
[standalone@localhost:19990 /]deploy \/home/student/AD248/labs/deploying-standalone/temperature-converter.war
Look in the terminal window of your running instance of JBoss EAP. You should see output similar to the following:
06:09:28,737 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "temperature-converter.war" (runtime-name: "temperature-converter.war")06:09:28,848 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) WFLYWELD0003: Processing weld deployment temperature-converter.war 06:09:28,866 INFO [org.jboss.as.ejb3.deployment] (MSC service thread 1-1) WFLYEJB0473: JNDI bindings for session bean named 'TemperatureConvertEJB' in deployment unit 'deployment "temperature-converter.war"' are as follows: java:global/temperature-converter/TemperatureConvertEJB!org.jboss.as.quickstarts.temperatureconverter.ejb.TemperatureConvertEJB java:app/temperature-converter/TemperatureConvertEJB!org.jboss.as.quickstarts.temperatureconverter.ejb.TemperatureConvertEJB java:module/TemperatureConvertEJB!org.jboss.as.quickstarts.temperatureconverter.ejb.TemperatureConvertEJB java:global/temperature-converter/TemperatureConvertEJB java:app/temperature-converter/TemperatureConvertEJB java:module/TemperatureConvertEJB 06:09:28,965 WARN [org.jboss.weld.Bootstrap] (MSC service thread 1-1) WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class com.sun.faces.flow.FlowDiscoveryCDIHelper is deprecated from CDI 1.1! 06:09:29,126 INFO [javax.enterprise.resource.webcontainer.jsf.config] (ServerService Thread Pool -- 80) Initializing Mojarra 2.3.14.SP06 for context '/temperature-converter' 06:09:29,190 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 80) WFLYUT0021: Registered web context: '/temperature-converter' for server 'default-server'06:09:29,226 INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0010: Deployed "temperature-converter.war" (runtime-name : "temperature-converter.war")
Navigate to http://localhost:18080/temperature-converter.
The temperature-converter application displays a tool to convert from Fahrenheit temperatures scale to Celsius scale.
Disable the deployment by using the management CLI.
You can disable an application by using the management CLI tool. List the available applications by using the following commands:
[standalone@localhost:19990 /]cd /deployment[standalone@localhost:19990 deployment]lskitchensink.war temperature-converter.war
Disable the deployment by using the undeploy operation:
[standalone@localhost:19990 deployment] ./temperature-converter.war:undeployLook in the terminal window of your running instance of JBoss EAP. You should see an output similar to the following:
06:12:55,149 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 80) WFLYUT0022: Unregistered web context: '/temperature-converter' from server 'default-server'
06:12:55,178 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment temperature-converter.war (runtime-name: temperature-converter.war) in 32ms
06:12:55,204 INFO [org.jboss.as.repository] (management-handler-thread - 2) WFLYDR0002: Content removed from location /home/student/AD248/labs/deploying-standalone/standalone-instance/data/content/55/5df23b973ed9f76f7c817deec3bab6a13a7ea3/content
06:12:55,204 INFO [org.jboss.as.server] (management-handler-thread - 2) WFLYSRV0009: Undeployed "temperature-converter.war" (runtime-name: "temperature-converter.war")Reload the http://localhost:18080/temperature-converter URL in your browser.
You get an HTTP 404 error.
Use the redeploy operation to enable the deployment again:
[standalone@localhost:19990 deployment] ./temperature-converter.war:redeployReload the http://localhost:18080/temperature-converter URL in your browser.
The temperature-converter application shows.
Clean up
Remove the kitchensink.war application:
[standalone@localhost:19990 /] /deployment=kitchensink.war:removeRemove the temperature-converter.war application:
[standalone@localhost:19990 /] /deployment=temperature-converter.war:removeExit the management CLI tool:
[standalone@localhost:19990 /] exitStop the instance of JBoss EAP by pressing Ctrl+C in the terminal window that is running the instance.