JBoss.orgCommunity Documentation

Chapter 2. Runtimes and Servers in the JBoss AS plugin

2.1. Runtimes
2.1.1. Installing a new runtime
2.1.2. Detecting an existing runtime
2.1.3. Exporting and Importing runtime preferences
2.1.4. Duplicating a runtime configuration
2.2. Servers
2.2.1. Creating a New Server

In this chapter we will discuss how to install runtimes and servers.

First of all it is necessary to mention that the JBoss AS plugin makes use of WTP. This includes starting and stopping servers in run or debug mode. It also includes targeting WTP projects, such as Dynamic Web Projects, to certain server runtimes in order to ensure that the proper JARs from a specific server are added to the project's classpath properly.

In order to get started creating, running and debugging J2EE applications, we should create our runtime and server instances.

In JBoss Tools, the main purpose of Server Runtimes is to point to a server installation somewhere on disk. In our case, this will be a JBoss installation. It can then be used for two primary purposes:

You can install runtimes into Eclipse by selecting WindowPreferences menu and then selecting ServerRuntime Environments from the categories available on the left.


From this preference page you can see all declared runtimes along with their types. Here, it is possible to edit or remove existing runtimes, as well as add a new one.

To create a JBoss runtime click the Add button and choose the appropriate type of runtime from the JBoss Community category.


Note:

Now there is a separation between .org servers (the JBoss Community category) and product server that comes with JBoss EAP in JBDS ( the JBoss Enterprise Middleware category).

As you can see, JBoss Tools™ provide its own adapters such as JBoss 3.2, 4.0, 4.2 and 5.0 as well. The last one comes a new safer incremental deployment feature, which prevents partial deployments to be picked up by the server. It means that scanning for auto-deployment is suspended while files are being copied to the deployment location and resumed when the copy is completed.

Note:

Currently we recommend you to use a fully supported JBoss 5.0 server adapter.

You will also note a Deploy-Only Runtime type. This type does not provide a classpath for WTP projects. It is used solely by it's server type for the purpose of setting up a deploy directory for users who do not wish to make use of starting, stopping, or debugging their projects inside Eclipse.


The following table describes all the available options of the current wizard page.


As a result of having each runtime represent a specific configuration rather than the server installation as a whole, it is very likely you will create several different runtimes to test each of your configurations. So it becomes important to ensure your runtimes and later your servers, are given descriptive names that help you to remember which is which.

Click the Finish button to see your new runtime in the list.

Note:

If you edit the configuration of a runtime, the changes don't affect the settings of the servers that currently use the runtime. To apply the changes to them also, you should double left click on the server, select OverviewRuntime Environment, make sure that necessary configuration is chosen, click the Finish button and then Save button.

WTP servers are Eclipse-representations of a back end server installation. They are used to start or stop servers, deploy to servers, or debug code that will run on the server. They keep track of the modules (JARs, WARs, etc) you deploy to the server and also allow you to undeploy those modules (see Section 5.1.1, “Deploying with Run On Server Wizard”).

Servers can be started or stopped with different command-line arguments. They are often backed by a runtime object representing that server's location.

There are many ways to get to the new server wizard. One way is to select FileNewOther...Server. This should show the wizard like below.


A server object keeps track of things like command line arguments when starting or stopping and the runtimes keep track of the location of the installation. Thus, each server instance must be backed by an appropriate runtime.

The New server wizard allows you to name the server via the Server name field, or you can use a generated default name .If it is necessary to restore the default name, click the Reset default button ().

You can select the appropriate runtime from the Server runtime environment combo box. If there is no runtime that matches your needs just press the Add... link nearby to bring up the wizard for creating a new runtime (see Figure 2.3, “Adding a JBoss 5.0 Runtime”). To configure an existing runtimes you should go to server preferences by pressing the Configure runtime environments... link.

If the server you want to create does not have any installed runtime yet, the combo box and the links are absent.


In this case the next page of the wizard which has the same form as in the previous section and will ask you to create the associated runtime.

Either way, after targeting your server to a runtime, the final screen in this wizard presents a summary of the selected options, giving you a chance to verify that you have selected the appropriate runtime.


Click the Finish button to complete the process of the server creation.

Now that we have created our runtimes and servers, we can explore the services and tools provided by the JBoss Server Manager.

We hope this guide helped you to get started with the JBoss Tools server manager. For additional information you are welcome on JBoss forum.