Oracle WebLogic Server 12c

Download Oracle WebLogic Server 12c

Post on 01-Jun-2017

214 views

Category:

Documents

1 download

Embed Size (px)

TRANSCRIPT

<p>Oracle WebLogic Server 12c: Deploying and Undeploying Applications</p> <p>Purpose</p> <p>This tutorial shows how to use the Oracle WebLogic Server 12cadministration console to deploy a Java Enterprise Edition web application.</p> <p>Time to Complete</p> <p>Approximately 20 minutes</p> <p>Overview</p> <p>A Java web application, like any Java Enterprise Edition application, can be deployed to an application server as an archive file. Web application archives use the file extension.war.</p> <p>This tutorial covers using the Oracle WebLogic Server 12c(12.1.1) administration console to deploy a simple Java Enterprise Edition web application. The tutorial shows how to start and run the application. The tutorial then shows how to redeploy an updated version of the application. Finally, the tutorial shows how to undeploy the application.</p> <p>Software Requirements</p> <p>The following is a list of software requirements:</p> <p> Oracle WebLogic Server 12c(12.1.1)</p> <p>Prerequisites</p> <p>Before starting this tutorial, you should have completed the Oracle by Example tutorials titledOracle WebLogic Server 12c: Installing WebLogic Server and Creating a DomainandOracle WebLogic Server 12c: Configuring Managed Servers.</p> <p>Deploying and Starting an Application</p> <p>To deploy a Java web application and start it by using the administration console, perform the following steps:</p> <p>1.</p> <p>Download thebenefits.warfile to the machine where your WebLogic Server domain and servers are. This is a sample Java web application archive to deploy.</p> <p>2.</p> <p>If the administration server of the domain is not already running, it needs to be started. To start it, in a Terminal window, navigate to the domain directory, and enter the command:</p> <p>$./startWebLogic.sh</p> <p>When prompted for ausernameandpasswordenter the credentials of the domain administrator.</p> <p>3.</p> <p>The managed server dizzy1 should also be running. If it is not already running, start it. In another Terminal window, navigate to the domain directory, thencdinto thebinsubdirectory. Enter the command:</p> <p>$./startManagedWebLogic.sh dizzy1 http://host01.example.com:8001</p> <p>This runs the script to start the managed server nameddizzy1. Also notice the argument that gives the URL of the domain's administration server:http://host01.example.com:8001.</p> <p>Note: Use the host name and port of the administration server of your domain.</p> <p>When prompted for ausernameandpasswordenter the credentials of the domain administrator.</p> <p>4.</p> <p>After the servers are up and running, access the WebLogic Server administration console. Open a web browser and enter the URL of the domain's administration console:http://hostname:port/console</p> <p>In this tutorial, that is:http://host01.example.com:8001/console</p> <p>Note: Use the host name and port of the administration server of your domain.</p> <p>On the Welcome screen, log in using theUsernameandPasswordentered to start the servers.</p> <p>5.</p> <p>Deploying an application is a change to the domain's configuration, so it must first be locked. In the Change Center, click theLock &amp; Editbutton.</p> <p>6.</p> <p>Under Domain Structure, clickDeployments.</p> <p>7.</p> <p>On the right, under Deployments, click theInstallbutton.</p> <p>8.</p> <p>Find theCurrent Locationfield. Use the links to browse to the location in which you placed the downloadedbenefits.warfile. There you will seebenefits.warwith a radio button next to it. Select that radio button. By using the links and the radio button, the console fills in thePathfield for you.</p> <p>Alternatively, you can type in the path and file name in thePathfield yourself.</p> <p>Then clickNext.</p> <p>9.</p> <p>On the next screen, ensure thatInstall this deployment as an applicationis selected.</p> <p>Then clickNext.</p> <p>10.</p> <p>On the next screen, selectdizzy1.</p> <p>Then clickNext.</p> <p>11.</p> <p>On the next screen, keep all the default values and clickNext.</p> <p>12.</p> <p>On the next screen, selectNo, I will review the configuration later.Then clickFinish.</p> <p>13.</p> <p>Notice the messages that the deployment was installed, but changes must be activated. Also notice thebenefitsapplication listed in the Deployments table.</p> <p>14.</p> <p>In the Change Center click theActivate Changesbutton.</p> <p>15.</p> <p>Notice the message that the changes have been activated. Also notice thebenefitsapplication listed in the Deployments table is now in the "Prepared" state.</p> <p>16.</p> <p>Select the check box to the left of thebenefitsapplication in the Deployments table. Then use theStartdrop-down list to selectServicing all requests.</p> <p>17.</p> <p>ClickYesto continue.</p> <p>18.</p> <p>A message is displayed indicating a start request was sent. Momentarily you will see the State of the benefits application become "Active." This means that the application is available to those that have access to the server.</p> <p>Testing the Application</p> <p>To test the newly deployed web application, perform the following steps:</p> <p>1.</p> <p>In another web browser, enter the host and port for the dizzy1 managed server, followed by/benefits.</p> <p>In this tutorial, the URL entered is:http://host01.example.com:8003/benefits</p> <p>2.</p> <p>Select one or more of the check boxes and click theGet Informationbutton.</p> <p>3.</p> <p>Then click theBack To Home Pagelink.</p> <p>Updating the Application</p> <p>To update the deployed web application with a new version, perform the following steps:</p> <p>1.</p> <p>Download an updated version of the web application, thebenefits2.warfile. The web application's deployment descriptors have been modified to use a different context root (path) to access the application.</p> <p>After it has been downloaded, renamebenefits2.wartobenefits.war. Replace the currentbenefits.warfile with this new one.</p> <p>2.</p> <p>Return to the Deployments page of the administration console.</p> <p>If needed, in the Change Center, click theLock &amp; Editbutton.</p> <p>Select the check box to the left of thebenefitsapplication in the Deployments table.</p> <p>Then click theUpdatebutton.</p> <p>3.</p> <p>On the next screen, click theFinishbutton.</p> <p>4.</p> <p>In the Change Center click theActivate Changesbutton.</p> <p>5.</p> <p>In another web browser, enter the host and port for the dizzy1 managed server (do not put/benefitson the end of the URL).</p> <p>In this tutorial, the URL entered is:http://host01.example.com:8003</p> <p>The new version of the benefits application has the context root of/rather than the context root ofbenefits, as the previous version had. In other words, the benefits application is now the default application of the dizzy1 server.</p> <p>Undeploying the Application</p> <p>Undeploying an application means stopping it, and then removing it from the configuration of the server(s) on which it was deployed. The application archive file itself does not need to be removed.</p> <p>To undeploy the web application, perform the following steps:</p> <p>1.</p> <p>Return to the Deployments page of the administration console.</p> <p>Select the check box to the left of thebenefitsapplication in the Deployments table. Then use theStopdrop-down list to selectForce Stop Now.</p> <p>2.</p> <p>ClickYesto continue.</p> <p>3.</p> <p>The benefits application has now been stopped and is no longer available. In a web browser when its URL is entered the server returns a404error.</p> <p>Note: The web browser may have cached pages. If the benefits application does appear, click the refresh button of the web browser.</p> <p>4.</p> <p>Return to the Deployments page of the administration console.</p> <p>If needed, in the Change Center, click theLock &amp; Editbutton.</p> <p>Select the check box to the left of thebenefitsapplication in the Deployments table.</p> <p>Then click theDeletebutton.</p> <p>5.</p> <p>ClickYesto continue.</p> <p>6.</p> <p>Messages will be displayed indicating the deployment was deleted, but the changes must be activated. In the Change Center click theActivate Changesbutton.</p> <p>The benefits application is no longer in the domain configuration. The archive file still exists, however, and the application could be deployed again.</p> <p>Summary</p> <p>In this tutorial, you learned how to:</p> <p> Deploy a Java Enterprise Edition web application to an instance of WebLogic Server by using the WebLogic Server administration console</p> <p> Start and stop a web application by using the administration console</p> <p> Update a web application to a new version by using the administration console</p> <p> Undeploy a web application by using the administration console</p> <p>Resources</p> <p> For documentation on Oracle WebLogic Server 12c, visit theDocumentation Library.</p> <p> For more information on deployment, see theDeploying Applicationsdocument.</p> <p> To learn more about Oracle WebLogic Server, refer to additional OBEs in theOLLwebsite.</p> <p>Credits</p> <p> Lead Curriculum Developer:Bill Bell</p> <p> Original OBE Created By:TJ Palazzolo</p>

Recommended

View more >