Java EE & Jakarta EE application server cheat sheet

Last Updated:  November 29, 2021 | Published: March 23, 2019

As a Java/Jakarta EE developer, we can rely on the javax standards to work on every certified application server in the same way. When it comes to managing the application server, every vendor has a different and proprietary API for managing its resources. To use a different application server you first have to get comfortable with its CLI and config files. Wouldn't be a Java EE application server cheat sheet perfect for a quick reference?

To provide you a faster learning curve for a new application server, I've created such a cheat sheet for every major Java/Jakarta EE application server (Payara, Open Liberty, WildFly and TomEE). With this cheat sheet, you will have a reference for starting/stopping the server, finding relevant logs files, getting general server information, customizing the server configuration, adding custom libraries, and creating a JDBC data source with PostgreSQL as an example.

You can download the PDF version of this Java EE & Jakarta EE application server cheat sheet here.

Payara (most is also valid for Glassfish)

Starting and stopping the server:

  • Server logs: $PAYARA_HOME/glassfish/domains/[domain_name]/logs/server.log
  • Important ports:
    • 8080 – HTTP listener
    • 8181 – HTTPS listener
    • 4848 – HTTPS admin listener
    • 9009 – Debug port
  • Admin panel: http://localhost:4848
  • Central configuration file: domain.xml in $PAYARA_HOME/glassfish/domains/[domain_name]/config
  • Embedded database: H2 (default) and Derby
  • Auto-deploy folder: $PAYARA_HOME/glassfish/domains/[domain_name]/autodeploy
  • Available domains per default: domain1 (default) & production
  • Add custom libraries to the application server:

  • Configure a new data source:
    • Configure a JDBC connection pool (pick one):
      • via admin panel: Resources -> JDBC -> JDBC Connection Pool  -> New -> Follow the wizard
      • via asadmin:

      • with adding an entry in $PAYARA_HOME/glassfish/domains/[domain_name]/config/domain.xml:

    • Create a JDBC resource (pick one):
      • via admin panel: Resources -> JDBC -> JDBC Resouces -> New -> Follow the wizard
      • with asadmin:

      • via adding an entry in $PAYARA_HOME/glassfish/domains/[domain_name]/config/domain.xml:

  • CDI implementation provider: Weld
  • JAX-RS implementation provider: Jersey
  • JPA implementation provider: EclipseLink
  • JSF implementation provider: Mojarra

 

Open Liberty

Starting and stopping the server:

  • Server logs: $WLP_HOME/usr/servers/[sever_name]/logs/console.log and $WLP_HOME/usr/servers/[sever_name]/logs/messages.log
  • Important ports:
    • 9080– HTTP listener
    • 9443 – HTTPS listener
  • Admin panel: none
  • Central configuration file: server.xml in $WLP_HOME/usr/servers/[sever_name] (hot reloading of configuration is possible)
  • Embedded database: none, Derby can be configured like the following:
    • Download the derby.jar
    • Update the server.xml and reference to the downloaded .jar file:

  • Auto-deploy folder: $WLP_HOME/usr/servers/[sever_name]/dropins
  • Available servers per default: defaultSever
  • Add custom libraries to the application server:
    • The following <library> elements are available for the server.xml:

    • either reference the library from your filesystem or place it in ${server.config.dir}/lib (specific libs for the server e.g. $WLP_HOME/usr/servers/defaultServer/lib) or ${shared.config.dir}/lib/global for global libs
  • Configure a new data source:
    • Reference the JDBC driver within the server.xml and give it a unique name:

    • Create a new <dataSource> element within the server.xml and configure the access to the data source and JNDI name:

  • CDI implementation provider: Weld
  • JAX-RS implementation provider: ApacheCXF
  • JPA implementation provider: EclipseLink (customizable via  server.xml to use Hibernate)
  • JSF implementation provider: Apache MyFaces

 

WildFly

Starting and stopping the server:

  • Server logs: $WILDFLY_HOME/standalone/log/server.log for running in standalone mode
  • Important ports:
    • 8080 – HTTP listener
    • 8443 – HTTPS listener
    • 9990 – Admin panel
  • Admin panel: http://localhost:9990
    • To log in, you first have to create a user via:

  • Central configuration file: standalone.xml in $WILDFLY_HOME/standalone/configuration
  • Embedded database: H2
  • Auto-deploy folder: $WILDFLY_HOME/standalone/deployments
  • Available server modes per default: standalone (single instance) and domain (cluster) mode
  • Add custom libraries to the application server: Follow the steps as described for the JDBC driver and create a module
  • Configure a new data source:
    • Create a new folder org/postgresql/main within $WILDFLY_HOME/modules
    • Copy the JDBC driver (e.g. postgresql-42.2.5.jar) to this folder
    • Create a module.xml file within this folder:

    • Connect to your running WildFly with $WILDFLY_HOME/bin/jboss-cli.bat --connect or $WILDFLY_HOME/bin/jboss-cli.sh --connect
    • Execute:

  • CDI implementation provider: Weld
  • JAX-RS implementation provider: RESTEasy
  • JPA implementation provider: Hibernate
  • JSF implementation provider: Mojarra

 

TomEE

 

 

Starting and stopping the server:

  • Server logs: $CATALINA_HOME/logs/catalina.DATE.log
  • Important ports:
    • 8080 – HTTP listener
    • 8443 – HTTPS listener
  • Admin panel: http://localhost:8080/manager/html
    • To log in, you first have to create a user in $CATALINA_HOME/conf/tomcat-users.xml:

  • Central configuration file: server.xml, context.xml and tomee.xml in $CATALINA_HOME/config
  • Embedded database: HSQL
  • Auto-deploy folder: $CATALINA_HOME/webapps
  • Add custom libraries to the application server: Copy the library to $CATALINA_HOME/lib
  • Configure a new data source:
    • Copy the JDBC driver (e.g. postgresql-42.2.5.jar) to $CATALINA_HOME/lib
    • Add the following config to  $CATALINA_HOME/config/tomee.xml

  • CDI implementation provider: Apache OpenWebBeans
  • JAX-RS implementation provider: Apache CXF
  • JPA implementation provider: EclipseLink
  • JSF implementation provider: Mojarra

You can download the PDF version of this Java EE & Jakarta EE application server cheat sheet here.

>