JBoss.orgCommunity Documentation

Chapter 3. JBoss Server Tools

3.1. Overview of JBoss Server Tools
3.1.1. About JBoss Server Tools
3.2. Features of JBoss Server Tools
3.2.1. Features Overview
3.2.2. Download a JBoss Community Application Server
3.2.3. Define a Local Server with Runtime Detection
3.2.4. Create an Additional Server Runtime Environment
3.2.5. Define an Additional Local Server
3.2.6. Define a Remote Server
3.2.7. Manage Server Settings
3.2.8. Manage Server Settings in Overview Mode
3.2.9. Manage Server Settings in Deployment Mode
3.3. Customizing JBoss Server Tools
3.3.1. Customizing Overview
3.3.2. Enable Runtime Detection on IDE Start
3.3.3. Set a Default Server
3.3.4. Default Filesets
3.3.5. Default Classpath Entries

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:

You must define a server in the IDE before you can use it. A complete server definition is composed of two elements:

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. Complete server definitions are 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 tab.


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 defines a local server for each application server it discovers in given search paths on your system. But you may want to create additional server runtime environments with different configurations for an 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.

Procedure 3.3. Create a Server Runtime Environment

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


  2. Click Add.

  3. From the Select the type of runtime environment list, select a JBoss community application server.

  4. To create a complete local server definition, select the Create a new local server check box.


  5. Click Next.

  6. In the Name field, type a name by which to identify the server runtime environment within the IDE.

  7. In the Home Directory field, type the path of the installed application server or click Browse to navigate to the location.Alternatively, to use a JBoss community application server that is not already installed on the system, click Download and install runtime and follow the instructions.

  8. From the JRE list, select the JRE to use with the application server.

  9. In the Configuration file field, type the path of the application server configuration file or click Browse to navigate to the location. Note that the path of the application server configuration file is relative to Home Directory/standalone/configuration/, where Home Directory is specified in the Home Directory field.


    Note

    For older application servers, the Configuration file field is replaced with the Directory field. In this field, type the path where the application server configurations are installed and then select a listed configuration. To clone from an existing server runtime environment, after selecting a listed configuration click Copy. Complete the name for the new configuration and the location where the configuration should be stored and click OK.

  10. 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.


Runtime detection defines a local server for each application server it discovers in given search paths on your system. But you may want to create additional server adapters with different configurations 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 3.4. Define a Local Server

  1. Click the Servers tab. If the Servers tab 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. From the Select the server type list, select a JBoss community application server.

  4. The Server's host name and Server name fields are completed by default. In the Server name field, type a name by which to identify the server definition.

  5. From the Server runtime environment list, select the specific server runtime environment for the application server type to use. Alternatively, to create a new runtime environment click Add and complete the fields as appropriate.


    Note

    If the Server runtime environment field is not shown, no server runtime environments exist for the selected application server type. A server runtime environment must be selected before you can successfully create a server adapter and complete the server definition. To create a new server runtime environment without canceling the wizard, click Next and complete the fields as appropriate.

  6. Click Next.

  7. The server behavior options displayed vary depending on the selected application server type.


    Complete the options as appropriate:

    • 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 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 but bypassed for local servers.

      Note

      To make use of this facility, a management user must exist for the remote server and you must provide the management user credentials to the IDE.

  8. From the location list, select Local.

  9. Click Next.

  10. 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.


  11. Click Finish to create the server. The server is listed in the Servers tab, 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 3.5. Define a Remote Server

  1. Click the Servers tab. If the Servers tab 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. From the Select the server type list, select a JBoss community application server.

  4. The Server's host name and Server name fields are completed by default. In the Server name field, type a name by which to identify the server definition.

  5. From the Server runtime environment list, select the specific server runtime environment for the application server type to use. Alternatively, to create a new runtime environment click Add and complete the fields as appropriate.


    Note

    If the Server runtime environment field is not shown, no server runtime environments exist for the selected application server type. A server runtime environment must be selected before you can successfully create a server adapter and complete the server definition. To create a new server runtime environment without canceling the wizard, click Next and complete the fields as appropriate.

  6. Click Next.

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

  8. From the location list, select Remote System Deployment.


  9. From the Host list, select the host. Alternatively, to specify a new host, click New Host and follow the instructions.

  10. In the Remote Server Home field, type the path of the application server or click Browse to navigate to the location.

  11. In the Remote Server Configuration File field, type the path of the configuration file or click Browse to navigate to the location.

  12. Click Next.

  13. 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.


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

The Overview mode of the JBoss Server Editor enables you to vary the management and behavior settings of an individual server. Each section of the Overview mode 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

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 value.

The Deployment mode of the JBoss Server Editor enables you to vary the deployment settings of an individual server. Each section of the Deployment mode 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, you should 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 deployments.

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 lots of modules, from the Filter by list select the criteria for the filter. If you select By Module Name, 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.