2.2. JBoss Application Server

The JBoss Application Server Server provides the full range of Java EE 5 features as well as extended enterprise services including clustering, caching, and persistence.

2.2.1. Using the Application Server shipped with the JBoss Developer Studio

This section discusses the use of the JBoss Application Server through Eclipse. Once you have started the Eclipse interface for the JBoss Developer Studio, the JBoss Application Server can be started by selecting it in the Servers view, which can be found in the lower part of the window, and then clicking the green arrow to the right.
Starting and stopping the server
Figure 2.5. Starting and stopping the server


Note

If the Servers view is not displayed at the bottom of your Workbench, you can activate it through WindowShow ViewOtherServerServers and then clicking the OK button.
After the server has been successfully started the status field next to the server name will change from Stopped to Started, Synchronized.
Server started successfully
Figure 2.6. Server started successfully


Once Eclipse and the server are started, double click on the server name in Eclipse to see an Overview screen in the center.
JBoss Application Server overview
Figure 2.7. JBoss Application Server overview


The Overview section contains six subsections: General Information, Login Credentials, Publishing, Timeouts, Server Polling and Server Ports.
The General Information subsection allows you to change the value for the Server name and Host name. By clicking on the Runtime Environment label a dialog box will be shown with options to change the name of the server runtime, the home directory, the Java Runtime and the server configuration that will be used when running the application server. The Open launch configuration button displays a dialog box that allows you to configure the technical details of the application server instance.
Below the General Information subsection is the Login Credentials subsection. Here you can set the User Name and Password that will be used to provide secure access to your server.
The Publishing subsection at the top right of the Overview section allows you to specify when applications will be published to the location specified (whether the applications will be made available through the application server depends on the server running and if it is configured to recognize dynamic changes). You can select to either never have an application be published automatically or for a check of new applications yet to be published to occur at a certain timed interval.
The Timeouts subsection below the Publishing subsections allows you to set the start and stop times (in seconds) in which the server should complete all of its operations. This setting is made available in order to decrease the chance of the server freezing or hanging.
Below the Timeouts subsection is the Server Polling subsection. A server poller gathers information about the server at certain points in time, capturing information about processes and applications. This section allows you to select between either the JMX Poller or Timeout Poller for startup and the Process Terminated Poller or Timeout Poller for shutdown.
The final subsection is called Server Ports, below the Server Polling subsection. This section allows you to alter the port numbers that the server pollers gather their information from. The two settings JNDI Port and Web Port are set to be automatically detected by default; normally there should be no reason to manually select the port numbers.

Note

Changing the Server Ports subsection configuration will not alter which ports the server itself listens on.
The default address of the server is http://localhost:8080, which you can type into your Internet browsers address bar.
Server access
Figure 2.8. Server access


Refer to the Manage JBoss AS from JBoss Developer Studio chapter of the Getting Started with JBoss Developer Studio guide for further details.

2.2.2. Adding a new application server for use with the JBoss Developer Studio

Though the JBoss Developer Studio may come with a preconfigured application server, you can still add your own servers. This section details how to add additional servers for use with the JBoss Developer Studio.
To add a new server runtime follow these steps:
  1. In the Eclipse interface click on WindowPreferencesServerRuntime Environments.
  2. Click on the Add... button.
  3. Select the runtime environment type of your application server from the list provided.
  4. Tick the box for the Create a new local server option.
  5. Click on the Next > button.
  6. Provide a name for your server runtime and then click on the Browse... button, next to the Home Directory location space.
  7. Navigate to the directory where the server you wish to add is installed and click on the OK button.
  8. Select the Java Runtime Environment (JRE) you wish to use for this server from the drop-down menu. If the required JRE is not listed, click on the JRE button beside the list, click the Add... button in the Installed JREs Preferences dialog box, and follow the prompts to install the correct JRE.
  9. The Configuration section should automatically list the profiles available for your server. Select the server configuration you wish to use by clicking on its name in the list.
    If the profile you wish to use is not listed click on the Browse... button, navigate to the profile location and click the OK button.
  10. If all the information is correct click the Finish button.
    If you need to change any information click the < Back button until you reach the screen with the information that needs to be altered and then navigate back to the JBoss RunTime screen and click the Finish button.
Once the new sever has been added, you can select it for use by clicking on its name in the Server Runtime Environment list and then clicking the OK button, which will then take you back to the main Eclipse interface.
To start your new server, select it from those available in the Servers view and click the button displaying a white arrow in a green circle.

Note

If the Servers view is not displayed at the bottom of your Workbench, you can activate it through WindowShow ViewOtherServerJBoss Server View and then click the OK button.