This laboratory exercise is intended to help you becomefamiliar with running the application server. It will cover startingup and shutting down the server, setting some of the configuration options, and deploying static HTML web pages into the server.
Level of Difficulty: 1 (easy)
Estimated time: 45 minutes
Pre-requisites:
You will be running WebLogic Server on a Linux workstation.The WebLogic software is installed centrally on file server, andis NFS mounted across all workstations, so everybody will run thesame version of the software.
In addition to the central installation of the software, everyperson will have their own private WebLogic "domain".Each person will start up their own copy of the WebLogic software,and load their domain. Your WebLogic domain configuration willbe stored in a subdirectory off your home directory.
There are three parts to using WebLogic:
This lab exercise is designed to help you become familiar with thefirst two.
To do this exercise you can either start a terminal window and navigate/edit the relevant file, or the better way is to use your desktop Home icon (this opens a file explorer, and you can simply click on the relevant directory and file).
Record your answers to the following questions.
config.xml
installed?setDomainEnv.sh
'.Have a look at the contents of this file and see what it does.This script is automatically sourced by startWebLogic.sh to configureyour environment. You do not need to execute setDomainEnv.sh directly.java -version
)startWebLogic.sh
' located in?IMPORTANT:
Make sure you only run 1 copy of weblogic at a time on the workstation.
This includes the test weblogic server running within Eclipse
Ensure that if this is the case, you should stop the weblogic server within eclipse first!
If another user has logged out without shutting down their weblogic server,you may need to reboot the computer.
The easiest way to start your server is to click on the green arrow key in the servers window at the bottom of your Eclipse workspace i.e.
:
.
Note that if you need to start Weblogic manually, you can run the startWebLogic.sh script at a linux terminal.
http://localhost:7001/console/
Note: If you are accessing this workstation from another machine, change localhost to the name of the workstation
Enter 'weblogic
' for the userid and 'weblogic!
for the passwordto logon to the WebLogic console.
Once you logon to the WebLogic console, you will see that there are various options to change and view.
When we installed weblogic, we named the domain "weblogic" (the original default was called "base domain"!). A Weblogic domain is a set of 1 or more servers for running your applications. We can manage the entire domain by selecting the Weblogic link in the Domain Structure menu.
By default, weblogic generates a single server called adminServer . In a production environment, you would have more than one server, but for development, we will get this administration server to also act as our default web application server.
You can control the servers by selecting the Servers link.
When you do this, you will see the AdminServer listed.
Choose the [CONTROL] tab.
If you select the tickbox next to adminServer, you can activate the start, resume, suspend, shutdown options.
Shutting down the server: Note that if you just press Shutdown, WebLogic will wait until all requests are serviced. If your program (JSP/Servlet etc) is in a loop, you can click on the pull down and select Force Shutdown Now
ENVIRONMENT:
Don't worry about these options, this is used for clustering and production environments
DEPLOYMENTS:
You will see that this lists all J2EE applications and shared libraries installed ("deployed") on your server. Some relevant tabs to look at:
[Control tab] You can individually (or globally) start or stop the applications.
If you have [Lock & Edit] the configuration, you can also install new apps, update and delete existing apps. If you select any app, you will see it's[settings].
This has details like name, context root, path (if you generated this from eclipse, it will be something like /home/chw/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/weblogic/_auto_generated_ear_ !!
[Testing] tab is particularly handy to see what the full URL of the application is and any welcome files in the web application.
[Monitoring] is good to see how many active servlets are being used (note: each JSP is also considered
to be a servlet)
[Monitoring[Servlets]] is good for seeing the servlets available.
FileServlet, JSPServlet & WebServiceServlet are automatically generated ones from weblogic.
[Monitoring [Sessions]] will track HTTP sessions being used.
SERVICES:
this section covers the J2EE services that the container must provide eg: JDBC, JMS etc
When using Database access, you need to define your JDBC details here.
SECURITY REALMS:
You can define a security realm to protect your web application. The default realm is 'myrealm' but you can create many more.Within this tab is [Configuration] & [Users and Groups] where you can define users and groups.
Be careful at this point! Don't change anything you don't understand!
We need to change a default console parameter to prevent administration console locks occurring during our development cycle.
Open up your weblogic console.
Click [Save] to save this setting.
Click [Release Configuration] at the top left menu to release the administration lock on your weblogic.