Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Oracle WebLogic Server 12c Advanced Administration Cookbook

You're reading from   Oracle WebLogic Server 12c Advanced Administration Cookbook If you want to extend your capabilities in administering Oracle WebLogic Server, this is the helping hand you've been looking for. With 70 recipes covering both basic and advanced topics, it will provide a new level of expertise.

Arrow left icon
Product type Paperback
Published in Jun 2013
Publisher
ISBN-13 9781849686846
Length 284 pages
Edition Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Dalton Iwazaki Dalton Iwazaki
Author Profile Icon Dalton Iwazaki
Dalton Iwazaki
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Oracle WebLogic Server 12c Advanced Administration Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Install, Configure, and Run FREE CHAPTER 2. High Availability with WebLogic Clusters 3. Configuring JDBC Resources for High Availability 4. Configuring JMS Resources for Clustering and High Availability 5. Monitoring WebLogic Server 12c 6. Troubleshooting WebLogic Server 12c 7. Stability and Performance 8. Security Index

Deploying applications


This recipe will cover the deployment of a J2EE Application archived file (EAR), but it also applies to Web Application (WAR), Resource Adapters(RAR), and other JAR archived files, such as libraries, EJBs, and Java classes.

The following steps will walk you through the process to deploy the application. The WebLogic administrator usually assumes the deployer role in a production environment, so make sure to define a well-structured procedure to deploy the applications and follow it.

Getting ready

This recipe will deploy an archived application file called myApp.ear. The application will be target of the PROD_Cluster cluster instead of the individual Managed Servers.

How to do it...

Carry out the following steps:

  1. Create a new directory to be the application installation directory using the syntax/oracle/applications/<environment>/<application>/<version>:

    [wls@prod01]$ mkdir -p /oracle/applications/prod/myApp/v1
    [wls@prod01]$ cd /oracle/applications/prod/myApp/v1
    
  2. Create two directories:

    [wls@prod01]$ mkdir app
    [wls@prod01]$ mkdir plan
    
  3. Copy the myApp.ear file to the app directory.

  4. Access the Administration Console with your web browser at http://prod01.domain.local:7001/console.

  5. Click on the Lock & Edit button to start a new edit session.

  6. Navigate to the Deployments page by clicking on the link in the domain structure.

  7. Click on the Install button to install a new application.

  8. Type the path /oracle/applications/prod/myApp/v1/app and click on Next.

  9. Select myApp.ear from the list and click on Next.

  10. Select Install this deployment as an application and click on Next.

  11. Select the All servers from the cluster radio button from the PROD_Cluster cluster and click on Next.

  12. Leave the default options and click on the Finish button.

  13. A new deployment plan file will automatically be created in /oracle/applications/prod/myApp/v1/plan/Plan.xml.

  14. Click on the Activate Changes button to apply the changes.

  15. The application should be in a Prepared state. Start the application by selecting the myApp checkbox and clicking on the Start button with the Servicing all requests option.

How it works...

This procedure installs a simple enterprise application named myApp to the cluster PROD_Cluster in the WebLogic domain.

The application is distributed to the cluster using the default deployment option stage mode. In the stage mode deployment, the Administration Server prepares the myApp.ear file to be copied to the stages directory of each of the Managed Servers of the cluster PROD_Cluster. The directory is $DOMAIN_HOME/servers/<servername>/stage/<application>.

WebLogic will use this local copy until a new redeployment is made.

There's more...

There are many options to achieve the same results when deploying.

Deploying using the weblogic.Deployer tool

You can use the command-line tool weblogic.Deployer to make deployment changes in a WebLogic domain.

To perform the same deployment of myApp.ear to the PROD_Cluster cluster, do the following:

  1. Go to the WebLogic domain's bin directory:

    [wls@prod01]$ cd $DOMAIN_HOME/bin
    
  2. Set the environment variables:

    [wls@prod01]$ . ./setDomainEnv.sh
    
  3. Run the weblogic.Deployer command line with the parameters:

    [wls@prod01]$ java weblogic.Deployer -adminurl t3://prod01.domain.local:7001 -username wlsadmin -password <pwd> -deploy -targets PROD_Cluster /oracle/applications/prod/myApp/v1/app/myApp.ear
    
  4. The following should be the output:

    weblogic.Deployer invoked with options:  -adminurl t3://prod01.domain.local:7001 -username wlsadmin -deploy -targets PROD_Cluster /oracle/applications/prod/myApp/v1/app/myApp.ear
    <Info><J2EE Deployment SPI><BEA-260121><Initiating deploy operation for application, myApp [archive: /oracle/applications/prod/myApp/v1/app/myApp.ear], to PROD_Cluster .>
    
  5. The myApp application should be deployed to the PROD_Cluster cluster.

Deploying applications using WLST

Now let's deploy the application through WLST using the following steps:

  1. Log in as a wls user to shell and start WLST:

    [wls@prod01]$ $WL_HOME/common/bin/wlst.sh
    
  2. Connect to the Administration Server using wlsadmin as the user, <pwd> as the password, and t3://prod01.domain.local:7001 as the server URL:

    wls:/offline>connect("wlsadmin","<pwd>","t3://prod01.domain.local:7001")
    
  3. Run the following WLST command to deploy the myApp.ear application to the PROD_Cluster cluster:

    deploy("myApp", "/oracle/applications/prod/myApp/v1/app/myApp.ear","PROD_Cluster")
    
  4. The following should be the output:

    Deploying application from /oracle/applications/prod/myApp/v1/app/myApp.ear to targets PROD_Cluster (upload=false) ...
    <Apr 6, 2013 11:02:24 PM BRT><Info><J2EE Deployment SPI><BEA-260121><Initiating deploy operation for application, myApp [archive: /oracle/applications/prod/myApp/v1/app/myApp.ear], to PROD_Cluster .>
    .Completed the deployment of Application with status completed
    Current Status of your Deployment:
    Deployment command type: deploy
    Deployment State       : completed
    
You have been reading a chapter from
Oracle WebLogic Server 12c Advanced Administration Cookbook
Published in: Jun 2013
Publisher:
ISBN-13: 9781849686846
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime