Contents
- Overview
- Autodeploy a web application
- Deploy, redeploy (update), and undeploy (delete) a web application via the admin console
- Edit web app deployment descriptors via the admin console
- Test deployed web applications via the admin console
- Describe the relationship between WebLogic and Web servers
- Deploy, redeploy, and undeploy a web application with weblogic.Deployer
- Deploy a web application with WLST
- FastSwap and On-Demand Deployment
<< Previous
Overview
Deployment Process
* Preparing: archive or exploded
* Configuring: create deployment plan
* Deploying:
– install or deploy
– update or redeploy
– delete or undeploy
Deployment Methods
* WLS supports three deployment methods:
– console: install, update, delete
– command line: WLST, weblogic.Deployer, wldeploy Ant task
– auto deplooyment
* Applications and EJBs can be deployed in an
– archive file (.ear, .war, .jar)
– exploded
Autodeploy a web application
* Enabled only when not in Production Mode
* Upload application (either archive or exploded) to autoDeploy directory
Deploy, redeploy (update), and undeploy (delete) a web application via the admin console
Prepare a New Application
Start an Application in Admin Mode
Start an Application for All Requests
Stop an Application
Update an Application
Delete an Application
* Stop the application first
* Then delete
Edit web app deployment descriptors via the admin console
Test deployed web applications via the admin console
Describe the relationship between WebLogic and Web servers
Deploy, redeploy, and undeploy a web application with weblogic.Deployer
Syntax
java weblogic.Deployer \ [options] \ [-deploy|-undeploy|-redeploy|-start|-stop|-listapps] \ [file(s)]
listapps
java weblogic.Deployer -adminurl t3://wlbox:7001 \ -username weblogic -password welcome1 \ -listapps
listtask
java weblogic.Deployer -adminurl t3://wlbox:7001 \ -username weblogic -password welcome1 \ -listtask
Cancel Task
java weblogic.Deployer -adminurl t3://wlbox:7001 \ -username weblogic -password welcome1 \ -cancel -id tag
Deploy
java weblogic.Deployer -adminurl t3://wlbox:7001 \ -username weblogic -password welcome1 \ -name appA \ -source /labs/wls1035/wlserver_10.3/samples/domains/wl_server/servers/examplesServer/upload/appA/app/appA.war \ -targets examplesServer \ -deploy
Un-Deploy
java weblogic.Deployer -adminurl t3://wlbox:7001 \ -username weblogic -password welcome1 \ -name appA \ -undeploy
weblogic.Deployer Options
-nowait: Allows multiple tasks
-timeout: Specifies the time to wait for a task
-source: Specifies the location of the file to deploy
-name: Names the application to deploy
-targets: Specifies the list of servers as the targets for application deployment
-id: Names the task
-activate: Activates the application or component
-deactivate: Deactivates the application or component
-unprepare: Deactivates and unloads classes for the application
-remove: Removes the application from the server
-cancel: Cancels the task
-list:
-deploy: Is a convenient alias for –activate
-undeploy: Is a convenient alias for –unprepare
Deploy a web application with WLST
Syntax
* list all apps
listApplications()
* deploy
deploy(appName, path, [targets], [stageMode], [planPath], [options])
Examples
## # WLST script for Deploying Java EE Application # ## # Connect to the server print 'Connecting to server .... ' connect('weblogic','welcome1','t3://localhost:7001') appname = "mbeanlister" applocation = "c:/domains/MedRecDomain/apps/mbeanlister" # Start deploy print 'Deploying application ' + appname deploy(appname, applocation, targets='myserver', planPath='c:/myapps/plan/plan.xml') print 'Done Deploying the application '+ appname exit()
connect('myuser','mypass1','t3://adminserver:7001') name = "HRServices" location = "/usr/myapplications/HRServices.ear" deploy(name, location, targets='serverA')
Other WLST Deployment Commands
distributeApplication(location, targets='serverA') startApplication(name) redeploy(name) stopApplication(name) listApplications()
FastSwap and On-Demand Deployment
* When enabled, WLS automatically reloads modified Java classes
* Available only when domain is running not in Production Mode
* Applicable to web applications that are in exploded form
* Enabled in weblogic.xml
<fast-swap>true</fast-swap>
Next >>
[mv_include id=’3268′]
* Deploying Applications
5 Responses to WebLogic 11g Deployment Concepts