BEA Logo BEA WebLogic Server Release 6.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

   BEA WebLogic Server Administration Guide:   Previous topic   |   Next topic   |   Contents   |  Index

 

Deploying Applications

 

This section discusses installation and deployment of applications and application components on WebLogic Server. The topics include:

Dynamic Deployment

If auto-deployment is enabled for the target WebLogic Server domain, when an application is copied into the /config/domain_name/applications directory of the WebLogic Administration Server, if the Administration Server is running it detects the presence of the new application and deploys it automatically on the Administration Server. (The subdirectory domain_name is the name of the WebLogic Server domain in which you are deploying this application.) This technique for deploying an application is called dynamic deployment and is recommended only for use while you are developing applications. Dynamic deployment is not recommended for use in a production environment. If WebLogic Server is not running when you copy the application to the /applications directory, the application is deployed the next time the WebLogic Server is started.

By default, auto-deployment is enabled. If you have auto-deployment disabled, you can still deploy an application or application component manually via the Administration Console. This technique is called static deployment.

Enabling or Disabling Auto-Deployment

To determine whether you have auto-deployment enabled, invoke the Administration Console and go to the domain applications settings page (Configuration-->Applications) for the domain. This page allows you to enable or disable auto-deployment and to set the interval (in milliseconds) at which the WebLogic Server checks for new applications in the \applications subdirectory. Figure 6-1 shows this page for the examples demonstration server.

By default, the Administration Server checks every three seconds for changes in the \applications directory when auto-deployment is enabled.

Note: Auto-deployment is a method for quickly deploying an application on the Administration Server. It is recommended that this method be used only in a development environment for testing an application. Use of auto-deployment in a production environment or for deployment of components on Managed Servers is not recommended.

Figure 6-1 Domain Applications Settings Page

appman3.jpg

Dynamic Deployment of Applications in Expanded Directory Format

An application or application component can be dynamically deployed either in expanded directory format or as packaged in an Enterprise Application Archive (EAR) file, a Web Application Archive (WAR) file, or a Java Archive (JAR) file.

To dynamically deploy an application in exploded format, do the following:

  1. Make sure the directory name created for the exploded application is the same as the Context Path of the application.

  2. Copy this subdirectory under /config/domain_name/applications, where domain_name is the name of the target domain where the application is to be deployed. This will automatically deploy the application if auto-deploy is enabled.

Dynamic Undeployment or Redeployment of Applications

An application or application component can be dynamically redeployed while the server is running. This may be useful if you want to update a deployed application or application component without stopping and restarting the WebLogic Administration Server. To dynamically redeploy a JAR, WAR or EAR file, simply copy the new version of the file over the existing file in the /applications directory.

This feature is useful for developers who can simply add the copy to the /applications directory as the last step in their makefile, and the server will then be updated.

Dynamic Redeployment of Exploded Applications

You can also dynamically redeploy applications or application components that have been deployed in exploded format. When an application has been deployed in exploded format, the Administration Server periodically looks for a file named REDEPLOY in the WEB-INF directory. If the timestamp on this file changes, the Administration Server redeploys the exploded directory.

If you want to update files in an exploded application directory, do the following:

  1. When you first deploy the exploded application, create an empty file named REDEPLOY in the WEB-INF directory.

  2. To update the exploded application, copy the updated files over the existing files in that directory.

  3. After copying the new files, touch the REDEPLOY file in the exploded directory to alter its timestamp.

When the Administration Server detects the changed timestamp, it redeploys the contents of the exploded directory.

Using the Administration Console to Deploy Applications

You can use the Administration Console to install and deploy an application or application components (such as EJB and JSP JAR files) and deploy instances of application components on target WebLogic Servers. There are several steps to carry out this task:

  1. Install the application (or application component) in the /config/domain_name/applications directory on the Administration Server (where domain_name is the name of the domain).

    Use the Install an Application page in the Administration Console to copy a J2EE application (EAR file), Web application (WAR file), or EJB or JSP (JAR file) to the /config/domain_name/applications directory on the Administration Server. There is a link to the Install an Application page from the applications table (see Figure 6-2), Web applications table and EJB deployments table. Access these tables by selecting the appropriate container in the tree in the left pane.

    Installing an application (or application component) via the Administration Console also creates entries for that application and application components in the configuration file for the domain (/config/domain_name/config.xml). The Administration Server also generates JMX Management Beans (MBeans) that enable configuration and monitoring of the application and application components.

    Figure 6-2 Applications Table for Petstore Demonstration Server

    appmana.jpg

  2. Deploy the application or application components.

    There are two ways to do deployment depending upon whether you have auto-deployment enabled:

  3. Deploy instances of application components (Web application components or EJBs) on Managed Servers.

    Once your application is installed on the Administration Server (in the /config/domain_name/applications directory), you can deploy components of the application to WebLogic Managed Servers.

    Select application components to be deployed on a server by accessing the Deployments-->EJB (see Figure 6-3) or Deployments-->Web Applications tab pages for that server.

    Alternatively, you can select target servers for deployment of an application component via the Targets tab page for that component.

    Figure 6-3 Deployment-->EJB Tab Page for a Server

    appman2.jpg

If you deploy application components (such as EJBs or WAR files) to Managed Servers in a cluster, you must ensure that the same application components are deployed on all servers in the cluster. To do this, you would select the cluster as the target for the deployment.

When an application or application component (such as an EAR or WAR file, or EJB JAR files) is deployed to a particular WebLogic Server, the files are copied to a directory .wl_temp_do_not_delete_servername under /config/domain_name/applications on the target WebLogic Server. The WebLogic Administration Service invokes a file distribution servlet to copy the files to the target server.

 

Back to Top