Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Deploying Your Applications
3.1. Deploying Applications to a Local Server Copiar o linkLink copiado para a área de transferência!
In order to deploy applications to a server from within the IDE, you must configure the IDE with information about the server. For a local server this information includes the following:
- a server runtime environment with details about the server location, runtime JRE, and configuration files
- a server adapter with management settings for the server runtime environment, including access parameters, launch arguments, and publishing options
JBoss Server Tools enables you to efficiently configure a local server ready for use with the IDE using Runtime Detection. As demonstrated here, this feature is useful for quickly configuring a server for deploying and testing an application.
Instructions are provided here for completing the following tasks:
3.1.1. Configure the IDE for a Local Runtime Server Copiar o linkLink copiado para a área de transferência!
Runtime Detection searches a given local system path to locate certain types of runtime servers. For any servers found, Runtime Detection automatically generates both a default server runtime environment and a default server adapter. These items can be used as they are for immediate application deployment or customized to meet your requirements.
To configure the IDE for a local runtime server, complete the following steps:
-
Click
. -
Click
Add. -
Locate the directory containing the runtime server and click
OK. -
In the table of located runtimes, ensure the runtime is selected and click
OK. -
Click
Applyand clickOKto close thePreferenceswindow.
A default runtime environment and server adapter are generated for the server, with the server adapter listed in the Servers view.
3.1.2. Deploy an Application Copiar o linkLink copiado para a área de transferência!
When you have configured the IDE for the server, you can deploy applications to the server from the IDE using the server adapter. The server adapter enables runtime communication between the server and IDE for easy deployment of applications and server management.
To deploy an application to the server, complete the following steps:
-
In the
Project Explorerview, right-click{project name}and click. -
Ensure
Choose an existing serveris selected. -
From the table of servers, expand
localhost, select the server on which to deploy the application and clickFinish.
The Console view shows output from the server starting and deploying the application. When deployment is complete, an IDE default web browser opens and shows the deployed web application.
3.1.3. Change and Republish the Application Copiar o linkLink copiado para a área de transferência!
By default, the server adapter configures the server for automatic publishing when changed resources are saved. This automatic publishing action applies to application resources that can be interchanged in the dedicated deployment location of the server without requiring the application to stop and restart, such as .html files. For other changed resources, such as .java files, you need to republish the application such that it forces a rebuild of the application.
To republish the application to the server after changes that cannot be automatically published, complete the following steps:
-
In the
Serversview, expand the server adapter to list the applications allocated to the server. -
Right-click
{application name}and clickFull Publish.
The Console view shows output from the server replacing the deploying application. Unless LiveReload is enabled in the web browser, you must manually reload the web browser to see the changed application.
3.1.4. Did You Know? Copiar o linkLink copiado para a área de transferência!
-
You can also configure servers by right-clicking the
Serversview and selectingor by clicking Manually define a new serverin theRun on Serverwizard. -
Paths previously searched by Runtime Detection can be automatically searched on every workspace start. Click
and from the Pathstable select the check boxes of the appropriate paths. ClickApplyand clickOKto close thePreferenceswindow. -
You can customize the server adapter and server runtime environment with the
Server Editor. In theServersview, double-click the server adapter to open theServer Editor. -
You can initiate download and installation of runtime servers from the IDE. Click
. Click Downloadand from the table of runtime servers select the one to install and clickNext. Follow the on-screen instructions to complete the download and installation process.
3.2. Configuring a Remote Server Copiar o linkLink copiado para a área de transferência!
Remote servers allow developers to access and deploy to a JBoss instance that is not a local machine. Developers can use remote servers to set up multiple environments for development and testing purposes and share them with other developers. Another reason to use a remote server with Red Hat JBoss Developer Studio is to allow developers to share and deploy automated tests to run in a non-local environment.
The following instructions are used to set up a remote server for JBoss Enterprise Middleware application servers. A complete server definition requires a server adapter (or server) that allows the IDE to communicate with and manage the remote server.
-
Click the
Serversview. If theServersview is not visible, click. Use the appropriate instructions depending on the number of existing servers listed in the
Serverstab:-
If there are no existing servers, click
No servers are available. Click this link to create a new server…. -
If there are one or more existing servers, right-click an existing server and click
.
-
If there are no existing servers, click
In the
New Serverwizard, add the relevant information for the following fields:-
From the
Select the server typelist, select a JBoss Enterprise Middleware application server. -
The
Server’s host nameandServer namefields are completed by default. In theServer namefield, you can type a custom name by which to identify the server in theServersview. Click
Next >to continue.Figure 3.1. Define a New Remote Server
-
From the
Configure the required
Server Adapterdetails:-
For the
The server isfield, click theRemoteradio button option. For the
Controlled byfield, select either theFilesystem and shell operationsorManagement Operationsradio button option depending on your requirements.NoteIf you select
Management Operationsfor theControlled byfield, you must set up an admin user on the server by using the$SERVER_HOME/bin/add-users.shscript (for Linux, or the$SERVER_HOME\bin\add-users.batfile for Windows) and enter the same credentials in the server editor or during the server start.-
The
Server is externally managed. Assume server is startedfield is used when the user wants to deploy the server but does not want the IDE to stop or start the server for them. Depending on the requirements, select this check box or leave it unchecked, as is default. A remote server can now be created without assigning a runtime to it. Depending on the requirements, select the Assign a runtime to this server check box (and select an existing runtime or create a new one) or leave the box unselected.
NoteCreating a Remote Server without a runtime results in limitations. For example, the JMX connection does not work because it requires libraries from the runtime to connect via JMX. Additionally, automatic port detection occurs using the
standalone.xmlfile, which is not available if a runtime is not specified. These and other minor issues related to hard-coded minor fixes in maintenance releases may occur if no runtime is specified for the Remote Server.Figure 3.2. Create a New Server Adapter
-
For the
Add the remote system integration details as follows:
In the drop-down menu, select the appropriate host type in the
Hostfield.-
The default host is
Local. If required, use the
New Hostbutton to create a new host, which may be remote or local. Supported connection types for remote hosts areFTP OnlyorSSH Only.Figure 3.3. New Host Options
-
The default host is
Add the
Remote Runtime Detailsas follows:- Specify a path to the directory that contains the remote server in the Remote Server Home field.
-
Specify the remote server’s base directory (the default value for this is the standalone directory within server home directory) in the
Remote Server Base Directory field. This location is within theRemote Server Homedirectory (specifically in the$SERVER_HOME/BASE_DIRECTORY/configuration/directory). -
Specify the file to use for the remote server’s configuration (the default value for this is the standalone.xml file) in the
Remote Server Configuration Filefield. This location is within theRemote Server Homedirectory (specifically in the$SERVER_HOME/BASE_DIRECTORY/configuration/directory). Either click
Next >to continue to the (optional) next step to add or remove server resources or clickFinishto conclude the new remote server configuration.Figure 3.4. Connect to a Remote System
Optional: Add or remove resources configured on the server as follows:
-
To add a resource, select the appropriate resource in the
Availablepane and clickAdd >. To add all available resources, clickAdd All >>. -
To remove a resource, select the appropriate resource in the
Configuredpane and click< Remove. To remove all configured resources, click<< Remove All. Click
Finishto complete the server configuration.Figure 3.5. Add and Remove Server Resources
Result: You have successfully configured a remote server. The new server is listed in the
Serverstab. Right click the server to view operations, includingStartto start the server.
-
To add a resource, select the appropriate resource in the
If the Server is externally managed. Assume server is started check box was selected in step 4, clicking Start does not start the server. Instead, it marks the server to indicate that it has started and the web poller checks whether the server is running.