JBoss.orgCommunity Documentation

JBoss Server Manager Reference Guide

Svetlana Mukhina

Version: 3.0.0.beta1

April 2008


1. Quick Start with JBoss Server
1.1. Starting JBoss server
1.2. Stopping JBoss Server
1.3. Project Archiving
1.4. Deploying an Application to a Server
1.5. Other relevant resources on the topic
2. Runtimes and Servers in the JBoss AS plugin
2.1. Runtimes
2.1.1. Installing a new Runtime
2.2. Servers
2.2.1. Creating a New Server
3. JBoss AS Perspective
3.1. The JBoss Server View
3.1.1. Top Part of the JBoss Server View
3.1.2. Bottom Part of the JBoss Server View
3.2. Project Archives View
3.2.1. Overview
3.2.2. Creating an Archive
3.2.3. Archive Actions
3.2.4. Publishing to Server
3.2.5. Relevant Resources Links
4. Projects
4.1. Faceted Projects Overview
4.2. Adding Facets to a Project
4.3. Relevant Resources Links
5. Deploying Modules
5.1. Deploying on the Package Explorer
5.1.1. Deploying with Run On Server Wizard
5.1.2. Deploying single files
5.2. Deploying with JBoss Server View
5.2.1. Top part of JBoss Server View
5.2.2. Bottom part of JBoss Server View
5.3. Deploying with Project Archives View
6. TPTP Support
6.1. TPTP Profiling
6.2. Relevant Resources Links

This chapter covers the basics of working with the JBoss server. If you already have installed JBoss server and runtime you can quickly learn how to configure, start, stop the server, to know deployment and archiving processes. How to install runtimes and servers read in the Runtimes and Servers in the JBoss AS plugin chapter.

To start working with JBoss AS, select a JBoss AS Perspective via Window > Open Perspective > Other > JBoss AS.

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

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.

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, and it can then be used for two primary purposes:

You can install runtimes into eclipse from the Window > Preferences... menu, and then select Server > Installed Runtimes from the categories available.


From this preference page you can see all declared runtimes and their types as well. Figure above shows two declared runtimes that include a JBoss 4.2 instance. Here, it's possible to edit or remove existing runtimes as well as add a new one.

To create a JBoss runtime click Add button and choose a necessary type of runtime from the appeared dialog.


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.

Note:

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.


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


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.

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 Deploying with Run On Server Wizard section).

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

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 Installed Runtimes... to bring up the familiar preference page like in the previous section. Here, it becomes possible to edit already existing runtime or add a new one with necessary configuration.


If the server you want to create doesn't have any installed runtime yet, the combo box and button will disappear.


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.

This chapter tells how to manage installed JBoss Servers via JBoss AS Perspective.

The JBoss AS Perspective is similar to the Java Perspective, but it contains a few additional views. Two of the additional views are standard views, specifically the Console View and the Properties View. The other two views that are added are the Project Archives View and the JBoss Server View.

Let's have a look at the JBoss Server View and inspect in detail all parts it consists of.

The JBoss Server View is based on the WTP view, Server View. The top part of the JBoss Servers View essentially embeds the original Server View directly into it, making slight changes to the context menu. A second part was added to provide additional information about the server selected in the top part.


The view's toolbar provides quick access to starting a server (in debug mode, run mode, or profile mode), restarting a server, stopping a server, or publishing to a server.


In order to debug your applications or EJB's that are deployed to the server, you must start the server in debug mode. By starting the server in debug mode, eclipse will allow you to set breakpoints on code in your workspace and step through the code.

Start the server in profiling mode button allows to enable profiling actions for your application. For more details on how to start using TPTP profiling with JBoss Tools refer to TPTP Support chapter.

Publish to the server button on the extreme right will republish any modules where it has determined the workspace is out of sync with the server. It will attempt to do an incremental publish if it turns out that the module in question is capable of doing one.

Now, let's get to know with both of the JBoss Server View parts.

In the top part of the JBoss Server View all declared servers are represented as well as their current states, that is, whether they are started or stopped.


The top part also shows the server's publish status. The fallowing table lists possible statuses.


By double-clicking on any server, an editor window will appear allowing you to edit parts of that server. On the figure you can see that a username/password is available in the UI when configuring the server. If you get an SecurityException when trying to launch the server, it is most likely because your server is protected and hence you need to fill the username/password fields with appropriate values.


It should be pointed out that our server adapter by default tries to automatically detect the ports it needs for integrating with a JBoss server. Sometimes it can though be relevant to override this automatic detection if you are using some custom configuration. For this purposes the Server Ports section in the Server editor is provided where the port settings are configurable.

The settings relating to Publishing , Timeouts or Server Polling can also be adjusted here.

In the Server editor it's possible to modify the server's launch configuration as well. It's just after clicking Open launch configuration link. In the open window there are the tabs for setting command line arguments and other things that are relevant to launching the server.


Look up here to find parameters which can be specified for JBoss Server.

As the JBoss Servers have few properties to modify in this editor, a shortcut to the launch configuration has been provided in the context menu when right-clicking on a server.


The following table describes all these additional properties.


Mentioned above Twiddle is a JMX library that comes with JBoss, and you can use it to access any variables that exposed via the JBoss JMX interfaces.

Here, we dwell on the bottom part of the JBoss Server View.

First, we should say that the bottom part is meant to provide additional functionality relevant to the server selected in the top part of the view. If a standard server element is selected from above, some of the extensions may still provide the additional information. Others may not. So, let's look at the currently available extensions to the bottom part of the JBoss Server View.


In order to access the view's preferences, you should access Window > Preferences > JBoss Tools > JBoss Servers > View . This preference page allows you to select which view extensions you want on or off, the order they appear in the view, as well as any other extension-specific preferences that may be available.


The first view extension is Modules section. It shows which modules are currently deployed to the server, and allows you to remove them from the server, or force a full republish upon them. It only shows which modules have been deployed through Eclipse, not any and all modules that happen to be in the deploy directory.


The Event Log will show relevant information to your server's startup, shutdown, and publish processes. This allows you to keep an eye on what's going on (such as automatic incremental deployment if you have it enabled). The only action available is to clear the Event Log . However, if the Properties View is opened, you can receive further information on each Event Log item (when available).



The XML Configuration category allows you to quickly browse to descriptor files in your server's deploy directory and check or change the values. Its use requires the Properties view. Basically, XML Configuration includes XML XPaths where a xpath is a path used to access some specific part of an xml document.


Note:

You are assumed to be familiar with XPath. If not, we highly suggested that you look through an appropriate manual or tutorial on the topic.

The XML Configuration category itself contains only a list of categories. Ports are provided by default and is filled with many of the most commonly used ports in the JBoss Server. In the Properties view you can see an identifier and nested files underneath in which that xpath can be found as well as its current value. The details of the xpath are hidden as all you need to see is only which file you're referring to and what its current value is.

By right-clicking on XML Configuration, you can create a new category. Besides, context menu for XML Configuration category makes possible to disable it. You can disable any category in the bottom part of the JBoss Server View. Look for them in the Inactive Categories afterwards to re-enable.


By right-clicking on Ports or any other category in XML Configuration , you can create a new xpath.


After that, the dialog shown below will appear.


The goal here is to get an end result where the XPath matches up with a necessary property. With that in mind, let's look how it works. If the property you want to reach is the value of the name attribute in the element <mbean>, then your XPath Patten should end with mbean and your Attribute Name should be name like on the next figure.


...
<server>
...
    <mbean code="org.jboss.ejb.EJBDeployer" 
                   name="jboss.ejb:service=EJBDeployer" xmbean-dd="">
  
     <!-- Inline XMBean Descriptor BEGIN -->
         <xmbean>
             <description>
                    The EJBDeployer responsible for ejb jar deployment</description> 
               ...
         </xmbean>
     </mbean>
</server>

Tip:

Notice, when you type the fields autocomplete to help you locate exactly what xpath you're looking for.

Then, on the other hand, if your desired field is the text of an element <description>, your XPath Patten should end with description and Attribute Name field should be left blank. When finished, click Preview to see how many matches you have for that particular XPath.


As part of the JBoss Server View there is a JMX Console section which allows you to browse and use the JMX exposed beans on the server.


Every application, whether Plain Old Java, J2EE, or some other language altogether, needs to be packaged in some way. In Java-related projects, many people use ANT. JBoss Tools comes with our own Archives tool with a bit easier and less-verbose XML and a handy user interface. The Project Archives plugin consists primarily of a view, that is Project Archives View, to set up each packaging configuration.

So far, let's look through all functionality that the Project Archives View provides.

When creating a new archive, you have some different options at your disposal. If the project has no .packages file, your options will be presented to you all at once to choose from. Otherwise you will right-click inside the view and select New Archive to see your archive type options.


Note:

If you see only JAR from the list of available archive types, you should verify whether AS Tools plugins/features are in place. EAR, EJB JAR and WAR options are contributed by the AS Tools independently from webtools and the virtual project model. Thus, without them only JAR will show up.

JAR is the standard archive type, and does very little configuration, leaving most of the work up to you. You can customize the name, add folders, filesets, and inner jars to it.

The other types, for the most part, simply start off with a default setting, usually the jar with some specific children based on an expected structure of the project. For example, if the project is a Dynamic Web Project, and you create a WAR archive, the archive will be created with a few filesets relevant to the known structure of the project.

Here is the first page of all New archive wizards. It is the same for any archive type and the only page in the New Jar Wizard.


The page is pretty simple. All it asks for is the name of your new archive, a destination, which we'll get to in a moment, and whether the archive is exploded or packaged up.

The destination of an archive can be anywhere on the filesystem, anywhere in the workspace, inside some other archive, or inside a folder declared inside an archive. You can browse to workspace or filesystem destinations by clicking on their respective buttons. To select a destination inside some other archive, you'll need to press the Workspace... button. At the bottom of the list, you'll see archives that have been declared in the workspace.

Refer to Ant manual to find more on how to build your applications with help of Ant.

At this point, you are guessed to be familiar with JBoss AS Perspective and your next step now is to explore how to work with different kinds of projects.

The most popular of the projects we deal with are the J2EE ones, such as Dynamic Web Project, EJB Project, or EAR project. Web projects of JBoss Tools are Struts, JSF and Seam projects. All of them are called faceted projects. Thus, in this chapter we are going to tell you about facets the main benefit of which to provide proper structuring and packaging for any type of project.

In this section we're going to consider the facets added by JBoss Tools and show how you can configure them in a project: add new ones or modify already existing configuration of the facets.

One way to configure the facets is doing it while organizing a new project. To demonstrate this let's create a new Dynamic Web Project by selecting File > New > Other... and then Web > Dynamic Web Project.


Click Next and you will see Dynamic Web Project page like on the figure below.

The first page of most WTP projects allows you to target a specific runtime, representing a server's library location. It will also provide you the ability to add this project to an EAR project, and select a pre-selected default set of facets, called a configuration, rather than manually select each facet you might want.

Selecting the runtime, again, allows the project to install the proper classpaths to the project so it knows what code to compile against.


Click on the Modify button next to Configuration section in order to open the wizard which allows you to modify a chosen configuration. The wizard looks as follows.


Here part of the listed facets are those which are provided by WTP. Some of them are added by JBoss Tools. They are:

  • BIRT Charting Runtime Component

  • BIRT Reporting Runtime Component

  • JBoss ESB

  • JBoss Portlets

  • JBoss Web Services

  • Seam

On this wizard page you can enable or disable any facet as well as change it version. What you should note here is that some facets or facets versions may conflict with each other. In case of incompatibility you'll be prompted about this in the combo box underneath.


When switching on the Runtimes tab on the right you'll see the currant Server Runtime.


On this tab you can also create a new Server Runtime and make it primary by pressing Make Primary button after enabling it.

Clicking on OK will save the chosen configuration of the facets and return you to the Dynamic Web Project wizard. Further pages in the wizard are specific to either the project type or the facets selected.

If you need to configure the facets for the existing project, you should bring up the context menu for selected project and click Properties and then Project Facets. This will bring up the familiar Project Facets wizard, where you can create your own custom facets configuration.

In this chapter it will be described how to deploy modules onto the server.

First of all it is necessary to say that deploying to a server is mostly painless. There are several ways to do it provided by WTP, and some additional methods provided by JBoss Tools. These methods are described further in this chapter.

On the package explorer it is possible to publish either a project to a server or just a signal file. Let's look at how to do this.

The last chapter covers a variety of methods on how you can deploy needed modules onto a server.

This chapter provides an overview on how to enable TPTP Profiling for JBoss AS adapters in JBoss Tools.

To get TPTP profiling work on JBoss Application Server you should first download TPTP 4.5.0 Runtime and install it, i. e. just add the content of plugins/features folders from downloaded directory to the same folders in your eclipse installation directory.

And now all profile actions should work for you. To start JBoss AS in profiling mode use Start the server in profiling mode button or Profile As > Profile on Server option in the context menu of the project.


To enable TPTP features in your workbench use Profiling and Logging Perspective that you can find in the list of proposed perspectives: Window > Open Perspective > Other…


In summary, this reference should help you to start with JBoss AS and get to know with functionality for work with it.