120964540 a hands on weblogic guide fordeploying application

22
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 1 A Hands-On WebLogic Guide for Deploying Application Description: BISP is committed to provide BEST learning material to the beginners and advance learners. In the same series, we have prepared a complete end-to end Hands-on Guide for WebLogic Administration. The document focuses on how to various ways of deploying application. Join our professional training program and learn from experts. History: Version Description Change Author Publish Date 0.1 Draft#1 Kuldeep Mishra 05 th Aug 2012 0.1 Review#1 Amit Sharma 18 th Aug 2012

Upload: doitnofear

Post on 25-Nov-2015

15 views

Category:

Documents


0 download

DESCRIPTION

120964540 a Hands on WebLogic Guide ForDeploying Application

TRANSCRIPT

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 1

    A Hands-On WebLogic Guide for

    Deploying Application

    Description:

    BISP is committed to provide BEST learning material to the beginners and

    advance learners. In the same series, we have prepared a complete end-to end

    Hands-on Guide for WebLogic Administration. The document focuses on how to

    various ways of deploying application. Join our professional training program and

    learn from experts.

    History: Version Description Change Author Publish Date 0.1 Draft#1 Kuldeep Mishra 05th Aug 2012

    0.1 Review#1 Amit Sharma 18th Aug 2012

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 2

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 3

    Contents

    Introduction Application Deployment ................................................................................................ 4

    Application Deployment Steps. ............................................................................................. 4

    Deployment Tools ...................................................................................................................... 4

    Weblogic.Deployer .................................................................................................................. 4

    Administration Console ........................................................................................................ 4

    WLST ......................................................................................................................................... 4

    Deployment Tools for Developers ...................................................................................... 4

    Application Deployment using WLST ............................................................................... 5

    Application Undeployment using WLST. .................................................................................... 12

    Administration Console ............................................................................................................. 14

    weblogic.Deployer Utility. .......................................................................................................... 19

    Using weblogic.Deployer Utility ................................................................................................. 19

    Application Deployment using weblogic.Deployer.................................................................... 20

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 4

    Introduction Application Deployment

    The term application deployment refers to the process of making an application or module available for processing client requests in a WebLogic Server domain. Application deployment generally involves the following tasks:

    Application Deployment Steps. i) Preparing Applications and Modules for Deployment

    ii) Configuring Applications for Production Deployment iii) Exporting an Application for Deployment to New Environments iv) Deploying Applications and Modules with weblogic.Deployer

    v) Redeploying Applications in a Production Environment vi) Managing Deployed Applications

    Deployment Tools WebLogic Server provides the following tools to help us configure and deploy applications: i) WLST

    ii) Administration Console iii) Weblogic.Deployer

    iv) Deployment Tools for Developers

    Weblogic.Deployer

    weblogic.Deployer provides a command-line based interface for performing both basic and

    advanced deployment tasks. Use weblogic.Deployer when we want command-line access to WebLogic Server deployment functionality, or when we need to perform a deployment task that is not supported using the Administration Console.

    Administration Console

    The Administration Console provides a series of Web-based Deployment Assistants that guide us

    through the deployment process. The Administration Console also provides controls for changing and monitoring the deployment status, and changing selected deployment descriptor values while the deployment unit is up and running.

    Use the Administration Console when we need to perform basic deployment functions interactively and we have access to a supported browser.

    WLST

    The WebLogic Scripting Tool (WLST) is a command-line interface that we can use to automate

    domain configuration tasks, including application deployment configuration and deployment operations.

    Deployment Tools for Developers

    WebLogic Server provides several tools for deploying applications and standalone modules: i) wldeploy is an Ant task version of the weblogic.Deployer utility. We can automate deployment tasks by placing wldeploy commands in an Ant build.xml file and running Ant to execute the

    commands.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 5

    ii) weblogic-maven-plugin is a Maven plug-in for WebLogic Server that we can use to perform deployment operations similar to those supported by weblogic.Deployer. The plug-in lets you

    deploy, redeploy, update, and such, applications built using Maven to WebLogic Server from within the Maven environment.

    iii) Weblogic.PlanGenerator is a command-line tools that enables developers to export an application's configuration for deployment to multiple WebLogic Server environments.

    iv) The deployment API allows us to perform deployment tasks programmatically using Java classes.

    v) The autodeploy domain directory allows us to deploy an application quickly for evaluation or testing in a development environment.

    Application Deployment using WLST

    For deploying an application using WLST we follow the below steps:

    i) Go to command prompt and In command prompt go to the weblogic home path to set the

    Environment variables.

    C:\Oracle\Middleware\wlserver_10.3\server\bin>setWLSEnv.cmd

    After writing above command we got the message Your environment variable has been set.

    ii)To Initializing Weblogic Scripting Tool . We write below command in command prompt. java weblogic.WLST

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 6

    Here we connect the server, For connecting with server we write the following command.

    connect('weblogic','admin123','t3://localhost:7001')

    iv)Here we see that we connected with AdminServer that belong to domain 'base_domain'.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 7

    v) Here we write the edit() command in command prompt.

    vi) To start edit session we write startEdit() command in command prompt.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 8

    vii) After started the edit session we deploy our application by writing the below command in

    command prompt.

    deploy('Calendar','C:/Oracle/Calendar.war',targets='AdminServer')

    viii) After written the deploy command we write the save() command in command prompt to save

    all changes.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 9

    ix) Here we see the message that Saved all your changes successfully and then we write the

    activate() command in command prompt.

    x) After Activation Completed. We write the exit() command from exiting the weblogic scripting

    tool.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 10

    Now, login to the WLS Admin Server Console. In WLS Admin Server Console Expand

    Environment by clicking + sign and then click on Servers within Domain Structure.

    i) Click on AdminServer(admin).

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 11

    ii) Setting For AdminServer page appeared and here we click on Deployment tab and here we see

    our application.

    iii) Write the address in our url: http://BISP1:/7001/Calendar

    Click on Calendar.html link .

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 12

    Application Undeployment using WLST.

    For Undeploying an application using WLST we follow the below steps:

    i) Go to command prompt and In command prompt go to the weblogic home path to set the

    Environment variables.

    C:\Oracle\Middleware\wlserver_10.3\server\bin>setWLSEnv.cmd

    After write above command we got the message Your environment variable has been set.

    ii)To Initializing Weblogic Scripting Tool . We write below command in command prompt.

    java weblogic.WLST Here we connect the server, For connecting with server we write the following command.

    connect('weblogic','admin123','t3://localhost:7001')

    iv)Here we see that we connected with AdminServer that belong to domain 'base_domain'.

    v) Here we write the edit() command in command prompt.

    vi) To start edit session we write startEdit() command in command prompt.

    vii) After started the edit session we deploy our application by writing the below command in

    command prompt. undeploy('Calendar')

    viii) After written the deploy command we write the save() command in command prompt to save

    all changes.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 13

    ix)Here we see the message that Saved all your changes successfully and then we write the

    activate() command in command prompt.

    x) After Activation Completed . We write the exit() command from exiting the weblogic scripting

    tool.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 14

    Administration Console

    For deploying an application using Administration Console we follow the below steps:

    i) Go to the Weblogic Administration Console.

    ii) Click Deployments within Domain Structure. Click Lock & Edit and in the deployments part

    click Install.

    iii) Click the path of our application. Click oracle.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 15

    Select radio button of application then click next.

    iv) In Install Application Assistance, Select Install this deployment as an application, then click

    next.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 16

    v) Select the targets for application. Check AdminServer and then click next.

    vi) Click next.

    v) Click Finish.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 17

    vi) Click Save.

    vii) Click Testing.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 18

    viii) Click on Test Point http://Ip Address:7001/Calendar.

    ix) Here we see the deployed application.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 19

    weblogic.Deployer Utility.

    The weblogic.Deployer utility replaces the earlier weblogic.deploy utility, which has been deprecated. The

    weblogic.Deployer utility is a Java-based deployment tool that provides a command-line interface to the WebLogic.

    This utility was developed for administrators and developers who need to initiate deployment from the command

    line, a shell script, or any automated environment other than Java.

    Using weblogic.Deployer Utility To use the weblogic.Deployer utility: 1) Set up our local environment so that WebLogic Server classes are in our system CLASSPATH

    and the JDK is available. We can use the setenv script located in our server's /bin directory to set the CLASSPATH.

    2) Use the following command syntax: % java weblogic.Deployer [options] [actions] [file(s)]

    We can also list specific files in the archive that are to be deployed (or redeployed, or undeployed). The file list can include file names and directories relative to the root of the application. If we specify a directory, its entire subtree is deployed or redeployed.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 20

    Application Deployment using weblogic.Deployer For deploying an application using weblogic.Deployer we follow the below steps:

    i) Go to command prompt and In command prompt and set the classpath

    C:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar

    ii) After set the classpath go to set the Environment Variable

    C:\Oracle\Middleware\user_projects\domains\WL_Domain\bin>setDomainEnv.cmd

    iii) Write the command java weblogic.Deployer -help in command prompt.

    iii) After written java weblogic.Deployer -help we see

    iv) Now, we write the below command to deploy an application.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 21

    java weblogic.Deployer -deploy -adminurl t3://localhost:7001 -username weblogic -password admin123 -name Calendar -stage -targets AdminServer -source C:\Oracle\Calendar.war

    v) Here we see the message deploy completed on AdminServer.

    vi) Here we check the deployed application on Weblogic Administration Console.

    Login to the Weblogic Administration Console. Go to Domain Structure and click on Deployment

    and then we see the deployed application in deployments table.

    vii) Click on Testing tab.

  • www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 22

    viii) Click on the link http://ipaddress:7001/Calendar

    ix) Click Calendar.html link

    x)Here we see the deployed application.