JBoss.orgCommunity Documentation

Chapter 1. Quick Start with JBoss Server

1.1. Key Features of JBoss Server
1.2. Starting JBoss Server
1.3. Stopping JBoss Server
1.4. Deploying an Application to a Server
1.5. Publishing to JBoss Server

This chapter covers the basics of working with the JBoss Server.

The table below lists the main features included in JBoss Server:


If you already have imported or created a JBoss server and runtime, this chapter will show you the basics of how to start, stop, and publish to the server. Installing and customizing runtimes and servers will be covered covered in more detail in Chapter 2, Runtimes and Servers in JBoss AS-Tools.

To start working with JBoss AS, you'll want to open the standard Servers View provided by WTP™. Start by selecting the menu WindowShow ViewOtherServerServers.

Starting JBoss Server™ is fairly straightforward. You can control the server state with the help of a special toolbar in the Servers view. This toolbar provides one-click access to controlling the server's state, and allows you to start the server in either regular or debug mode. You can also stop or restart the server, as well as publish to it.


The first step to starting your server is to ensure your Servers View is opened. To open it, select WindowShow ViewOtherServerServers.

To launch the server click the start icon, consisting of a green circle with a white arrow inside, on the Servers view, or right click on the server name in the main section of the view and select Start. To start it in debug mode, you can select the Debug menu item, or click the debugging icon in the view's toolbar.


To stop the server, click the Stop icon in the Servers view, or right click the server name and select the Stop option.


When the server is stopped you will see [Stopped] next to the server's name in the Servers View. This decorator will inform you as to the server's running state, as well as it's publish state, throughout your development session. On a workspace restart, however, the initial state is not shown. At this time, the state has not yet been initialized.

Learn more about the Servers view in Section 4.1, “The Servers view”.

There are two times to deploy your application:

When you create some types of JBoss Tools™ projects, such as Seam, JSF or Struts with the New Project or Import Project wizards, they will include the Target Runtime and Target Server sections. You can deploy the application through the appropriate configuration in these sections during project creation.



Other projects, such as those from WebTools™, allow you to target your project to a runtime for classpath evaluation purposes, but do not automatically deploy your application to the matching server adapter. (Remember, not all runtimes have an associated server. Some may be used solely for classpath evaluation.) Projects that behave this way include the Dynamic Web project, EJB Project, Utility Project, Enterprise Application Project, and others. You can, however, deploy these existing applications to a server. To do so, first right-click the server you'd like to publish to in the Servers view. Then select Add and Remove Projects from the context menu.


If this application or module is not currently assigned to the selected server, it will be in the left-hand column, which lists modules available to be deployed. Clicking on your target module, and then on the Add > button will move the selected module to the right-hand module list. When you click finish, the module is now targeted to be deployed on the server. It may not publish immediately, however. The auto-publisher is disabled unless the server is already in started mode. You may need to force a publish event on the server, as described above, or simply wait until later. When you start your server, the modules will also be published.


Note

It is now possible to deploy OSGI (Open Services Gateway initiative framework) projects to the JBoss Enterprise Application Platform 6 or JBoss Application Server 7.

The publishing of all the modules added to a Server is performed automatically when starting a Server.

Automatically publishing changes made to the workspace is enabled by default, allowing the workspace to remain in sync with the publish folder. However this autopublisher is only enabled when the server is in started mode. If you need to control when to publish the changes, just disable the automatic publish in the Server Editor (see ???) and use the Publish to Server () button which will incrementally publish the workspace.

This section has provided some basic information that will allow you to use the common features provided by the JBoss server. However, JBoss server includes a great deal more functionality, which will be discussed in subsequent chapters.