In this chapter we will discuss how to install runtimes and servers.
<diffmk:wrapper>First of all it's 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.</diffmk:wrapper>
In order to get started creating, running, and debugging J2EE applications, we should create our runtime and server instances.
<diffmk:wrapper>In </diffmk:wrapper><diffmk:wrapper>JBoss Tools</diffmk:wrapper><diffmk:wrapper>, 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, and it can then be used for two primary purposes:</diffmk:wrapper>
it provides classpath additions to WTP projects that require them.
for JBoss server at least, it provides information necessary for the starting and stopping of the server, it tells which jars to run and which configuration to use.
You can install runtimes into eclipse from the <diffmk:wrapper>Window > Preferences </diffmk:wrapper> menu, and then select <diffmk:wrapper>Server > Runtime Environments</diffmk:wrapper> <diffmk:wrapper> from the categories available on the left.</diffmk:wrapper>
<diffmk:wrapper>From this preference page you can see all declared runtimes and their types as well. Here, it's possible to edit or remove existing runtimes as well as add a new one.</diffmk:wrapper>
To create a JBoss runtime click Add <diffmk:wrapper> button and choose a necessary type of runtime from the </diffmk:wrapper> <diffmk:wrapper>JBoss Community</diffmk:wrapper> <diffmk:wrapper> category.</diffmk:wrapper>
<diffmk:wrapper>Now there is a separation between .org servers (the </diffmk:wrapper> <diffmk:wrapper>JBoss Community</diffmk:wrapper> <diffmk:wrapper> category) and product server that comes with JBoss EAP in JBDS ( the </diffmk:wrapper> <diffmk:wrapper>JBoss Enterprise Middleware</diffmk:wrapper> <diffmk:wrapper> category).</diffmk:wrapper>
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 with its own new feature, that is a safer incremental deployment, 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.
Currently we recommend you to use a fully supported JBoss 4.2 server adapter.
You'll also note a Deploy-Only Runtime type. This type provides no classpath for WTP projects. It is used solely by its server type for the purpose of setting up a deploy directory for users who don't wish to make use of starting, stopping, or debugging their projects inside eclipse.
<diffmk:wrapper>The following table describes all the available options of the currant wizard page.</diffmk:wrapper>
Table 2.1. Server Runtime Wizard Parameters
Name |
Description |
---|---|
Name |
The name of a new Runtime for a chosen server. We suggest that you don't leave a default value. It's better to give descriptive names that will help to distinguish one runtime from another. |
Home directory |
The path to a directory where the runtime is installed. |
jRE |
The proper Java Runtime Environment. Because of the open-source nature of JBoss, a user is likely to want to modify and repackage some of the configuration-specific jboss jars and create their own configuration. Thus, rather than forcing you to copy his entire JBoss installation, the structure of the wizard allows to create only a new configuration instead. |
Configuration |
The list of configurations (all, default, minimal) that is updated as soon as you browse to a valid runtime installation folder. After the runtime is created the configuration becomes an unchanging property of that runtime. To compile against a different configuration's jars, you will need to create a new runtime from that configuration. |
<diffmk:wrapper>As a result of having each runtime represent a specific configuration rather than the server installation as a whole, it is very likely you'll create several different runtimes to test each of your configurations. It becomes important to ensure your runtimes, and later your servers, are given descriptive names that help you remember which is which.</diffmk:wrapper>
Press Finish to see your new runtime in the list.
WTP servers are eclipse-representations of a backing 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 <diffmk:wrapper>Deploying with Run On Server Wizard</diffmk:wrapper> section).
Servers can be started or stopped with different command-line arguments<diffmk:wrapper>. They are often backed by a runtime object representing that server's location.</diffmk:wrapper>
There are many ways to get to the new server wizard. One way is to use the old standard File > New > Other... and then Server . This should show the wizard like below.
A server object is that keeps track of things like command line arguments when starting or stopping, and runtimes keep track of the location of the installation. Thus, each server instance must be backed by an appropriate runtime.
<diffmk:wrapper>From the list of already declared runtimes in the combo box below the view it's possible to select which runtime you want your server to be backed by. If there is no runtime that matches your needs just press the </diffmk:wrapper> <diffmk:wrapper>Add...</diffmk:wrapper> <diffmk:wrapper> link nearby to bring up the wizard for creating a new runtime (see the </diffmk:wrapper><diffmk:wrapper>previous section</diffmk:wrapper><diffmk:wrapper>). To configure the already installed runtimes you should go to server preferences that you can easily do by pressing the </diffmk:wrapper> <diffmk:wrapper>Configure runtime environments...</diffmk:wrapper><diffmk:wrapper> link.</diffmk:wrapper>
<diffmk:wrapper>If the server you want to create doesn't have any installed runtime yet, the combo box and the links are absent.</diffmk:wrapper>
In this case the next page in the wizard which has the same form as in the previous section will ask you to create the associated runtime.
Either way, after targeting your server to a runtime, the final screen in this wizard is largely confirmational, giving you a chance to verify that you've selected the appropriate runtime. It also allows to name the server appropriately.
Press Finish to complete the process of the server creation.
Now that we've created our runtimes and servers, we can dwell on all services and tools that JBoss Server Manager provides.