bea.com | products | dev2dev | support | askBEA
 Download Docs   Site Map   Glossary 
Search

Deploying WebLogic Server Applications

 Previous Next Contents View as PDF  

Performing Common Deployment Tasks

This section describes how to perform common deployment tasks using the Administration Console and weblogic.Deployer utility. It includes the following sections:

 


Uploading Deployment Files to the Administration Server

In order to deploy a module to servers in a domain, the deployment file(s) must be assessable to the domain's Administration Server. If the files do not reside on the Administration Server machine or are available to the Administration Server machine via a network mounted directory, use the instructions below to upload files.

Note: The upload functionality helps you upload a single archive file to the Administration Server machine for deployment. If you are deploying an exploded archive directory, use a network file copy utility to copy the exploded directory to the Administration Server Machine.

When you upload files to the Administration Server machine, the archive file is automatically placed in the server's upload directory. You can configure the path of this directory using the instructions in Changing a Server Staging Mode or Staging Directory.

Administration Console Tasks

To upload an archive file to the Administration Server machine using the Administration Console:

  1. Start the Administration Console for your domain.
  2. Expand the Deployments node in the left pane to display the different deployment types.
  3. In the left pane, select the type of application or module that you want to deploy. The available deployment types are:
  4. In the right pane, select the Deploy a new module link, where module is the type of application or module you want to deploy. This initiates the Deployment Assistant for the module.
  5. The right pane provides a link to upload the deployment files if necessary. Click the link to display the upload page.
  6. Use the Browse button to locate the archive file you want to upload. Select the file and click Open.
  7. Click the Upload tab to upload the selected file to the Administration Server's upload directory.

Weblogic.Deployer Tasks

When using weblogic.Deployer to deploy a new module, add the -upload option to upload the archive file before deployment. For example:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mymodule -targets myserver -upload -deploy c:\localfiles\myapp.ear

 


Deploying a New Application Module to Server(s) on One Machine

When you deploy a new module to one or more servers that reside on the same machine, you can use the nostage deployment mode. With nostage mode, the administration server and all target servers deploy using the same deployment files (deployment files are not copied to servers' stage directories).

Administration Console Tasks

The Administration Console automatically defaults to nostage mode when you deploy a module to the Administration Server, or to a standalone server. If you target more than one server and the servers reside on the same machine, you must manually specify nostage mode.

To deploy a module to servers on one machine:

  1. Start the Administration Console for your domain.
  2. Expand the Deployments node in the left pane to display the different deployment types.
  3. In the left pane, select the type of application or module that you want to deploy. The available deployment types are:
  4. In the right pane, select the Deploy a new module link, where module is the type of application or module you want to deploy. This initiates the Deployment Assistant for the module.
  5. In the first step of the Deployment Assistant, select the archive file or exploded archive directory that you want to deploy. Use the online help for the Deployment Assistant if you need further instructions.
  6. In the second step of the Deployment Assistant, select the servers and cluster to which you want to deploy the application.
  7. In the third step of the Deployment Assistant, review your choices. In the Source Accessibility header, make sure that the following option is selected:

    This option corresponds to nostage mode, where all targets deploy the module from the specified location.

  8. Click Deploy to deploy the module.

Weblogic.Deployer Tasks

When using the weblogic.Deployertool utility, specify the nostage mode explicitly when you deploy to servers on the same machine. For example:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mymodule -targets myserver1,myserver2,myserver3 -nostage -deploy c:\localfiles\myapp.ear

 


Deploying a New Application Module to Servers on Multiple Machines

When deploying a module to servers on different machine, you generally use the stage deployment mode, which copies deployment files from the Administration Server to each target server before deploying. In rare circumstances you may also use external_stage mode, in which you must ensure that deployment files are copied to each servers staging directory before deployment. See Deployment Staging Modes for more information.

Administration Console Tasks

The Administration Console allows you to select between nostage and stage mode when deploying a new module. If you need to deploy in external_stage mode, use the weblogic.Deployer instructions in the next section.

To deploy a module to multiple servers on different machines:

  1. Start the Administration Console for your domain.
  2. Expand the Deployments node in the left pane to display the different deployment types.
  3. In the left pane, select the type of application or module that you want to deploy. The available deployment types are:
  4. In the right pane, select the Deploy a new module link, where module is the type of application or module you want to deploy. This initiates the Deployment Assistant for the module.
  5. In the first step of the Deployment Assistant, select the archive file or exploded archive directory that you want to deploy. Use the online help for the Deployment Assistant if you need further instructions.
  6. In the second step of the Deployment Assistant, select the servers and cluster to which you want to deploy the application.
  7. In the third step of the Deployment Assistant, review your choices. In the Source Accessibility header, make sure that the following option is selected:

    This option corresponds to stage mode, where the administration server copies the deployment files to each target server before the servers deploy the module.

  8. Click Deploy to deploy the module.

Weblogic.Deployer Tasks

When deploying modules to multiple machines using the weblogic.Deployer utility, specify the stage or external_stage mode explicitly at the command line. For example:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mymodule -targets myserver1,myserver2,myserver3 -stage -deploy c:\localfiles\myapp.ear

 


Deploying Enterprise Application Modules to Different WebLogic Server instances

An Enterprise Application module (.EAR file) differs from other deployable modules in the .EAR file can contain other module types (.WAR and .JAR archives). When you deploy an Enterprise Application using the Administration Console, you have the opportunity to target all of the archive's modules together, or distribute the application by targeting different modules to different servers in the domain.

Note: If you want to distribute an .EAR archive's modules over multiple WebLogic Server instances, use the Administration Console for deployment. The weblogic.Deployer utility deploys all .EAR modules to the same target servers.

Administration Console Tasks

  1. Start the Administration Console for your domain.
  2. Expand the Deployments node in the left pane to display the different deployment types.
  3. In the left pane, select the Applications node to display the currently-deployed Enterprise Application in your domain.
  4. In the right pane, select the Deploy a new Application link. This initiates the Enterprise Application Deployment Assistant.
  5. In the first step of the Deployment Assistant, select the .EAR file or exploded Enterprise Application directory that you want to deploy. Use the online help for the Deployment Assistant if you need further instructions on this step.

    After you have selected the module, click the Target Each Module button to begin targeting the individual .JAR and .WAR modules included in the Enterprise Application.

  6. In the second step of the Deployment Assistant, select the servers and clusters to which you want to deploy the current module. Note that your selection of target servers applies only to the module name displayed at the top of the page.

    Click continue to select target servers for the next module in the Enterprise Application.

  7. Repeat step 6 for each module included in the Enterprise Application. When you have finished targeting all available modules, continue with the next step.
  8. After you have finished targeting each module, the Deployment Assistant provides the opportunity to review your choices. The Deployment Targets section of the page displays each module in the Enterprise Application and its associated targets. If you need to change the target servers for one or more modules, click your browser's back button and reselect the targets.
  9. Select one of the following options in the Source accessibility section to set the deployment staging mode for the application:
  10. Accept the default name for the Enterprise Application, or enter a new name to use to refer to this application in the Administration Console.
  11. Click Deploy to deploy all modules.

 


Deploying an Enterprise Application with an Alternate Deployment Descriptor

To specify alternate deployment descriptors (external to the deployed .EAR file) when deploying an Enterprise Application, specify the file names with the weblogic.Deployer command. Note that you cannot specify alternate descriptor files when deploying with the Administration Console.

Administration Console Tasks

To specify an external application.xml and weblogic-application.xml file when deploying an Enterprise Application, use the command:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name myapplication -targets myserver1,myserver2,myserver3 -stage -deploy -altappdd c:\myfiles\myextapplication.xml -altwlsappdd c:\myfiles\myextwlsapplication.xml c:\localfiles\myapp.ear

 


Changing the Order of Deployment for a Module

You can change the deployment order for modules by setting ApplicationMBean LoadOrder attribute in the Administration Console. The LoadOrder attribute controls the load order of deployed modules relative to one another—modules with lower LoadOrder values deploy before those with higher values. In all cases, modules are deployed after the WebLogic Server instances has initialized dependent subsystems.

Notes: You cannot change the load order of deployed modules using the weblogic.Deployer utility.

Modules deployed prior to WebLogic Server 7.0 specify the load order value in their deployment descriptor files; you cannot change this load order using the Administration Console.

Administration Console Tasks

Follow these steps to view or change the deployment order of modules deployed to the WebLogic Server domain:

  1. Select the Deployments node in the left pane. The right pane displays all modules configured for deployment in the domain, listed in their current deployment order.
  2. Select the Change button next to a module name to display the Change Deployment Order page.
  3. Enter a new value in the Load Order field, and click Apply to apply your changes. The again displays the complete list of modules configured for deployment in the domain.

 


Redeploying or Stopping a Module

To redeploy or stop a module that is already deployed in the domain, you reference the module's deployment name rather than the actual archive file or exploded directory. When redeploying a module, target servers first stop the module and then deploy it using the available deployment files (local copies of the files, if the module was deployed in stage mode, or the original deployment files for nostage mode).

If you stop a deployed module, you can later redeploy it using the available deployment files and deployment name; you do not need to reselect the deployment files, as they remain associated with the deployment name in the domain.

Administration Console Tasks

To redeploy or stop a module using the Administration Console:

  1. Start the Administration Console for your domain.
  2. Expand the Deployments node in the left pane to display the different deployment types.
  3. In the left pane, select the type of application or module that you want to deploy. The available deployment types are:
    • Applications—Enterprise Applications or Web Services packaged as .ear files or directories
    • EJB Modules—Enterprise JavaBeans
    • Web Application Modules—Web Applications or Web Services packaged as .war files or directories
    • Connector Modules—Resource adaptors
    • Startup & Shutdown—Startup classes and Shutdown Classes
  4. In the right pane, select the name of the module you want to redeploy or stop. This displays a table with the deployment status of the module on all target servers. If you selected an Enterprise Application, the pane displays a deployment status table for each module that makes up the application.
  5. To redeploy or stop a module on a single target server, click the Redeploy or Stop button to the right of the target server name. To redeploy or stop a module on all target servers, click the Redeploy All or Stop All button at the bottom of the deployment status table.

Weblogic.Deployer Tasks

To redeploy a module using the weblogic.Deployer utility, use the redeploy command and specify the module's deployment name. The utility uses a different command form if you want to redeploy individual modules of an Enterprise Application.

For example, to redeploy a single module on all available target servers:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mymodule -redeploy

To redeploy a single module on a subset of the target servers, specify the target server list:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mymodule -redeploy -targets myserver1,myserver2

To redeploy a subset of the modules of an Enterprise Application, specify modulename@servername in the target server list. For example:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mymodule -redeploy -targets mymodule1@myserver1,mymodule2@myserver2

 


Redeploying Static Files in a Web Application

In a production environment, you may occasionally need to refresh the static content of a Web Application—HTML files, Image files, and so forth—without redeploying the entire application. You can use the weblogic.Deployer utility to notify the server that static files have changed.

weblogic.Deployer Tasks

To redeploy static files associated with a deployed module, specify the file names at the end of the redeploy command. For example:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mywebapp -redeploy mywebapp/copyright.html

Always specify the pathname to updated files relative by starting at the top level of the exploded archive directory. In the above example, the Web Application resides in an exploded archive directory named mywebapp.

jspRefresh Tasks

While weblogic.Deployer can refresh static files in your deployed applications, the command-line syntax for invoking earlier refresh tools remains viable. If you have scripts that invoke the WebAppComponentRefreshTool or weblogic.jspRefresh, they will now invoke weblogic.Deployer's refresh capability.

Use jspRefresh to refresh deployed static files such as:

You cannot use this utility to refresh Java class files.

To use jspRefresh, you must deploy the Web Application in exploded directory format. The utility does not work for components archived in WAR files.

To refresh a static file:

  1. Set up your development environment so that WebLogic Server classes are in your system CLASSPATH and the JDK is available. You can use the setEnv script located in the config/mydomain directory to set your environment.
  2. Enter the following command:
    % java weblogic.deploy -url adminServerURL -username AdminUserName -jspRefreshFiles fileList -jspRefreshComponentName component refresh password application 

    Where:

    • url is the URL of your WebLogic Administration Server.
    • AdminUserName is the username for system administration.
    • fileList is a comma-separated list of files to be refreshed. Wildcard characters (*.jsp, for example) are not supported.
    • component is the name of the Web Application being refreshed.
    • password is your system administration password.
    • application is the name of an Enterprise Application that contains the Web Application being refreshed. If your Web Application is not part of an Enterprise Application, enter the name of the Web Application.
    • For example, the following command refreshes the files HelloWorld.jsp and ball.gif in the myWebApp Web Application:

      java weblogic.deploy -url t3://localhost:7001
      -username myUsername -jspRefreshFiles HelloWorld.jsp,ball.gif
      -jspRefreshComponentName myWebApp refresh myPassword myWebApp

Note: Even though the syntax of the command says -jspRefreshFiles and -jspRefreshComponentName, you can refresh any static file using this command, not just JSP files.

 


Changing the Target List for a Deployed Module

After you have deployed a module in a WebLogic Server domain, you can change the module's target server list to add new WebLogic Server instances or to remove existing server instances. If you remove a target server, the module is immediately stopped and removed from the server. If you add a new target server, you must explicitly deploy the module on the new server before it is active.

Administration Console Tasks

  1. Start the Administration Console for your domain.
  2. Expand the Deployments node in the left pane to display the different deployment types.
  3. In the left pane, select the type of application or module that you want to deploy. The available deployment types are:
    • Applications—Enterprise Applications or Web Services packaged as .ear files or directories
    • EJB Modules—Enterprise JavaBeans
    • Web Application Modules—Web Applications or Web Services packaged as .war files or directories
    • Connector Modules—Resource adaptors
    • Startup & Shutdown—Startup classes and Shutdown Classes
  4. In the right pane, select the name of the module you want to edit. This displays a table with the deployment status of the module on all target servers.
  5. Click the Targets tab in the right pane to show the current target servers for the module. If you selected an Enterprise Application, the pane displays a target list for each module that makes up the application.
  6. Use the checkboxes next to each server name to add or remove servers from a module's target list. Click Apply to apply your changes.

Weblogic.Deployer Tasks

To add a new server to the target list using weblogic.Deployer, simply add the new server name to the target command-line option. For example:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mymodule -deploy -targets newserver

 


Changing a Server Staging Mode or Staging Directory

The server staging mode specifies the default deployment mode for a server if none is specified at deployment time. For example, the server staging mode is used if you deploy an application or module using weblogic.Deployer and you do not specify a staging mode. See Deployment Staging Modes for help on when to use staging modes.

Notes: You can only change the server staging mode by using the Administration Console or by directly changing the ServerMBean via JMX.

You cannot change the application staging mode without first deleting the application deployment and redeploying with the new mode.

Administration Console Tasks

To set the server staging mode:

  1. Expand the Servers node in the left pane.
  2. Select the name of the server instance that you want to configure.
  3. Select the Configuration->Deployment tab in the right pane to display the current staging mode.
  4. Select stage, nostage, or external_stage from the Staging Mode menu. These modes correspond to the staging modes described in Deployment Staging Modes, and apply only to the selected server instance.
  5. Enter a path in the Staging Directory Name attribute to store staged deployment files. The path is relative to the root directory of the selected server.
  6. If you are configuring the staging mode for the Administration Server, also specify an Upload Directory Name, relative to the server's root directory. This is the directory where the Administration Server stores uploaded files for deployment to servers and clusters in the domain.
  7. Click Apply to change the staging mode and directory.

 


Removing Files from a Deployment

If you deploy a Web Application using an exploded archive directory, you can update static contents of the Web Application either by refreshing the files (see Redeploying Static Files in a Web Application), or by deleting files from the deployment. To delete files, you must use the weblogic.Deployer utility with the delete_files option. For example:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mywebapp -delete_files mywebapp/copyright.html

Always specify the pathname to updated files relative by starting at the top level of the exploded archive directory. In the above example, the Web Application resides in an exploded archive directory named mywebapp.

 


Deleting a Deployment from the Domain

After you deploy a new module to servers in a domain, the deployment name remains associated with the deployment files you selected. Even after stopping the deployment on all servers, the files remain available for redeployment using either the Administration Console or weblogic.Deployer utility.

If you want to remove a deployment name and its associated deployment files from the domain, you must explicitly delete the deployment from the domain. If you need to redeploy a module after deleting it, you must identify the deployment files, staging mode, and module name using the instructions in Deploying a New Application Module to Server(s) on One Machine or Deploying a New Application Module to Servers on Multiple Machines.

Administration Console Tasks

To delete a module and its deployment name from the domain:

  1. Expand the Deployments node in the left pane to display the different deployment types.
  2. In the left pane, select the type of application or module that you want to deploy, redeploy, or stop.
  3. In the left pane, right-click the name of the deployment you want to remove, and select Delete module_name... from the menu.
  4. In the right pane, select Yes to remove the application or module.

Weblogic.Deployer Tasks

To delete a module and its deployment name from the domain using weblogic.Deployer, specify the undeploy option. For example:

java weblogic.Deployer -adminurl http://localhost:7001 -user weblogic -password weblogic -name mymodule -undeploy

 

Back to Top Previous Next