Red Hat Training

A Red Hat training course is available for Red Hat JBoss Operations Network

2. Deploying Applications on JBoss Instances

A number of different types of services can be deployed on a JBoss instance by adding it as a child of that instance. JBoss ON provides additional guidance and options in the UI to simplify the process for deploying EARs, WARs, data sources, connection factories, and JMS queues.

2.1. Deploying EAR and WAR Files

  1. Search for the JBoss server instance to which to deploy the EAR or WAR.
  2. On the details page for the selected JBoss server instance, open the Inventory tab.
  3. In the Create New drop-down menu, select the item for - Web Application (WAR) or - Enterprise Application (EAR), as appropriate.
  4. In the resource form, enter the information for the application to be deployed. Aside from the obvious settings, like the resource name, the WAR or EAR resource entry requires the following information:
    • The package name that the EAR or WAR file will be deployed as. In other words, the target entry name.
    • The package architecture.

      Note

      For EAR and WAR deployment, the package architecture should always be noarch.
    • The full path to the file to be deployed, in the File field.
    • Whether the file should be unzipped when it is deployed.
    • The path to the directory to which to deploy the EAR or WAR package. The destination directory is relative to the JBoss server instance installation directory; this cannot contain an absolute path or go up a parent directory.

2.2. Deploying Data Sources

  1. Search for the JBoss server instance to which to deploy the data source.
  2. On the details page for the selected JBoss server instance, open the Inventory tab.
  3. In the Create New drop-down menu, select the item for - Data Sources.
  4. Select a template for the data source. There are three data sources templates to populate a data source with common information:
    • The default template is used with SQL databases like PostgreSQL or MySQL
    • The Oracle Local TX is used for Oracle databases with local transactions.
    • The Oracle XA template is used for Oracle databases with XA transactions.
  5. Along with the obvious settings, like the resource name, enter the information for the specific child resource to be deployed:
    • The type of data source to create, either No TX Data Sources, Local TX Data Sources or XA Data Sources
    • A unique JNDI name for the DataSource wrapper to use to bind under
    • The fully qualified name of the JDBC driver or DataSource class, such as org.postgresql.Driver
    • The JDBC driver connection URL string, such as jdbc:postgresql://127.0.0.1:5432/foo
    • The username and password to use to connect to the data source
    • The minimum and maximum connection pool sizes for this data source
    Additional settings are available under the Advanced Settings area. These are the same as the advanced settings available when the JBoss ON server is installed.

2.3. Deploying Connection Factories

  1. Search for the JBoss server instance to which to deploy the connection factory.
  2. On the details page for the selected JBoss server instance, open the Inventory tab.
  3. In the Create New drop-down menu, select the item for - Connection Factory.
  4. Along with the obvious settings, like the resource name, enter the information for the specific child resource to be deployed:
    • The type of connection factory to create, either tx-connection-factory (transaction) or no-tx-connection-factory (no transaction)
    • A unique JNDI name for the DataSource wrapper to use to bind under
    • The username and password to use to connect to the data source
    • The minimum and maximum connection pool sizes for this data source
    Additional settings are available under the Advanced Settings area. These are the same as the advanced settings available when the JBoss ON server is installed.

2.4. Configuring JMS Queues and Topics

JMS Queues and JMS Topics are child resources of a JBossMQ service or JBossMessaging service resource, which itself is a child of a JBoss server instance.
  1. Search for the JBoss messaging service to which to deploy the JMS queue or topic.
  2. On the details page for the selected JBoss messaging service, open the Inventory tab.
  3. In the Create New drop-down menu, select the item for - JMQ JMS Topic or - JMQ JMS Queue, as appropriate.
  4. Aside from the obvious settings, like the resource name, the JMS Queue or JMS Topic entry requires two additional parameters:
    • The name of the queue or topic to use as the JMX object name
    • A unique JNDI name for the DataSource wrapper to use to bind under
    Additional settings are available under the Advanced Settings area. These are the same as the advanced settings available when the JBoss ON server is installed.

2.5. Updating and Deleting Applications on JBoss Servers

EARs and WARs can both be updated on JBoss server instances simply by uploading the updated packages.
  1. Browse to the EAR or WAR resource in the JBoss ON UI.
  2. In the EAR or WAR resource details page, open the Content tab, and click the New subtab.
  3. Click the UPLOAD NEW PACKAGE button.
  4. Click the UPLOAD FILE button.
  5. In the pop-up window, click the Add button, and browse the local filesystem to the updated WAR or EAR file to be uploaded.
  6. Click the UPLOAD button to load the file and dismiss the window.
  7. In the main form, select the repository where the WAR or EAR file package should be stored. If one exists, select an existing repository or a subscribed repository for the resource. Otherwise, create a new repository.
  8. Confirm the details for the new package, then click CONTINUE.
When the package is successfully uploaded, the UI redirects to the history page on the Content tab.
Deployment History for a Resource

Figure 1. Deployment History for a Resource

Note

To undeploy an EAR or WAR, simply delete the EAR or WAR child resource.