Build war file and run the application

Build a Java Web Archive (war) file for deployment of the JGAS and applications. The war file embeds the Genero archive with the applications and web services.

The goal of this quick start is to create a war file and run your application in a Java Enterprise Edition container such as Apache Tomcat®, Jetty, or Glassfish.
Important:

If using Apache Tomcat, the JGAS is compatible with Apache Tomcat version 10 or greater.

Before you begin:

You must have created a gar file with the applications and web services you wish to deploy. See Build Genero archive.

Steps

  1. Start the command line interface and set the environment for your Genero BDL using envcomp.
    • On Linux®/macOS™, change to your Genero BDL installation directory and run the script, for example:
      cd /opt/fourjs/fgl
      ./envcomp 
    • On Windows®, change to your Genero BDL installation directory and run the bat file, for example:
      cd "c:\program files\fourjs\fgl"
      envcomp.bat 
  2. Run the fglgar war command to package the Genero Archive in a war archive.

    Genero Browser Client (GBC) customization project, and any additional files can also be included in the war.

    At the command line of the directory with the gar file, type the command:
    fglgar war --web-content MyJgasDir/WebContent --input-gar hello.gar --output hello.war
    Where:
    1. The --web-content option is mandatory. Here you specify the path to the Java Web Content directory of your JGAS installation.
      Tip:

      A second --web-content option may be used to specify a WebContent directory where, for example, you have some additional Java applications or files that overwrite files copied in the first option from the Java Web Content directory of your JGAS installation.

      For more information on using this option, refer to the fglgar page in the Genero Business Development Language User Guide
    2. The --input-gar (-g ) option is mandatory. Here you specify the Genero Archive you want to use to create the war file.
    3. The --output option specifies the relative or absolute path to the war file to generate.
    The hello.war file is created. The war is ready to be deployed.
  3. Run the application on your Java Enterprise Edition (J2EE) server.
    1. Deploy the war file using your J2EE server tool or deployment portal interface.
    2. Use the link or URL created to access the applications deployed in the war file.
      Tip:

      The base URL in the context of the J2EE server is http://server:port/war_file_name. If you type the base URL in a browser, you get the JGAS user interface home page where you can then access all applications and services published in your war file. For more information on the JGAS user interface, go to JGAS home page.

    3. Select the application to run.