Create new JBoss Tools Documentation Jira issue

This will launch the Jboss Tools Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

Chapter 3. JBoss AS Perspective

3.1. The JBoss Server View
3.1.1. JBoss Server View Toolbar
3.1.2. JBoss Server View Structure
3.1.3. Drag-n-Drop to JBoss Server 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 tells how to manage installed JBoss Server 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.

The JBoss Server View is built on Common Navigator Framework allowing extensions and is using label decorators what makes the UI enough compact without loosing the vital information.

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


The JBoss Server View displays all declared servers as well as their current states (that is whether they are started or stopped) and statuses in the square brackets next to a server name.


The following table lists possible server statuses.


You can control a server behavior as well as adjust some server preferences with the help of the context menu commands.


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


Under the server element in the JBoss Server View, you can see currently deployed to the server modules and some server extensions which provide the additional information on the server.

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


The Filesets category in the JBoss Server View is intended for files filtering.

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

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 gives a list of files matched to the defined patterns (see the figures bellow).

In order to set up a default fileset relative to the concrete configuration of the server runtime, use the following variable: ${jboss_config}, i. e. you should type in the Root Directory something like server/${jboss_config}/. This is implemented in order you can 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 observe it by expanding the Filesets category in the JBoss Server View.

It's possible now 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 the unnecessary file) and select the Delete File Filter (Delete File) command.


If you want to set filesets for some server types, you should open Window>Preferences and then select Server > Default Filesets 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 Add fileset... button. In the opened New File Filter wizard follow the steps described before and finally click Apply button on the preference page.

The defined file filter will be automatically added to new servers during 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 is filled with many of the most commonly used ports in the JBoss Server.


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.


By double-clicking on any server, an editor window will appear allowing you to edit parts of that server.


Tip:

On the figure you can see that a username/password is available in the UI when configuring the server. If you get a 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.

Under the Publishing section it' possible to disable/inable the automatic publishing of the changes in the workspace.

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. Click the Configure... link to bring up the wizard for adjusting the settings for the ports.


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


In the Server editor you are able to edit the timeouts and the server pollers to use.

Note:

By default, the Startup poller is set to JMX Poller (see the Server Polling section). If you change the Startup poller to Timeout Poller (it may need in case, for example, you're 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.

Server editor makes it also possible to modify the server's launch configuration. It's just after clicking Open launch configuration link. In the open window there are the 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

Look up AS Installation Guide to find parameters which can be specified for JBoss Server.

Note:

Please note, that the Launch Configurations for JBoss Servers are enough strict in enforcing the configured values in the server 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 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 (default is org.jboss.Main), you can change it, if necessary.

Until 3.0.0.GA release of JBoss Tools, the servers classpath was readonly, 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, Restore Default Entries should add it properly. Also, Restore Default Entries will also remove any extra entries you added yourself.

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 come 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 you open the Project archives view for the first time, it asks you to select the project for what 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/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. First it asks 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 some other archive, or inside a folder declared inside an archive. Select the necessary checkbox (either workspace or file system ) for marking the destination as related to either workspace or file system. 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.


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 chechbox in the Archive type section.

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


Click in Details to see detailed information about what caused the error.

In the Package Explorer you can observe 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 Ant manual to find more on how to build your applications with help of Ant.

We also recommend you to watch the movie which demonstrates a powerful archiving functionality in JBoss Tools.

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.