25
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. www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 1

A Hands-On WebLogic Guide forDeploying Application

Embed Size (px)

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.

Citation preview

Page 1: A Hands-On WebLogic Guide forDeploying Application

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 Date0.1 Draft#1 Kuldeep Mishra 05th Aug 20120.1 Review#1 Amit Sharma 18th Aug 2012

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

Page 2: A Hands-On WebLogic Guide forDeploying Application

Contents

Introduction Application Deployment..................................................................................................3

Application Deployment Steps...............................................................................................3

Deployment Tools.......................................................................................................................3

Weblogic.Deployer..................................................................................................................3

Administration Console..........................................................................................................3

WLST............................................................................................................................................ 3

Deployment Tools for Developers.....................................................................................3

Application Deployment using WLST................................................................................4

Application Undeployment using WLST.......................................................................................11

Administration Console................................................................................................................13

weblogic.Deployer Utility.............................................................................................................18

Using weblogic.Deployer Utility...................................................................................................18

Application Deployment using weblogic.Deployer.....................................................................19

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

Page 3: A Hands-On WebLogic Guide forDeploying Application

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 Deploymentii) Configuring Applications for Production Deploymentiii) Exporting an Application for Deployment to New Environmentsiv) Deploying Applications and Modules with weblogic.Deployerv) Redeploying Applications in a Production Environmentvi) Managing Deployed Applications

Deployment ToolsWebLogic Server provides the following tools to help us configure and deploy applications:i) WLSTii) Administration Consoleiii) Weblogic.Deployeriv) Deployment Tools for Developers

Weblogic.Deployerweblogic.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 ConsoleThe 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.

WLSTThe 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 DevelopersWebLogic 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 3

Page 4: A Hands-On WebLogic Guide forDeploying Application

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 WLSTFor 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.cmdAfter writing above command we got the message Your environment variable has been set.

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

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

Page 5: A Hands-On WebLogic Guide forDeploying Application

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 5

Page 6: A Hands-On WebLogic Guide forDeploying Application

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 6

Page 7: A Hands-On WebLogic Guide forDeploying Application

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 7

Page 8: A Hands-On WebLogic Guide forDeploying Application

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 8

Page 9: A Hands-On WebLogic Guide forDeploying Application

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 9

Page 10: A Hands-On WebLogic Guide forDeploying Application

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 10

Page 11: A Hands-On WebLogic Guide forDeploying Application

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.cmdAfter write above command we got the message Your environment variable has been set.ii)To Initializing Weblogic Scripting Tool <WLST>. We write below command in command prompt.java weblogic.WLSTHere 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 11

Page 12: A Hands-On WebLogic Guide forDeploying Application

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 12

Page 13: A Hands-On WebLogic Guide forDeploying Application

Administration ConsoleFor 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 13

Page 14: A Hands-On WebLogic Guide forDeploying Application

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 14

Page 15: A Hands-On WebLogic Guide forDeploying Application

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 15

Page 16: A Hands-On WebLogic Guide forDeploying Application

vi) Click Save.

vii) Click Testing.

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

Page 17: A Hands-On WebLogic Guide forDeploying Application

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 17

Page 18: A Hands-On WebLogic Guide forDeploying Application

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 UtilityTo 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 18

Page 19: A Hands-On WebLogic Guide forDeploying Application

Application Deployment using weblogic.DeployerFor deploying an application using weblogic.Deployer we follow the below steps:i) Go to command prompt and In command prompt and set the classpathC:\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 19

Page 20: A Hands-On WebLogic Guide forDeploying Application

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 20

Page 21: A Hands-On WebLogic Guide forDeploying Application

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

ix) Click Calendar.html link

x)Here we see the deployed application.

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