JBoss.orgCommunity Documentation

Chapter 2. JBoss Server Tools

2.1. Overview of JBoss Server Tools
2.1.1. About JBoss Server Tools
2.1.2. About IDE Server Definitions
2.2. Features of JBoss Server Tools
2.2.1. Features Overview
2.2.2. Download a JBoss Community Application Server
2.2.3. Create a Default Local Server Definition with Runtime Detection
2.2.4. Create an Additional Server Runtime Environment
2.2.5. Define an Additional Local Server
2.2.6. Define a Remote Server
2.2.7. Manage Server Settings
2.3. Customizing JBoss Server Tools
2.3.1. Customizing Overview
2.3.2. Enable Runtime Detection on IDE Start
2.3.3. Set a Default Server
2.3.4. Default File Sets
2.3.5. Default Classpath Entries

A server definition is a description of how the IDE is to use an application server. It informs the IDE of configuration information with which to start, communicate and manage an application server, including application deployment. As such, a server definition is an essential element for working with an application server in the IDE.

A complete server definition is composed of two items, as listed here.

You must generate at least one complete server definition for an application server before you can use it in the IDE. To assist you with this, JBoss Server Tools provides runtime detection that automatically generates a complete default server definition for any installed application servers found in a given local system search path.

Application servers must be installed on your system in order to deploy applications to local and remote instances of them. Many application servers must be downloaded from outside the IDE. But JBoss Server Tools can assist you to download JBoss community application servers from within the IDE, as detailed in the procedure below.

Once downloading is complete, the application server archive is extracted and several automated actions occur:

Before the IDE can use an application server, you must create a server definition for it. JBoss Server Tools provides runtime detection that automatically generates a complete default server definition for any installed application servers found in a given local system search path, as detailed in the procedure below. Note that complete server definitions are also automatically generated for JBoss community servers downloaded with JBoss Server Tools.

Generated server runtime environments are listed in Preferences under ServerRuntime Environments. A default server adapter is automatically created for each generated server runtime environment to complete the server definition. Server adapters are listed in the Servers view.


Note

Alternatively, you can manually define servers by using the IDE server functions to create a server runtime environment and then to create a server adapter.

Runtime detection creates a server runtime environment as part of the default server definition for each application server it discovers in given search paths on your system. But you may want to create additional server runtime environments that specify a variety of JREs or configuration files for a given installed application server. The procedure below details the process for creating new server runtime environments. For older versions of application servers, you can also create a new runtime server by cloning an existing one as explained below.

Procedure 2.3. Create a Server Runtime Environment

  1. Click WindowPreferences, expand Server and select Runtime Environments.


  2. Click Add.

  3. Complete the fields and options as detailed:

  4. Click Next.

  5. Complete the fields and options as detailed:

  6. Click Next if the button is enabled, otherwise click Finish. The Next button is only enabled if you selected the Create a new local server check box earlier. On the presented page, complete the appropriate information and click Finish.


    The new server runtime environment is listed in the Server runtime environments table of the Runtime Environments pane in the Preferences window.

Runtime detection defines a local server as part of the default server definition for each application server it discovers in given search paths on your system. But you may want to create additional server adapters that have different configurations for a given server runtime environment in order to define multiple servers. To create a new server adapter to define a local server, you must use the new server wizard as detailed in the procedure below.

Procedure 2.4. Define a Local Server

  1. Click the Servers view. If the Servers view is not visible, click WindowShow ViewServers.

  2. Depending on the number of existing servers, follow the appropriate step:

    • If there are no existing servers, click Click this link to create a new server.

    • If there are one or more existing servers, right-click an existing server and click NewServer.

  3. Complete the fields and options as detailed:

  4. Click Next.

  5. The server behavior options displayed vary depending on the selected application server type. Complete the fields and options as detailed:


  6. Click Next.

  7. To select applications to deploy with this server, from the Available list select the applications and click Add. Applications to be deployed are detailed in the Configured list.


  8. Click Finish to create the server. The server is listed in the Servers view, with the information in brackets detailing the server status.

You can define remote servers for JBoss community application servers. To complete a server definition, you must create a server adapter, or server, that informs the IDE how to communicate and manage the remote server, as detailed in the procedure below.

Procedure 2.5. Define a Remote Server

  1. Click the Servers view. If the Servers view is not visible, click WindowShow ViewServers.

  2. Depending on the number of existing servers, follow the appropriate step:

    • If there are no existing servers, click Click this link to create a new server.

    • If there are one or more existing servers, right-click an existing server and click NewServer.

  3. Complete the fields and options as detailed:

  4. Click Next.

  5. The server behavior options displayed vary depending on the selected application server type. Complete the options as detailed:

  6. Complete the additional fields and options for the remote server as detailed:

  7. Click Next.

  8. To select applications to deploy with this server, from the Available list select the applications and click Add. Applications to be deployed are detailed in the Configured list.


  9. Click Finish to create the server. The server is listed in the Servers view, with the information in brackets detailing the server status.

JBoss Server Tools provides the JBoss Server Editor for managing the settings of servers. This editor has two tabs: Overview and Deployment. As described below, each tab enables you to configure fundamental server settings.

The Overview tab details the settings for the server. Within this tab you can provide management information, specify application publishing and reload behavior, and customize port settings.


The Deployment tab lists applications deployed to the server. Within this tab you can specify the general publishing behavior for applications and provide deployment settings for individual applications.


To open the JBoss Server Editor for a specific server, in the Servers view double-click the server. All changes to the settings of a server must be saved before the results will take effect. To save changes made to server settings in the JBoss Server Editor, press Ctrl+S. You may be required to enter the server management password when making changes to certain settings.

The Overview tab of the JBoss Server Editor enables you to vary the management and behavior settings of an individual server. Each section of the Overview tab is outlined below. All changes to server settings must be saved before the results will take effect. To save, press Ctrl+S.

General information

This section details essential information comprising the server definition: the name by which the server is identified in the IDE, the hostname of the server and the server runtime environment.


To change the server runtime environment, from the Runtime Environment list select a server runtime environment. Alternatively, to create and assign a new server runtime environment click Runtime Environment and follow the instructions.

To view or edit the server launch configuration, click Open launch configuration.

Management login credentials

This section holds credentials, specifically username and password, necessary for the IDE to successfully communicate management commands with the server. The password is obscured and stored in Eclipse Secure Storage for security. Incorrect management credentials can cause the IDE to not detect when a server is started.


Server behavior

This section enables you to customize server behavior that encompasses how the IDE communicates with the server.


To specify that the server life cycle will be managed from outside the IDE, select the Server is externally managed check box.

To specify that the server should be launched to respond to requests on all hostnames, select the Listen on all interfaces to allow remote web connections check box. This option is most useful for remote servers and adds the -b 0.0.0.0 argument to the server launch command.

To enable management commands sent by the IDE to be successfully received by the server, select the Expose your management port as the server's hostname check box. This option is useful for remote servers and unnecessary for local servers.

Warning

The Expose your management port as the server's hostname feature should be used carefully for servers on production as it leaves the server open for anyone to access.

To specify the location of the server, from the list select Local or Remote System Deployment. For remote systems, there are further details that must be specified: the host, the path of the remote application server, and the remote application server configuration file.


Publishing

This section details the publishing action the IDE should take in response to modifications to local resources of deployed applications. Publishing involves replacing changed project resources in the dedicated deployment location of a server and the IDE action options are Never publish automatically, Automatically publish when resources change, and Automatically publish after a build event. Additionally, you can specify a minimum time interval that must occur between consecutive automated publish actions by the IDE to control the frequency of publishing.


Timeouts

This section specifies the maximum length of time, in seconds, the IDE should wait for server actions to complete before aborting. The server actions are specifically starting and stopping.


Deployment scanner

This section enables you to customize the behavior of deployment scanners, which detect the applications deployed to a server. You can manage deployment scanners or allow the IDE to do it for you. The management options available are Add missing deployment scanners after server startup and Remove added deployment scanners before shutdown.


Application reload behavior

This section details the application reload action the IDE should take in response to changed published resources of deployed applications. Application reload involves undeploying and redeploying an application and this action is necessary when you make changes to project resources that will not be detected by the server. By default, the application reload behavior is set to invoke application redeployment when .jar files are changed.


To customize which changes invoke application redeployment, select the Customize application reload behavior on changes to project resources check box. In the Force module restart on following regex pattern field, type a regex pattern indicating the changed resources that you want to trigger redeployment.

To disable application reload, select the Customize application reload behavior on changes to project resources check box and ensure the Force module restart on following regex pattern field is empty.

Server state detectors

This section specifies which method the IDE should use to verify the started and stopped status of the server.


There are four methods from which to choose:

  • Web Port, which pings the web port on the host to see if the server responds

  • Timeout, which waits for a specified time duration and then declares the start or stop operation a success without any actual verification

  • Process Terminated (available for Shutdown Poller of local servers only), which checks if a server process is still alive and sets the server status to stopped when it is terminated

  • JMX, which polls JMX, the JBoss Management service

Note that server state detection options are disabled if the Server is externally managed check box under Server Behavior is selected.

Server ports

This section details the ports and port offset that the IDE should use for communication with the server.


Port offset is typically offered by newer application servers and it enables multiple servers to run on the same system without port conflicts. JBoss Server Tools uses information in the server configuration file, typically XPath values, to automatically detect the correct ports and port offset for communicating with the server but you can perform further customization.

To view the configuration file information used by JBoss Server Tools for automatic port detection, click Configure corresponding to the appropriate tool. The information used is displayed in the Current Value field. To change this value, click Edit XPath. Click OK to close the window.


To manually specify the server ports or port offset, clear the Detect from Local Runtime check box corresponding to the appropriate tool and edit the port value.

The Deployment tab of the JBoss Server Editor enables you to vary the deployment settings of an individual server. Each section of the Deployment tab is outlined below. All changes to server settings must be saved before the results will take effect. To save, press Ctrl+S.

Default settings for the server

This section specifies where deployments are kept and how they are packaged.


You can customize the deployment location and packaging type:

  • To select the workspace deployment folder for the server, click Use workspace metadata.

  • To select the deployment folder of the application server, click Use the JBoss deploy folder.

  • To select a folder of your choice, click Use a custom deploy folder. With this option, complete the Deploy directories and Temporary Deploy Directory fields. The temporary folder must be on the same file system as the final deploy location otherwise publishing often fails.

  • For all modules to be archived for deployment, select the Deploy projects as compressed archives check box. This avoids exploded deployments and reduces the amount of memory deployments occupy but may result in slower deployment.

Settings per module

This section shows deployment settings for all modules in the workspace regardless of whether they are deployed on the server under consideration.


To filter the module list in the case that you have many modules, from the Filter by list select the criteria for the filter. If you select the By Module Name filter option, in the text field enter the part or whole name of the module.

To change the Deployment Location and Temporary Deploy Directory on a per module basis, in the table click the value to be changed and enter an alternative value. Ensure the values for these variables are specified use absolute paths or paths relative to the default deploy directory.