A Hands-On WebLogic Guide Fordeploying Application
A Hands-On WebLogic Guide Fordeploying 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
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 2
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 3
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 4
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 <WLST>. We write below command in command prompt. java weblogic.WLST
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 5
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 6
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 7
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 8
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 9
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 10
ii) Setting For AdminServer page appeared and here we click on Deployment tab and here we see our application.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 11
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 <WLST>. 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 12
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 13
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.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 14
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 15
v) Select the targets for application. Check AdminServer and then click next.
v) Click Finish.
www.bispsolutions.com | www.hyperionguru.com | weblogicexperts.wordpress.com | Page 16
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 17
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 18
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.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 19
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
java weblogic.Deployer -deploy -adminurl t3://localhost:7001 -username weblogic -password admin123 -name Calendar -stage -targets AdminServer -source C:\Oracle\Calendar.war
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.
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 21
www.bispsolutions.com
www.hyperionguru.com
weblogicexperts.wordpress.com |
Page 22