JBoss.orgCommunity Documentation

Chapter 3. JBoss Perspective

3.1. The Servers view
3.1.1. Servers view Toolbar
3.1.2. Servers view Structure
3.1.3. Drag-n-Drop to Servers view
3.1.4. Server Log View
3.1.5. Server Editor
3.1.6. Relevant Resources Links
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

This chapter describes how to manage installed JBoss Servers™ via the JBoss Perspective. The Servers view will primarily be discussed.

The view

The Servers view is built on the Common Navigator Framework allowing extensions and is using label decorators that make the UI compact enough without loosing the vital information.

Let's have a detailed look at the Servers view and its constituent components.


The Servers view displays all defined servers as well as their current status (that is whether they are started or stopped) in square brackets next to the server name.


The following table lists possible server statuses.


You can control a server behavior as well as adjust a number of server preferences through the context menu.


All available context menu commands are described in the following table.


Under the server element in the Servers view, you can see modules that are currently deployed to the server and some server extensions that provide additional information on the server.

The context menu for any module allows you to remove it from the server and force a full or incremental republish upon it.


The Filesets category in the Servers view provides a way to filter files.

To add a new file filter, right-click the Filesets category and select the Create File Filter option.

The New File Filter wizard should appear.


The wizard asks you to enter the filter name and add includes and excludes patterns. The preview box underneath provides a list of files matched to the defined patterns (see the figures bellow).

In order to set up a default fileset relative to the fixed configuration of the server runtime, use the following variable: ${jboss_config}, i. e. you should enter server/${jboss_config}/ in the Root Directory option. This allows you to modify the runtime's configuration and not have to manually update paths.


Notice, that the Browse button still returns an absolute path:


After the filter is created, you can explore it by expanding the Filesets category in the Servers view.

It is now possible to edit files directly from the Filesets category. Double clicking on a file from Filesets opens up the editor automatically, or you can use the Edit File context menu command.


To delete a file filter (or just a file) from the Filesets, right-click a file filter or file and select the Delete File Filter or Delete File command.


If you want to set filesets for some server types, select WindowPreferences and then select ServerDefault from the categories available on the left.


On this preference page you can add a fileset to any server type or to all servers at once. To do this you should select the server type in the combo box and click the Add fileset... button. In the opened New File Filter wizard follow the steps described in Section 3.1.2.1, “Filesets” and finally click the Apply button on the preference page.

The defined file filter will be automatically added to new servers during their creation.

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

The XML Configuration category itself contains only a list of categories. Ports are provided by default and display many of the most commonly used ports in the JBoss Server™.


By right-clicking on the XML Configuration node 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 Servers view. Look for them in the Inactive Categories afterwards to re-enable.


By right-clicking on the Ports category, 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, as demonstrated in 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.

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 the Preview button to see how many matches are found for that particular XPath.


By double-clicking on any server, an window will appear allowing you to edit the servers settings.


Tip:

On the figure you can see that the username and password fields are available. If you get a SecurityException when trying to launch the server, it is most likely because your server is protected, which requires that you need to fill the username and password fields with appropriate values.

The Server Behaviour settings tab allows you to set how tool interaction with the server should be undertaken.

When you created the server, if you selected that it was a local server then you will notice that the option Server is externally managed. Assume server is started is unchecked and the combo-box displays Local.


If you created a remote server then you will see that the combo-box displays Remote System Deployment. Also populated will be the Host and Remote Server Home settings.

You are also able to change a servers behaviour from Local to Remote System Deployment through this settings tab. In doing so you will see that the Host is not set by default, but the other fields contain default values.


You can select the Listen on all interfaces to allow remote web connections when using JBoss Application Server 3 to 7 or JBoss Enterprise Application Platform 4 to 6. This option will force the server to launch with the option -b 0.0.0.0. This option will change the host address to 0.0.0.0, useful for testing web applications on your local machine. JMX commands and web browser activities will still use the host set in the General Information section.

Under the Publishing section it is possible to disable or enable the automatic publishing of the changes in the workspace.

In the Server editor you are able to edit the timeouts, reload behaviour and the server pollers.

Timeouts

The Timeouts section allows you to specify a time limit for the server to complete operations within. If an operation does not start or fails to finish before the times you specify, that operation will be cancelled to avoid server failure.


Application Reload Behavior

This section of the Server settings allows you to customize the reload behavior of your application, depending on server and module changes.


Server Pollers

Server pollers are set under the Server State Detectors section. Both Startup and Shutdown pollers can be set individually.

Note

By default, the Startup poller is set to Web Port. If you change the Startup poller to Timeout Poller (which may be required if you are using the minimal configuration for your server), this will do no polling at all and will only set the server state to "Started" after your startup timeout is reached.


It should be pointed out that the server adapter tries to automatically detect the ports it needs for integrating with a JBoss Server by default. Sometimes it is necessary to override this automatic detection if you are using a custom configuration. The Server Ports section in the Server editor provides fields to customize port settings. Click the Configure... link to bring up the wizard for adjusting the settings for the ports.


Click the Edit XPath button for the chosen port to configure its XPath's values.


The Server editor window also allows you to modify the server's launch configuration. The settings is available by clicking the the Open launch configuration link. The resulting window provides tabs for setting command line arguments, main, classpaths and other things that are relevant to launching the server.


The first tab shows the JBoss server arguments

Note:

Please note that the values in the Launch Configurations for JBoss Servers are strictly enforced in order to avoid inconsistencies between server's and their configured runtime.

For example, if you change the launch configuration program arguments to "-c myConfig" but do not change the targeted runtime configuration, then your program arguments will be ignored. The configuration of the server runtime "wins" so to speak. This ensures consistency and if you change the location of the runtime, your launch configurations will automatically pick that up.

Values are not controlled by the server and its runtime setup will be passed on unaltered.

On the second tab you find the main class used for launching JBoss AS (the default is org.jboss.Main). This value can be changed if necessary.

Until JBoss Tools 3.0.0.GA the servers classpath was read only, but that caused problems for users wanting to add their own JARs in the startup classpath. That is relevant if you need to patch the server, add a custom charset or other tweaks that require early access to the classpath.

Now all servers have a custom 'server runtime classpath container', which is there by default and point to the default JARs in JBoss. You can now adjust the classpath. Then just make sure this container is there if you want the classpath to be picked up.


If for some reason you have a launch configuration without this container, the Restore Default Entries button should add it properly. Also, the Restore Default Entries button will remove any extra entries you added yourself.

Using Deployment tab you configure local deployment settings.


Using the group of radio buttons in the Default Settings section a user can set where the application will be deployed to. By default it is deployed to the user's workspace folder, [workspaceDirecotry]\.metadata\.plugins. If you would like the application to be deployed to your JBoss server deploy folder select the Use the JBoss deploy folder option. The option to specify a custom deploy folder is also available.


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.

But JBoss Tools™ comes with our own Archives tool with simpler and less-verbose XML and a handy user interface. The Project Archives plugin consists primarily of the Project Archives view to set up each packaging configuration.

Let's look through all functionality that the Project Archives view provides.

When you open the Project archives view for the first time, it asks you to select the project for which you want to create an archive.


When creating a new archive for selected project, you have some different options at your disposal. You need 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 are installed. EAR, EJB JAR and WAR options are contributed by the AS Tools independently from webtools and the virtual project model. So without them only the JAR option 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. First it prompts you to set the name of your new archive and a destination.

The destination of an archive can be anywhere on the file system, anywhere in the workspace, inside another archive, or inside a folder declared inside an archive. Select the appropriate checkbox (either workspace or file system) to specify that the destination is related to either the workspace or filesystem. 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 click the Workspace button. At the bottom of the list, you will see the archives that have been declared in the workspace.


Also in the wizard for creating a new archive you can choose whether an archive to be compressed or exploded into a folder (without compression). You need just select proper checkbox in the Archive type section.

If a build or incremental update fails Project Archives will show an error dialog:


Click the Details button to view detailed information about the cause of the error.

In the Package Explorer you can view the created archive.


If you use the exploded type of archiving, instead of a single file archive the result put into a folder is displayed in the Package Explorer.


Refer to the Ant manual to find more on how to build your applications using Ant.

We also recommend that you watch this movie which demonstrates the powerful archiving functionality in JBoss Tools™.

This chapter has covered the functionality provided by the JBoss AS perspective. The next chapter will explore working with different kinds of projects.