Common Deployment Tasks

 

  1. Upload Deployment Files to the Administration Server
  2. Deploy an App to Servers on the Same Machine
  3. Deploy an App to Servers on Multiple Machines
  4. Changing the Target List for an Existing Deployment
  5. Redeploying or Stopping a Deployment Unit
  6. Undeploying a Deployment Unit
  7. Deploying Modules of an Enterprise App to Different Instances
  8. Deploy an Enterprise App Using external_stage Mode
  9. Deploy an Enterprise App with an Alternate Application Descriptor
  10. Deploying a Module Newly Added to an EAR
  11. Changing the Order of Deployment for a Deployment Unit
  12. Changing a Server Staging Mode or Staging Directory
  13. Dynamically Updating Descriptors for a Deployment Unit
  14. Redeploying Static Files in a Web Application
  15. Removing Files from a Web Application Deployment
  16. Managing Deployment Tasks

 


Upload Deployment Files to the Administration Server

In order to deploy an application or standalone module to servers in a domain, the deployment file(s) must be accessible to the domain's Administration Server.

When you upload files to the Administration Server machine, the archive file is automatically placed in the server's upload directory .

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

  1. Go to...

    Administration Console | Deployments node | deployment unit (right-click) | Deploy a new deployment unit

  2. The right pane provides a link to upload the deployment files. Click the link to display the upload page.

  3. Use the Browse button to locate the archive file on the local file system that you want to upload to the Administration Server. Select the file and click Open.

  4. Click the Upload tab to upload the selected file to the Administration Server's upload directory. The Administration Console automatically opens the upload directory so that you can select the uploaded file for deployment.

  5. Continue deploying using the uploaded archive file.
Note that Administration Console upload functionality enables one to upload a single archive file. To upload an exploded archive directory, use the Weblogic.Deployer Tasks.

To enable weblogic.Deployer to upload and deploy a new application or standalone module, use -upload option...

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

weblogic.Deployer copies the deployment files to the Administration Server's upload directory before deploying it. To upload an exploded archive directory, specify the directory name instead of an archive filename (for example c:\localfiles\myappEar).

 


Deploy an App to Servers on the Same Machine

When deploying to servers that reside on the same machine, you can use the nostage deployment mode, where the Admin Server and all target servers deploy using the same deployment files, and deployment files are not copied to servers' stage directories.

Nostage mode is the default when you deploy an application or standalone module to the Administration Server; you do not need to specify nostage mode in this case.

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

To deploy to servers on one machine:

  1. Start the Administration Console for your domain.

  2. Go to...

    Administration Console | Deployments node | deployment unit (right-click) | Deploy a new deployment unit | Archive File | Target Application

  3. Select the servers and cluster to which you want to deploy the application. Continue.

  4. Specify a deployment name. In the Source Accessibility header, make sure that the following option is selected:

    I will make the application accessible from the following location

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

  5. Click Deploy to deploy the files.

To deploy with nostage mode using weblogic.Deployertool, use the -nostage option:

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

 


Deploy an App to Servers on Multiple Machines

When deploying a deployment unit to servers on different machines, you generally use the stage deployment mode, which copies deployment files from the Administration Server to each target server before deploying. If all servers can access the deployment files from a shared directory, you can also use nostage mode, which does not copy files to the target servers. In rare circumstances you may also use external_stage mode, in which ensure that deployment files are copied to each server's staging directory before deployment. See Staging Modes.

Stage mode is the default when you deploy an application or standalone module to a Managed Server; you do not need to specify stage mode in this case.

The Administration Console allows you to select between nostage and stage mode when deploying files. If you need to deploy in external_stage mode, use the weblogic.Deployer instructions in the next section or in Deploy an Enterprise App Using external_stage Mode.

To deploy a deployment unit to multiple servers on different machines:

  1. Go to...

    Administration Console | Deployments node | deployment unit (right-click) | Deploy a new deployment unit | Archive File | Target Application

  2. Select the servers and cluster to which you want to deploy the application.

  3. In the third step of the Deployment Assistant, review your choices and specify a deployment name. In the Source Accessibility header, make sure that the following option is selected:

    • Copy this application onto every target for me

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

  4. Click Deploy to deploy the files.

When deploying to multiple machines using the weblogic.Deployer utility, specify the nostage or external_stage mode explicitly at the command line. The deployment uses stage mode by default if no mode is specified. For example:

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

 


Changing the Target List for an Existing Deployment

After you deploy an application or standalone module in a WebLogic Server domain, you can change the target server list to add new WebLogic Server instances or to remove existing server instances. If you remove a target server, only the target list itself is updated - the deployment unit remains deployed to the removed server until you explicitly undeploy it. Similarly, if you add a new target server, explicitly deploy the deployment unit on the new server before it is active on that server.

After adding a new target list using the Administration Console, redeploy the deployment unit on all existing servers in order to deploy it on the newly-added target server.

  1. Start the Administration Console for your domain.

  2. Expand the Deployments node in the left pane to display the different deployment units.

  3. In the left pane, select the type of deployment unit whose target server list you want to change.

  4. In the right pane, select the deployment name of the actual deployment unit whose target server list you want to modify. This displays a table with the deployment status on all target servers.

  5. Click the Targets tab in the right pane to show the current target servers for the deployment. If you selected an Enterprise App, 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 the target list. Click Apply to apply your changes.

  7. Select the Deploy tab in the right pane.

  8. Click Deploy this Application; the Administration Console deploys the application on newly-added servers, and redeploys the application on existing target servers.

You cannot use weblogic.Deployer to remove a server from a deployment unit's target list if the application or module is already deployed.

To add a new server to the target list using weblogic.Deployer, simply specify the new list of target servers with the deploy command. For example:

java weblogic.Deployer -adminurl http://localhost:7001  \
                       -user weblogic \
                       -password weblogic  \
                       -name mydeploymentname  \
                       -deploy  \
                       -targets server1, newserver

 


Redeploying or Stopping a Deployment Unit

To redeploy or stop a deployment unit that is already deployed in the domain, reference the deployment name rather than the actual archive file or exploded directory. When redeploying a deployment unit, target servers use the available deployment files (local copies of the files, if the unit was deployed in stage mode, or the original deployment files for nostage mode). During redeployment, the application may be unavailable to clients for a short time while classes are reloaded. For this reason, redeployment is not recommended in production environments.

Note that when you stop a deployment unit, it is not available to clients. However, you can later redeploy a stopped deployment unit using the available source files and deployment name; you do not need to reselect the deployment files, as they remain associated with the deployment name in the domain.

To redeploy or stop a deployment unit 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 units.

  3. In the left pane, select the type of deployment unit that you want to stop or redeploy.

    • Applications - Enterprise Apps or Web Services packaged as .ear files or directories

    • EJB Modules - Enterprise JavaBeans packaged as .jar files or directories

    • Web Application Modules - Web Applications or Web Services packaged as .war files or directories

    • Connector Modules - Resource Adapters packaged as .rar files or directories

    • Startup & Shutdown - Startup classes and shutdown classes

  4. In the right pane, select the name of the deployment unit you want to redeploy or stop. A table displays the status of the deployment on all target servers.

  5. To redeploy or stop a deployment on a single target server, click the Redeploy or Stop button to the right of the target server name. To redeploy or stop a deployment on all target servers, click the Redeploy All or Stop All button at the bottom of the deployment status table.

To redeploy a deployment unit using the weblogic.Deployer utility, use the redeploy command and specify the deployment name. Specifying only the deployment name redeploys an application on all existing target server instances, as in:

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

For applications deployed in a cluster, redeployment occurs on all target server instances in the cluster. If the application was previously deployed to all servers in the cluster, you cannot subsequently redeploy the application on a subset of servers in the cluster.

If an application was previously deployed to multiple, non-clustered server instances, you can specify a target list to redeploy the application on a subset of the target servers, as in:

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

The weblogic.Deployer utility uses a different command form if you want to redeploy individual modules of a deployed Enterprise App. To redeploy a subset of the modules of an Enterprise App, specify modulename@servername in the target server list. For example:

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

If the application was previously deployed to a cluster, redeploy the module to the entire cluster, rather than a subset of servers. If you specify a subset of servers in the cluster, weblogic.Deployer responds with the error:

An attempt to add server target target_name to module module_name has been rejected . This is because its parent cluster, cluster_name, is aso targeted by the module.

 


Undeploying a Deployment Unit

After you deploy a new application or standalone module to servers in a domain, the deployment name remains associated with the deployment files you selected. Even after you stop 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, explicitly undeploy the application or standalone module. If you need to redeploy a deployment unit after deleting it, identify the deployment files, staging mode, and deployment name using the instructions in Deploy an App to Servers on the Same Machine or Deploy an App to Servers on Multiple Machines.

Undeploying a deployment unit does not remove the original source files used for deployment. It only removes the deployment's configuration from the domain, as well as any deployment files created by the system (for example, files copied with stage deployment mode).

To undeploy a deployment unit from the domain using the console:

  1. Expand the Deployments node in the left pane to display the different deployment units.

  2. In the left pane, select the type of deployment unit that you want to undeploy.

  3. In the left pane, right-click the name of the deployment you want to remove, and select Delete deployment_name... from the menu.

  4. In the right pane, select Yes to remove the application or module.

To undeploy a deployment unit 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

 


Deploying Modules of an Enterprise App to Different Instances

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

  1. Start the Administration Console for your domain.

  2. Expand the Deployments node in the left pane to display the different deployment units.

  3. In the left pane, select the Applications node to display the currently-deployed Enterprise App in your domain.

  4. In the right pane, select the Deploy a new Application link. This initiates the Enterprise App Deployment Assistant.

  5. In the first step of the Deployment Assistant, select the EAR file or exploded Enterprise App directory that you want to deploy. See Deploying Applications and Modules in the Administration Console Online Help if you need further instructions about using the Deployment Assistants.

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

  6. In the second page 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 App.

  7. Repeat step 6 for each module included in the Enterprise App. When you have finished targeting all available modules, continue with the next step.

  8. After you have finished targeting each module, you can review your choices. The Deployment Targets section of the page displays each module in the Enterprise App 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:

    • Copy this application onto every target for me - This option corresponds to stage mode, where the Administration Server copies the deployment files to each target server before the servers deploy the application.

    • I will make the application accessible from the following location - This option corresponds to nostage mode, where all targets deploy the files from the specified location.

  10. Accept the default name for the Enterprise App, or enter a new name to use to refer to this application in the Administration Console.

  11. Click Deploy to deploy all modules.

When deploying modules to different Weblogic Server instances using the weblogic.Deployer utility, specify individual modules using the module_name@target_name syntax. For example:

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

When you specify Web Application modules that are part of an .ear file, use the Web Application's context root name as the module name. For example, if the application.xml file for a file, myapp.ear, defines:

<module>
    <web>
        <web-uri>myweb.war</web-uri>
            <context-root>/welcome</context-root>
        </web>
</module>

you could deploy only the Web Application by using a command similar to:

java weblogic.Deployer -adminurl http://localhost:7001  \
                       -user weblogic \
                       -password weblogic  \
                       -name mywebapplication  \
                       -targets welcome@myserver1 \
                       -stage  \
                       -deploy c:\localfiles\myapp.ear

 


Deploy an Enterprise App Using external_stage Mode

Use external_stage mode when you want to manually copy very large files to target servers before deployment to reduce the time required to deploy the application. You can also use external_stage mode if you have a third-party application or an automated script that copies files for you. You cannot use the Administration Console to deploy in external_stage mode.

To deploy an application using external_stage mode:

  1. Make sure that the deployment files are accessible to the Administration Server.

  2. On each target server for the deployment, create a subdirectory in the staging directory that has the same name as the deployment name. For example, if you will specify the name myEARExternal for the deployment name, create a myEARExternal subdirectory in the staging directories for each target server.

    If you do not specify a deployment name at deployment time, WebLogic Server selects a default name. See Deployment Names for more information.

  3. Copy the deployment files into the staging subdirectories you created in Step 2 above.

  4. Deploy the application or module using the weblogic.Deployer utility. For example:
    java weblogic.Deployer -adminurl http://localhost:7001  \
                           -name weblogic \
                           -password weblogic  \
                           -external_stage  \
                           -name myEARExternal  \
                           -deploy c:\myapps\myear
    

 


Deploy an Enterprise App with an Alternate Application Descriptor

Alternate deployment descriptor files change the run-time configuration of an application without changing the application's contents. See Deploying Enterprise Apps With Alternate Deployment Descriptors for more information.

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

To specify an external application.xml and weblogic-application.xml file when deploying an Enterprise App using weblogic.Deployer, 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

 


Deploying a Module Newly Added to an EAR

If you add the module newmodule.war to a deployed application named myapp.ear, and you update the module in the application.xml file, you can deploy newmodule.war by using the weblogic.Deployer command:

java weblogic.Deployer -username myname  \
                       -password mypassword  \
                       -name myapp.ear  \
                       -deploy  \
                       -targets newmodule.war@myserver  \
                       -source /myapp/myapp.ear

This command deploys the new module without redeploying the other modules in the application. You must specify the correct file extension (.war in the above example) for archived modules in an EAR file.

 


Changing the Order of Deployment for a Deployment Unit

You can change the deployment order for a deployed application or standalone module by setting the ApplicationMBean LoadOrder attribute in the Administration Console. The LoadOrder attribute controls the load order of deployments relative to one another - modules with lower LoadOrder values deploy before those with higher values. In all cases, applications and standalone modules are deployed after the WebLogic Server instance has initialized dependent subsystems.

Notes: Modules within a deployed Enterprise App are loaded in the order specified by the application.xml file; you cannot change this ordering using the Administration Console.

You cannot change the load order of applications and standalone modules using the weblogic.Deployer utility.

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

Follow these steps to view or change the deployment order of deployments in the WebLogic Server domain using the console:

  1. Select the Deployments node in the left pane. The right pane displays all applications and standalone modules configured for deployment in the domain, listed in their current deployment order.

  2. Click the Change button next to a deployment 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 right pane again displays the complete list of deployment units configured for the domain.

 


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 standalone module using weblogic.Deployer and you do not specify a staging mode. See Deployment Staging Modes and Staging Directories 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.

Changing the server staging mode does not affect existing applications. If you want to change the staging mode for an existing application, undeploy the application deployment and then redeploy it with the new staging mode.

To set the server staging mode using the console:

  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 Staging Directories, 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.

 


Dynamically Updating Descriptors for a Deployment Unit

When you deploy an application or standalone module using an exploded archive directory, the Administration Console allows you to directly edit selected deployment descriptors in a production environment. The changes you make are automatically persisted to the module's deployment descriptor files, and the changes are dynamically applied to all target servers that host the module.

You cannot use the Administration Console to edit deployment descriptors for applications and modules that are deployed from archive files.

To edit deployment descriptors for a deployed Enterprise App:

  1. Deploy the Enterprise App as an exploded archive directory. If the application contains multiple EJB, Web Application, or Resource Adapter modules, make sure that those modules also reside as exploded directories having the correct subdirectory names. (Module subdirectories must match the URI values specified in the Enterprise App's application.xml descriptor).

  2. In the Administration Console, expand the Deployments node in the left pane.

  3. Expand the node in the left pane that corresponds to the deployed Enterprise App. This displays all of the modules contained in the enterprise application.

  4. In the left pane, select the name of the EJB, Web Application, or Resource Adapter module whose descriptors you want to edit.

  5. In the right pane, select the Configuration->Descriptor tab.

  6. Use the Configuration->Descriptor tab to make available changes to the module's deployment descriptors, and click Apply. Your changes are automatically persisted to the module's XML deployment descriptor file, and the changes are reflected in all WebLogic Server instances that host the deployed module.

 


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. If you deployed the Web Application as an exploded archive directory, you can use the weblogic.Deployer utility to notify the server that static files have changed.

 

weblogic.Deployer Tasks

To redeploy a single file associated within a deployment unit, specify the file name 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 to the root directory of the exploded archive directory. In the above example, the Web Application is deployed as part of an Enterprise App, so the module directory is specified (mywebapp/copyright.html). If the Web Application module had been deployed standalone, rather than as part of an Enterprise App, the file would have been specified alone (copyright.html).

You can also redeploy an entire directory of files by specifying a directory name instead of a single file:

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

In the above example, all files and subdirectories located in the myjsps subdirectory of the Enterprise App are redeployed. Note that the refresh tools are deprecated and will be removed in a future WebLogic Server release. Use weblogic.Deployer instead.

 


Removing Files from a Web Application 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, 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.

 


Managing Deployment Tasks

The WebLogic Server deployment system automatically assigns a unique ID to deployment tasks so that you can track and manage their progress.

The Administration Console allows you to monitor running and completed tasks, as well as cancel running tasks.

After deploying, redeploying, or stopping a deployment unit, the Deploy tab in the right pane shows the status of the deployment action in the deployment status tables. To view more details about an individual task, click a link in the Status of Last Action column of the table.

To view a complete list of ongoing and completed deployment tasks (as well as other domain configuration tasks) select the Tasks node in the left pane.

The weblogic.Deployer utility enables you to monitor and cancel running deployment tasks. weblogic.Deployer also enables you to assign your own task identification numbers for use with subsequent commands.

The following command assigns task ID 73 to a new deployment action:

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

You can later check the status of the task using the following command:

java weblogic.Deployer -adminurl http://localhost:7001  \
                       -user weblogic \
                       -password weblogic  \
                       -id redeployPatch3  \
                       -list

You can later check the status of running tasks using the following command:

java weblogic.Deployer -adminurl http://localhost:7001  \
                       -user weblogic \
                       -password weblogic  \
                       -listtask

If a task takes too long to complete you can cancel it using the command:

java weblogic.Deployer -adminurl http://localhost:7001 \
                       -user weblogic\
                       -password weblogic \
                       -id redeployPatch3 \
                       -cancel

Skip navigation bar  Back to Top Previous Next