Before You Begin
In this 15-minute tutorial, you will learn how to use the Oracle WebLogic Server Administration Console to deploy a Java Enterprise Edition web application.
Background
This tutorial is part of the Oracle WebLogic Server 12c series, and assumes that you have completed these tutorials, in this order:
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
.
This tutorial shows how to use the Oracle WebLogic Server Administration Console to deploy a simple Java Enterprise Edition web application. With this tutorial, you can start and run the application, redeploy an updated version, and then, undeploy the application.
What Do You Need?
- An installation of Oracle WebLogic Server 12c. See Oracle Fusion Middleware Software Downloads .
- A properly configured WebLogic Server domain containing an
Administration Server and one Managed Server with the
following settings:
- Domain directory:
/u01/domains/ExampleDomain
with Managed Server,server1
- Administration Server listen address and port number:
localhost:7001
- Managed Server,
server1
, listen address and port number:localhost:7003
- Domain directory:
- An example application which can be downloaded here
and extracted to the folder where WebLogic Server domain and
servers are located. This archive contains two directories:
- The
benefits.war
which contains a sample Java web application archive to deploy. - The
benefits2.war
which contains an upgraded version of the sample Java web application archive to deploy.
- The
Conventions
This tutorial uses the following conventions:
Variable | Value |
---|---|
DOMAIN_HOME Environment variable | /u01/domains/ExampleDomain |
ORACLE_HOME | /u01/app/fmw |
Deploy
and Start an Application
To deploy a Java web application and start it using the WebLogic Server Administration Console:
- If the Administration Server of the domain is not already
running, start it. In a terminal window, navigate to the
domain directory, and enter the command:
$ cd
$DOMAIN_HOME
/ $ ./startWebLogic.shAt the prompt, enter the Administrator user name and password that you specified when you created the domain. password enter the credentials of the domain administrator.
- After the Administration Server is running, start the
Managed Server,
server1
. In another terminal window, navigate to theDOMAIN_HOME/bin
directory and enter the command:$ ./startManagedWebLogic.sh server1 http://localhost:7001
Optionally, specify the host name and port of your domain's Administration Server in place of
localhost:7001
. - On the Welcome screen, enter the user name and password
that you specified when you created the domain, and then click
Login.
The home page of the Administration Console appears.
- In the Administration Console Change Center,
click Lock & Edit.
Deploying an application is a change to the domain's configuration, so you must first lock it.
- Under Domain Structure, click Deployments.
The Summary of Deployments page appears on the right. This page displays the list of Java EE applications and standalone application modules installed to the current domain.
- Select Configuration, and then click Install.
- Use the hyperlinks next to the Current Location
field to navigate to the directory in your example application
folder, and then select
benefits.war
.Alternatively, you can type in the path and file name in the Path field.
Description of the illustration [t106-currentloc.png] - Click Next.
The Choose installation type and scope page appears.
- Select Install this deployment as an application,
and then click Next.
The Select deployments targets page appears.
- Select
server1
, and then click Next. - Retain all the default values and click Next.
The Review your choices and click Finish page appears.
- Select No, I will review the configuration later,
and then click Finish.
A message about the successful deployment appears. You must, however, activate and commit the pending changes. You can also see the
benefits
application listed in the Deployments table.Description of the illustration [t111-needsactivation.png] - In the Change Center, click Activate
Changes.
A message that the changes have been activated appears. Note that the state of the
benefits
application listed in the Deployments table changes to Prepared. - Under Summary of Deployments, select Control.
- In the Deployments table, select the
benefits
application. - Click the Start drop-down list, and then
select Servicing all requests.
Description of the illustration [t114-start.png] - Click Yes to continue.
A message indicating that a start request has been sent appears. In a few moments, you will see that the State of the
benefits
application changes to Active. This means that the application is available to those that have access to the server.
Test
the Application
To verify the Java web application deployment:
- In a web browser, enter the host and port for the managed
server,
server1
, followed by/benefits
.http://hostname:7003/benefits
Description of the illustration [t200-benefits.png] - Select one or more of the check boxes and click Get Information.
Update
the Application
To update a web application to a new version by using the WebLogic Server Administration Console:
- Download an updated version of the web application, the
benefits2.war
file. The web application's deployment descriptors have been modified to use a different context root (path) to access the application. - After downloading, rename
benefits2.war
tobenefits.war
. Replace the currentbenefits.war
file with this new one. - Go back to the WebLogic Server Administration Console. In
the Change Center, click Lock & Edit.
The Summary of Deployments page appears. A table that lists all the Java EE applications and standalone application modules currently installed on WebLogic Server appears in the right pane.
- Select the check box to the left of the benefits
and click Update.
Description of the illustration [t113-prepared.png] - From the Update Application Assistant window, click Change Path associated with the Deployment plan path.
- On the next screen, click Finish.
Description of the illustration [t113-prepared.png] - In the Change Center click the Activate Changes button.
- In a web browser, enter the host and port for the managed
server,
server1
(do not put/benefits
on the end of the URL).http://hostname:7003
The new version of the benefits application has the context root of / rather than the context root of benefits, as the previous version had. In other words, the benefits application is now the default application of the Managed Server,
server1.
Undeploy
the Application
To stop an application and then remove it from the configuration of the server(s) on which it was deployed:
- Return to the Deployments page of the administration
console.
Select the check box to the left of the benefits application in the Deployments table. Then use the Stop drop-down list to select Force Stop Now.
Description of the illustration [t400-forcestop.png] - Click Yes to continue.
- The benefits application has now been stopped and is no
longer available. In a web browser when its URL is
entered the server returns a
404
error.Note: The web browser may have cached pages. If the benefits application does appear, click the refresh button of the web browser.
Description of the illustration [t402-error.png] In the Change Center, click the Lock & Edit button.
Select the check box to the left of the benefits application in the Deployments table.
Then click the Delete button.
- Click Yes to continue.
- Messages will be displayed indicating the deployment was
deleted, but the changes must be activated. In the Change
Center, click the Activate Changes button.
The benefits application is no longer in the domain configuration. The archive file still exists, however, and the application could be deployed again.
Next
Steps
The WebLogic Server 12c collection contains a number of additional tutorials, covering a variety of topics. See the WebLogic Server 12c collection here for additional topics and content.