Jump to content

Jakarta EE Programming/WildFly

From Wikibooks, open books for an open world

WildFly (formerly JBoss) is an open source application server developed by Red Hat. Here is the first steps to use it:

  1. Download it from the website. You will need a Red Hat account.
  2. Launch the JAR file with Java. If you're not familiar with an application server, try to keep the default options as much as possible. Note the location where JBoss will be installed.

JBoss should be installed. To verify so, we will create a minimalist application to run.

  1. Create a file called index.html with the following content:
<html>
  <body>
    Hello World!
  </body>
</html>
  1. Open this file with a web browser. It should display "Hello World!".
  2. Close the browser.
  3. If you are on Windows or Mac, zip the file (i.e. create an archive).
  4. If you are on Linux or UNIX, create an archive, compressed or not, like a .tar file.
  5. Rename the archive file to helloworld.war (yes, rename also the file extension).
  6. Put the WAR file in the standalone\deployments folder of JBoss (you should have noted where JBoss is installed).
  7. Start JBoss. If you are on Windows, you should find the option to start JBoss in the Windows start menu. Otherwise, you can start JBoss by launching the script standalone.bat (on Windows) or standalone.sh (on Mac, Linux or UNIX) in the bin folder of JBoss. In the deployments folder, you should see the deployed version of your application: helloworld.war.deployed.
  8. On a browser, go on http://localhost:8080/helloworld/. You should see "Hello World!".