Professional Documents
Culture Documents
Activity Guide
D83175GC10
Edition 1.0
January 2014
D85190
Disclaimer
This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way.
Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.
The information contained in this document is subject to change without notice. If you find any problems in the document, please
report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.
Restricted Rights Notice
If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United
States Government, the following notice is applicable:
U.S. GOVERNMENT RIGHTS
The U.S. Governments rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted
by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.
Trademark Notice
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective
owners.
Author
Bill Bell
Technical Contributors and Reviewers
Jose Alvarez, Maria Billings, Mark Lindros, Takyiu Liu, Will Lyons, Serge Moiseev,
TJ Palazzolo, Madhavi Siddireddy, Matthew Slingsby, Kevin Tate
Editors
Raj Kumar, Anwesha Ray
Graphic Designer
Rajiv Chandrabhanu
Publishers
Nita Brozowski,Sujatha Nagendra, Michael Sebastian
This book was published using:
Oracle Tutor
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Table of Contents
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 1
Chapter 1 - Page 1
Practices Overview
There are no practices for this lesson.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 2
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In these practices, you access your practice environment and run some scripts to set up the
WebLogic Server domain. There is also an optional practice to run the Oracle Remote
Diagnostic Agent.
The practice environment consists of your main computer, which is referred to as the gateway
machine, and two Linux hosts, known as host01 and host02. You access the Linux hosts
from the gateway machine by using VNC Viewer.
Here is a diagram of the setup, and what will be running on each host:
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Overview
In this practice you access your practice environment for the first time. You also run some
scripts to set up the WebLogic Server domain. Finally, you use the administration console to
investigate the domain.
Here is a diagram of the domain the scripts create:
Assumptions
You are sitting at your classroom machine or have been assigned a remote machine.
Tasks
1.
Access host01.
a. From your gateway machine, double-click the VNC Viewer - host01 icon on the
desktop. You connect to host01 as the oracle user. The Username field is not
displayed. Enter oracle in the Password field (it is displayed as ******) and press
the Enter key.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2.
Unless stated otherwise, you will be working within the VNC session of host01 for the
remainder of this practice.
Run the scripts to set up your domain.
a. Open a Terminal window.
Note: There is a launcher for a Terminal window in the panel at the top of the desktop.
b.
Navigate to /practices/tshoot/practice02-01.
$> cd /practices/tshoot/practice02-01
Note:
The files you need for all the practices are found under /practices/tshoot.
c.
Remember that you can use the Tab key to auto-complete directory and file names
as you type them
Run the main script, setup.sh, which calls the other scripts that set up the WebLogic
Server domain.
$> ./setup.sh
Important Note: These scripts will take a few minutes to complete. As they run they will
print informational messages to the Terminal window. Dont worry if there is sometimes a
pause in the messages. Be patient and let all the scripts run. The command prompt will
return when all the scripts have completed their work.
These are the scripts that are called:
1-createdomain.sh: This script calls the WLST script create_domain.py,
which creates a domain called wlsadmin in the directory /u01/domains/tshoot.
The WLST script configures the domain with an administration server running on
host01.example.com on port 7001. It also defines a cluster named cluster1,
which includes two managed servers: server1 running on host01.example.com
on port 7011, and server2 running on host02.example.com, also on port
7011.
2-packdomain.sh: This script runs the pack utility to create a managed server
template based on the new domain. The template file is named wlsadmin.jar and
placed in the /tmp directory.
3-copydomain.sh: This script uses secure copy to copy the template file over to
host02. It then uses secure shell to call the unpack script on host02.
4-unpackdomain.sh: This script runs on host02 and calls the unpack utility to
create a copy of the domain on this host.
5-startnodemanagers.sh: This script first calls the Node Manager start script
on host01, and then uses secure shell to call the Node Manager start script on
host02.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
3.
b.
4.
startnodemanager.sh: This script calls the script to start the Node Manager on a
machine, if it is not already running.
If you want to look at these scripts, you can open them by using the gedit editor. If
you do this, please ensure you close the editor without making any changes to the
scripts. For example, if you want to look at the script that starts the admin server:
$> gedit startadmin.sh
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e.
f.
g.
h.
i.
j.
k.
On the welcome page, enter the Username of weblogic and the Password of
Welcome1. Then click the Login button.
Note: You can have Firefox remember the password if you want to.
In the Domain Structure, expand Environment and select Servers.
Click the Control tab.
Select the check boxes next to server1 and server2. Then click the Start button.
When asked whether you are sure, click Yes.
Wait a moment, and refresh the browser. Wait until both managed servers have the
state of RUNNING.
Use the administration console to view the servers, machines, and clusters defined in
the domain. Answer the following questions:
What ports are the servers running on?
Which servers are on which machines?
What address and port does each Node Manager run on?
Hint: Remember that a Node Manager configuration is under a machines
configuration.
What messaging mode does the cluster use?
Log out of the administration console.
Close the web browser.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Overview
In this practice, you run the Oracle Remote Diagnostic Agent. You then view some of its output.
This practice can be performed at any time during the course, whenever you have extra time.
Assumptions
You completed Practice 2-1: Accessing and Setting Up the Practice Environment and the
domain has been successfully created.
All instances of WebLogic Server are running.
Tasks
1.
2.
Access host01.
a. From your gateway machine, double-click the VNC Viewer - host01 icon on the
desktop. You connect to host01 as the oracle user. The Username field is not
displayed. Enter oracle in the Password field (it is displayed as ******) and press
the Enter key.
Run the RDA utility to create a configuration file.
a. Open a Terminal window, and run the domains script to set up environment variables.
$> /u01/domains/tshoot/wlsadmin/bin/setDomainEnv.sh
b.
c.
Run RDA with the WebLogic Server profile to set up your configuration file.
$> ./rda.sh Sp WebLogicServer
-------------------------------------------S00INI: Initializes the Data Collection
-------------------------------------------RDA uses the output file prefix...
...
Note: As RDA asks questions or gives commands, you type your response and press
the Enter key. To accept the default, just press the Enter key. See the table in the next
step for the proper responses.
d. Use this table to answer the RDA questions and commands:
Step
Question / Command
Response
a.
b.
/home/oracle/rda_output
c.
(press Enter)
d.
/u01/app/fmw
e.
example.com
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Question / Command
Response
server.
f.
(press Enter)
g.
/u01/domains/tshoot
h.
i.
j.
k.
weblogic
l.
(press Enter)
m.
n.
(press Enter)
e.
3.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Step
4.
Note: Notice the main index at the top left. The overview links are currently at the bottom
left. The main overview is in the display area. Ignore any messages in the Terminal
window.
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
The top part of the index has links that show the machines configuration.
d.
The part under Oracle WebLogic Server has links for WebLogic Server data.
Note:
The Oracle WebLogic Server Overview link has installation information such as the
version and patches applied.
The Domain link has links to domain scripts and configuration files.
The individual server links contain server information including log files, deployed
application deployment descriptors, diagnostic images, and thread dumps.
e. Select the link in the main index called server1 Server. Click some links in the
server1 Server frame (below the Main Index). Try some such as:
5.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Warning: This command permanently deletes a directory, all its subdirectories, and files.
Use with caution.
d. Close the Terminal window.
e. Exit the VNC Viewer.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 3
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In these practices you set up WebLogic Diagnostic Framework harvesters, watches, and
notifications. You also use the Monitoring Dashboard to view diagnostic information as charts
and graphs.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
Users have reported intermittent database problems with the contacts application. Before you
speak to the development team, you decide to gather some data. The WebLogic Server
Diagnostics Framework (WLDF) allows you to collect and record server and application metrics
over time for later analysis. WLDF also supports watch conditions that can trigger notifications,
such as posting a JMS message or capturing a diagnostic image.
Overview
In this practice you configure some archive policies. You also create a new system-level WLDF
diagnostic module. In that module you configure metric collectors (harvesters) for several
MBean types, trigger notifications under various MBean watch conditions, and access
diagnostic archives to inspect recorded metrics.
Assumptions
You completed Practice 2-1: Accessing and Setting Up the Practice Environment and the
domain has been successfully created.
All instances of WebLogic Server are running.
Tasks
1.
2.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Open a Terminal window, navigate to the current practice directory and run the setup
script, setup.sh.
$> cd /practices/tshoot/practice03-01
$> ./setup.sh
3.
4.
On the console welcome page, enter the Username as weblogic and Password as
Welcome1. Then click the Login button.
Note: You access the administration console from the gateway machine web browser
many times in these practices. Rather than give specific directions each time, in this
and subsequent practices, it will be assumed you know what to do when you are
instructed to use (or access) the administration console.
Check the type and location of the WLDF diagnostic archives. Set the maximum size of a
servers archive file. Set a servers archive retirement policy.
a. In the Domain Structure, expand Diagnostics (click the + sign) and then select
Archives.
Note: In this and subsequent practices, the instructions for accessing something in the
Domain Structure will be abbreviated. For this case, the abbreviation is: In the Domain
Structure, select Diagnostics > Archives.
b. Notice the type of archive and their location for each server. The default archive type is
a file store archive.
c. Select server1 in the table. Under the Configuration tab, you can see that the Type of
archive is a File Store.
Note: The other type of archive is a database archive. In the admin console a
database archive displays its type as JDBC.
d.
You want to make a change to the configuration, so lock it. In the Change Center, click
the Lock & Edit button.
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
To save disk space, you decide to limit the size of this servers archive file to 50
megabytes. Set the Preferred Store Size to 50.
f.
g.
h.
i.
j.
Step
5.
Field
Choice or Value
a.
Name
retirement-policy-1
b.
Archive Name
HarvestedDataArchive
c.
Retirement Age
48
d.
Retirement Time
e.
Retirement Period
f.
Enabled
Selected
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e.
Access host01. Use the File Browser on host01 to navigate to the location where the
image was saved:
/u01/domains/tshoot/wlsadmin/servers/server1/logs/
diagnostic_images.
Tip: The File Browser can be found in the panel under Applications > System
Tools. Once it opens, click File System under the Places panel to start your
navigation.
f.
In the File Browser, right-click the .zip file (its name starts with
diagnostic_image_). Select Open with Archive Mounter. Then in the Places
panel of the File Browser (on the left), select the drive that has the same name as the
zip file.
Note: The information stored in the diagnostic image zip file is saved in various XML
files. Most have the extension of .img.
g.
Look at the contents of the image.summary file. Right-click it and select Open with
gedit.
Note: If not given that choice in the pop-up menu, select Open with Other
Application. Then select gedit and click the Open button.
In this file, can you find the operating system and version? Can you find under which
JVM WebLogic Server is running?
Tips: Use the Search > Find menu option to search for os.name and os.version.
Then search for java.vendor and java.version.
h.
i.
6.
Return to the File Browser and open the JDBC.img file with gedit to look at its
contents.
Note: Notice the information about the data source called datasource1.
j. Close the editor when you are finished.
k. In the File Browser, right-click the drive that represents the zip file. Select Unmount.
l. Close the File Browser.
m. Minimize the VNC Viewer to use later.
Create a new diagnostic system module.
Note: To create harvesters (metric collectors), watches, and notifications, you first create a
diagnostic module to contain them.
a. Return to the administration console and lock the configuration.
b. In the Domain Structure, select Diagnostics > Diagnostic Module.
c. Click the New button.
d. Give the module the Name server1-diagnostics. Then click OK.
e.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e.
c.
d.
e.
Note: Because this diagnostic module is targeted to a managed server, only the Server
Runtime MBeans apply.
Ensure that Select an MBean Type from the following list is selected. From the
drop-down list, select the weblogic.management.runtime.
JDBCConnectionPoolRuntimeMBean. Click Next.
f.
8.
Move the following attributes from the Available column to the Chosen column:
ActiveConnectionsCurrentCount (the number of connections currently in use by
applications)
CurrCapacity (the current count of JDBC connections in the connection pool in the
data source)
LeakedConnectionCount (the number of leaked connections)
Note: A leaked connection is a connection that was reserved from the data source but
was not returned to the data source.
g. Click Next.
h. Note the available values for Collected Instances, but make no selection.
Note: If you do not identify specific MBean instances, WLDF collects the selected
attributes from all available instances.
i. Click Finish.
j. Do not activate changes yet.
Create a diagnostic notification.
a. Click the Configuration > Watches and Notifications tabs of the diagnostic module.
b. Scroll down and click the Notifications tab.
c. Click the New button.
d. For the Type field, select the JMS Message option. Click Next
e.
f.
Field
Choice or Value
a.
wldfnotificationqueue
b.
Connection Factory
weblogic.jms.XAConnectionFactory
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
7.
9.
Field
JNDI Name
Choice or Value
e.
Ensure that Select an MBean Type from the following list is selected. From the
drop-down list, select the same weblogic.management.runtime.
JDBCConnectionPoolRuntimeMBean that is being collected and click Next.
f.
g.
h.
i.
Field
Value
a.
b.
Operator
>
c.
Value
Click Next.
Select the Use a Manual Reset Alarm option and click Next.
j.
Move the jms-notification option from the Available column to the Chosen
column.
k. Click Finish.
l. Activate the changes.
m. Minimize the web browser. You will be using the admin console later.
10. Trigger WLDF notifications.
a. Return to the VNC Viewer for host01. Open a Terminal window and navigate to the
current practice directory. Run the script that runs a client that accesses the database,
runclient.sh. The client will ask you to press Enter when you want to stop it. Do
not do that yet.
$> cd /practices/tshoot/practice03-01
$> ./runclient.sh
...
This client is still running...
When you are ready to stop it, press Enter.
Note: This runs a stand-alone Java class that opens connections to the database but
does not close them. Wait a minute before proceeding to the next step.
b. Do not close the Terminal window.
c. Minimize the VNC Viewer.
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Step
c.
d.
e.
f.
g.
h.
i.
j.
k.
l.
m. Click Apply.
n. Browse the harvester entries. You may need to scroll through a few pages to get to the
JDBC connection pool metrics after the client was running. Verify that the MBean
attributes are being collected approximately every 10 seconds.
12. Stop the database client.
a. Return to the VNC Viewer for host01.
b. Find the Terminal window where the database client is running. Press Enter.
c. Close the Terminal window.
d. Exit the VNC Viewer.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
11. View the notification and collected metrics by using the admin console.
a. Access the admin console. In the Domain Structure select Services > Messaging >
JMS Modules.
b. Select the module called jmsmodule1.
Perform the following tasks if you did not do this practice and want to use the finished solution.
Assumptions
You completed Practice 2-1: Accessing and Setting Up the Practice Environment and the
domain has been successfully created.
All instances of WebLogic Server are running.
Solution Tasks
1.
Access host02 by using the VNC Viewer on the gateway machine. Run the database setup
script.
a. Open a Terminal window, navigate to the current practice directory and run the
database setup script, initdatabase.sh.
$> cd /practices/tshoot/practice03-01
$> ./initdatabase.sh
2.
Access host01 by using the VNC Viewer on the gateway machine. Run the solution script.
a. Open a Terminal window, navigate to the current practice directory and run the solution
script, solution.sh.
$> cd /practices/tshoot/practice03-01
$> ./solution.sh
Note:
This script creates the WLDF system module with its harvester, watch, and
notification. These elements of the WLDF module are not enabled. You could
enable them manually by using the administration console.
Ignore any messages that state No stack trace available. The script checks for the
existence of a resource by trying to access the resource and catching an exception
when it does not exist. When there is no Java stack trace and there is also an
exception, then this message prints out.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Overview
In this practice you access the Monitoring Dashboard to view harvested metric data.
Assumptions
You completed Practice 3-1: Harvesting Diagnostic Metrics (or have run the solution).
All instances of WebLogic Server are running.
Tasks
1.
e.
Select New View. Type over the default name of the new view with: Harvested
Diagnostics.
f.
g.
h.
i.
Ensure the new view is selected and click the Metric Browser tab.
In the Servers drop-down list, select server1.
Select Collected Metrics Only, and click the Go button.
In the Types list of available MBeans on this server, locate and select
JDBCConnectionPool.
Under Instances, select datasource1.
Under Metrics, drag the three metrics onto the right panel. As the first one is dragged
in, a new chart is created. Drag the other two onto the same chart.
Change the charts default name by clicking the menu down-arrow in the chart title bar.
Select Properties. Under Chart Title, enter JDBC Chart. Click OK.
j.
k.
l.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Make note of the date and time of the collected JDBC attributes. (You may need to
scroll to find the ones of interest after the client was running.)
Return to the Monitoring Dashboard.
At the top-right of the chart, click the down arrow for the menu again, and select
Properties.
Under Time Range select Custom and enter the Start Time. Use the correct
format. For example: In the log file if the Date field was "10/11/13 18:50:41
820" you would enter it here as: "10/11/2013 6:50:41 PM" (do not include
the double quotation marks).
Enter a Duration of 5 minutes: 0 00:05
n.
o.
p.
Click OK.
Look at the chart again. It should contain data points.
Close the Monitoring Dashboard.
Close the web browser.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
hour(s) (or whatever time interval seems best based on when you did the
previous practice). Set Number of rows displayed per page to 1000.Click Apply.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 4
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In these practices, you create and configure an application-scoped diagnostic module which
includes a monitor. You also configure instrumentation on the module to trace a client request.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
Users have reported intermittent database problems with the contacts application. You talk to a
developer who guesses the problem might be in connecting to the database. You decide to
gather some specific information about this application and how long it takes to make a
database connection. You use application-scoped instrumentation to be able to gather this
information.
Overview
In this practice, you configure an application-scoped diagnostic monitor. Application-scoped
monitors are part of application-scoped diagnostic modules, so you add a diagnostic module to
an application. You select a delegating monitor (it has predefined code locations, but you
choose the action to take). After the action has been triggered, you look at the data stored in the
event archive.
Assumptions
You completed practice 3-1: Harvesting Diagnostic Metrics.
All instances of WebLogic Server are running.
Tasks
1.
2.
In a Terminal window run the jar utility to add the WLDF descriptor file to the
contacts application.
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note:
Enter all commands on one line. Commands are sometimes displayed on more than
one line due to space limitations.
The jar utility option uf means to update the file specified.
d.
The file, contacts.war, is updated with the last parameter, the META-INF
directory.
Using the jar utility or the File Browser and Archive Mounter, inspect the
contacts.war file and confirm that the WLDF descriptor file was added to the WAR
files META-INF directory.
Tip: To use the jar utility, run the jar as before, but replace uf with tf (table of
contents for the file specified) and remove the META-INF at the end of the command.
$> /u01/app/jdk/bin/jar tf
/u01/domains/tshoot/wlsadmin/apps/contacts.war
e.
f.
g.
h.
3.
i. Click Finish.
j. Activate the changes.
Generate a deployment plan for updating the WLDF module in the application by using the
admin console.
a. In the Deployments table, click the name of the contacts application.
b.
c.
d.
e.
f.
g.
h.
i.
j.
k.
Click OK.
Return to the applications Configuration > Instrumentation tabs.
In the Included Classes text area enter:
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
$> cd /practices/tshoot/practice04-01
$> /u01/app/jdk/bin/jar uf
/u01/domains/tshoot/wlsadmin/apps/contacts.war
META-INF
4.
5.
Note: The class that gets the database connection is in the stcurr package.
l. Click Save.
m. Do not activate changes yet.
Configure the delegating monitor.
a. In the Diagnostic Monitors in this Module table, select the new monitor.
b. Under Actions, move the TraceElapsedTimeAction from the Available column to the
Chosen column.
Note: This action makes two event archive entries: one before and one after the
specified code location. It is only compatible with Around monitor types.
c. Click Save.
d. Activate all your changes.
e. Return to the contacts applications main configuration page and inspect the
Overview tab. Confirm that the Deployment Plan field now has a value.
Tip: Make note of the files name and location.
f. Minimize the admin console for later.
g. Return to host01. Use a Terminal window or the File Browser to find and inspect the
deployment plan file. The plan now has new variables, which will update the
weblogic-diagnostics.xml file. In the plan file, notice that there are now variables
that start with WLDFInstrumentationMonitor.
Note: If you view the deployment plan file by using the gedit editor, make sure you
do not make any changes to the file.
Deploy the latest version of the application, with the deployment plan.
a. Return to the admin console and lock the configuration.
b. In the Domain Structure, select Deployments.
c. Select the check box next to the contacts application, and click the Update button.
d.
e.
f.
g.
6.
Select Update this application in place with new deployment plan changes.
Ensure that the Deployment plan path (under this option) is correct.
Click Finish.
Activate the changes.
Ensure that the contacts applications state is Active.
c.
d.
e.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
stcurr.*
7.
Return to the admin console. From the Domain Structure panel, select Diagnostics >
Log Files.
g. Locate and select the EventsDataArchive log file for the server1 server. Click View.
Note:
If you dont see any rows in the table, click the Customize this table link. Change
the Time Interval to ensure you are going back far enough to see the events
created. Click Apply.
If after doing that, you still dont see any rows, return to the task to deploy the latest
version of the application and do it again.
h. Browse the generated events. Notice the Date column. For each Before and After
event (look in the Type column) you can see how long connecting to the database took
by comparing the times. (The number on the end is milliseconds.)
View request performance in the admin console.
Note: Because instrumentation is enabled, and the monitor is an Around type, you can
view request performance data by using the admin console.
a. In the Domain Structure, select Diagnostics > Request Performance.
b. For Servers select server1. For Interval select Last 5 mins (or a time that will
include running the application).
c. Click the Refresh button.
d. View the results. To see what is under a request, click the + next to one.
e.
To see the details of a request, click the string that identifies the request.
f.
Note: Above the details table are the WLDF context ID and the total elapsed time of
the request in milliseconds. The details include the class and method, the number of
times the method was called in the request, the total milliseconds of the calls, the
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
g.
average milliseconds of the calls, the application name, the application module, and
the method signature.
Close the admin console.
Perform the following tasks if you did not do this practice and want to use the finished solution.
Assumptions
You completed practice 3-1: Harvesting Diagnostic Metrics.
All instances of WebLogic Server are running.
Solution Tasks
1.
Access host01 by using the VNC Viewer on the gateway machine. Run the solution script.
a. Open a Terminal window, navigate to the practice directory and run the database setup
script, solution.sh.
$> cd /practices/tshoot/practice04-01
$> ./solution.sh
Note: This script:
Copies the new version of the application and its new deployment plan to the apps
directory under the domain.
Calls a WLST script to create a system-scoped diagnostic module (in case it does
not already exist).
Calls another WLST script to enable instrumentation in the module (and therefore
for the server to which it is targeted).
Calls another WLST script to deploy the application with its deployment plan.
(Ignore any messages about WLContext.close() being called in a different
thread.)
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
Users have reported intermittent database problems with the contacts application. After some
investigation, the problem seems to be JDBC related, but only for certain users. You want to be
able to trace a users request through JDBC operations. You also want to limit the diagnostic
events that are saved to a particular user by using their IP address.
Overview
When instrumentation is enabled on a diagnostic module, all WLDF events and log entries
associated with a particular client request will be tagged with a unique context ID. These IDs
allow administrators to trace all the diagnostic data for a specific request.
In some troubleshooting cases, you may wish to go a step further and limit the conditions under
which WLDF events are recorded. A diagnostic context ID supports various flags or dyes that
allow you to filter the types of requests that trigger instrumentation data.
You also enable some debug flags on the server so there is more detailed information saved in
the logs.
Assumptions
You completed practice 4-1: Configuring and Monitoring Diagnostic Events.
All instances of WebLogic Server are running.
Tasks
1.
f.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
c.
d.
e.
f.
3.
c.
d.
e.
f.
Tip: You might want to change the order of the columns so the Context ID is first or
second. In the Chosen column, select it and move it with the arrows.
Browse the recent log entries. Notice that some entries have been assigned context
IDs while others have not. The latter are internal messages not associated with a client
request.
Click Customize this table again.
For WLDF Query Expression, enter the following (where nnnnn is the last five
characters of the context ID that you wrote down).
CONTEXTID LIKE '%nnnnn'
Click Apply.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
2.
g.
4.
Browse the log entries. Notice that you can trace a particular request through
extremely detailed JDBC operations, thanks to the context ID and the debug
messages.
h. Minimize the admin console to use later.
Configure dye injection monitoring based on a dye filter, which is a particular IP address.
Note: You will pretend that the user having trouble is accessing the contacts application
from the web browser on host01.
a. Find out the IP address of host01. Access host01. Open a Terminal window and enter
the command ifconfig. Make note of the address.
$> ifconfig
eth0
Link encap:Ethernet HWaddr 00:16:3E:01:01:00
inet addr:192.0.2.11 Bcast:192.0.2.255 ...
b.
c.
d.
Note: Look for the inet addr in the second line of the eth0 print out. Your IP
address may be different.
Close the Terminal window. Minimize the VNC Viewer to use later.
Return to the admin console. Lock the configuration.
Locate and edit the system diagnostic module, server1-diagnostics.
e.
f.
g.
In the table, select the dye injection monitor name to edit it. Ensure Enabled is
selected. In the Properties text area enter:
ADDR1=host01_ip_address
Note: For example, if the host01 IP address is 192.0.2.11, you enter:
ADDR1=192.0.2.11
h.
i.
j.
k.
l.
m.
Click Save.
Activate your changes.
Lock the configuration again.
Locate and edit the contacts application (deployment).
Click Configuration > Instrumentation.
Select the monitor JDBC_Around_GetConnection.
n.
o.
p.
q.
Click Save.
Return to the Deployments table.
Tip: You can use the breadcrumbs and select Summary of Deployments.
Select the check box next to contacts. Click Update.
Select Update this application in place with new deployment plan changes.
Click Finish.
Activate the changes.
Note: Now the application has been updated with a new version of its diagnostic
module, updated through its deployment plan.
r.
s.
t.
u.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Tip: If you do not see any entries, click Customize this table again and change Time
Interval to Last 15 minute(s) (or longer).
5.
6.
Do not close the admin console. Use the File menu of Firefox to open a New Tab or
New Window.
Test event filtering.
a. Retest the contacts application as before, by entering the application URL
(http://host01.example.com:7011/contacts) in the new tab or window of the
Firefox web browser of the gateway machine. Edit a couple of contacts.
b. Return to the admin console and once again view the EventsDataArchive for server1.
c. Click Customize this table and ensure that the Time Interval is long enough to
include the last testing you just did, but not so long as to include the previous testing.
d. You should not see any rows in the Events Log Entries table. That is because the IP
address of this browser does not match the dye filter IP address.
e. Keep the admin console available.
f. Close the window or tab of the Firefox browser accessing the contacts application.
g. Access host01.
h. Click the Firefox icon in the panel on host01.
i. Use this web browser to access the contacts application and edit a few contacts.
j. Close the web browser. Exit the VNC Viewer.
k. Return to the admin console and again view the EventsDataArchive for server1.
l. Click Customize this table and ensure that the Time Interval includes the very latest
testing.
m. Now there are rows in the Events Log Entries table, because the IP address of the
host01 browser matches the dye filter IP address.
Edit the server1-dianostics module and disable the instrumentation component.
a.
b.
c.
7.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
v.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 5
Chapter 5 - Page 1
Practices Overview
In this practice, you use JVisualVM and Java Mission Control.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
Users have reported that the new benefits application is running slowly. You investigate
WebLogic Servers use of the JVMs memory as well as CPU usage while the new application is
being accessed.
Overview
In this practice, you troubleshoot a HotSpot JVM by using Java Visual VM (JVisualVM) and
Java Mission Control.
Assumptions
You completed practice 4-1: Configuring and Monitoring Diagnostic Events.
All instances of WebLogic Server are running.
Tasks
1.
2.
3.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
c.
Note: If an informational window is displayed about calibration, click OK. Then click
OK again.
When the graphical user interface comes up, under the Applications tab, expand
Local (if it is not already expanded). Find the WebLogic JVM that matches the PID of
server1 which you discovered earlier. Double-click this JVM.
Note: The pid values and other processes in the list may not match this screenshot
exactly.
On the right side, there is now a WebLogic tab. It starts out displaying the Overview
subtab. Click the Monitor subtab.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
$> cd /u01/app/jdk/bin
$> ./jvisualvm
4.
5.
Leave JVisualVM running. You can minimize it, if you want. Also, do not close the
Terminal window that started JVisualVM, because this will exit the program.
Run a Grinder script to simulate users accessing the new benefits application.
a. In a new Terminal window, from the current practice directory, run the script to call the
Grinder.
$> cd /practices/tshoot/practice05-01
$> ./rungrinder.sh
b. Do not close this Terminal window. You can minimize it, if you want.
Return to JVisualVM tool. View how the CPU and memory usage are affected by the
Grinder script. Use the tool to help figure out what is causing these effects.
a. Return to JVisualVM on the same screen as before: the server1 WebLogic JVM, and
the Monitor tab.
b.
c.
Note: Notice the CPU usage spikes and the memory usage goes up dramatically.
Use JVisualVM to look into the CPU issue. Click the Sampler tab. Then click the CPU
button. Watch for a little while. Are there any methods in the application using a lot of
CPU?
Note: The results may not be exactly the same for you as shown, but the service()
method of BenefitsServlet is probably using a large percentage of the CPU. You
have not looked at the code of the benefits application, but based on the name of this
Servlet, the odds are that it is part of the benefits application.
Click the Stop button.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
6.
See if you can determine what is taking so much memory. Click the Memory button
under the Sampler tab. Watch for a little while.
Note: There are always many char arrays and String instances around. But it
seems in this case a Byte array is taking a large percentage of the memory.
e. Click the Stop button again.
f. Close JVisualVM.
Tip: You can exit the tool by using File > Exit in the menu.
Stop the Grinder script.
a. In a new Terminal window, navigate to the current practice directory and run a script to
kill the Grinder processes.
$> cd /practices/tshoot/practice05-01
$> ./killgrinder.sh
b.
7.
Verify it worked by looking at the Terminal window in which you started the Grinder
script. There should be a message that things were killed and the prompt should
display again.
Set some flags so all of Java Mission Control is accessible in the JVM running server1.
a. Access the administration console, log in, and lock the configuration.
b. Navigate to server1.
c. Click Configuration > Server Start.
d. In the Arguments text area enter:
-XX:+UnlockCommercialFeatures
-XX:+FlightRecorder
e.
f.
Note: This will ensure the flight recorder in Mission Control will work. Be careful to
enter the arguments exactly as shown. There are no spaces in each argument. The
XX are capital letters.
Click Save.
Activate the changes.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
8.
Even though the message says that no restarts are necessary, you do need to restart
server1 for these flags to take effect. Use the admin console to force shutdown and
then restart server1.
Tip: Environment > Servers > Control. Select the check box in front of server1 and
click Shutdown > Force Shutdown Now. Click Yes. Select the check box again and
click Start. Click Yes.
h. Wait for the server to be running before continuing.
Investigate the same issues as before by using Java Mission Control.
a. Because you stopped and restarted server1, it will now have a different process ID.
Return to host01. In a Terminal window, navigate to the bin directory of the JVM and
use the jps command again to find the new process of server1. This time use grep to
eliminate output not needed. Make note of server1s PID.
$> cd /u01/app/jdk/bin
$> ./jps v | grep server1
b.
c.
d.
e.
Leave Java Mission Control (JMC) running. You can minimize it, if you want. Also, do
not close the Terminal window that started JMC, because this will exit the program.
Run the Grinder script again.
Tip: In a different Terminal window, from the current practice directory, run the script
rungrinder.sh again.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
g.
9.
Leave the Grinder script window open and return to JMC. Watch for a while.
Note: Notice the CPU spikes and the memory usage goes up, as before.
<OPTIONAL> Create and view a Java Flight Recording.
a. First, set the diagnostic volume of server1 to High, so the flight recording has more
data. Access the admin console and lock the configuration. Navigate to Environment
> Servers > server1 > Configuration > General. Use the drop-down list to set
Diagnostic Volume to High. Save and activate your changes.
b.
c.
d.
e.
f.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
f.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 6
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In this practice, you monitor threads and create and analyze a thread dump.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
Soon after the latest version of an application is deployed, users report they are unable to
access the application. You investigate.
Overview
In this practice, you configure server overload conditions, monitor threads, create a thread
dump, and analyze a thread dump.
Assumptions
You completed Practice 3-1: Harvesting Diagnostic Metrics.
All instances of WebLogic Server are running.
Tasks
1.
Modify a servers overload configuration so that the server fails if too many threads are
stuck.
Note: The default is to never put a server into the FAILED state based on stuck threads.
a. Access the administration console and lock the configuration.
b. Locate and select server1.
c. Select the Configuration > Overload tabs.
d. Update the Stuck Thread Count to 5.
e.
2.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
3.
4.
5.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
Note:
The -u option means to show only processes owned by the users listed (oracle).
The -o option is the format desired (the pid followed by the command args).
e.
f.
g.
h.
Using the pipe followed by grep weblogic.Server means to send the output of
the ps command to grep and only show those results that contain the string
weblogic.Server (notice that Server starts with a capital S).
Look through the output. You should have three items. One is the admin server, one is
server1, and the last one is the grep command itself. You can tell which WebLogic
Server is which by the option within the arguments that lists the servers name:
-Dweblogic.Name=server1
Note the number at the start of the server1 item. That is the PID of server1.
In the same Terminal window, run the jstack utility with that PID. Normally it prints
the thread dump to the Terminal window. Redirect it to a file to keep it.
$> ./jstack nnnnn > /home/oracle/server1_threads.txt
Note: Replace nnnnn with the PID of server1.
View the thread dump file by using the gedit editor.
$> gedit /home/oracle/server1_threads.txt
i.
6.
Try searching in the editor (Search > Find or Ctrl + F) for these strings:
stuck
blocked
Note: If you do not see any threads that are stuck or blocked, it may be that too much
time has passed since the Grinder script accessed the bad application.
j. Exit the editor.
k. Close the Terminal window.
Look at a thread dump with a tool. You will use an open source tool called Samurai that
looks through a server log file and displays thread dumps found in the log.
a. Still on host01, open a new Terminal window, and navigate to where the Samurai JAR
file resides:
$> cd /install/samurai
b.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
c.
d.
You can drag a server log file into Samurai by using the File Browser, navigating to the
log file location, and dragging it from the File Browser into the Samurai window. Or you
can use the Samurai File > Open menu options to navigate to and select the log file.
The screenshot below is using the File menu. Remember, the log file is here:
/u01/domains/tshoot/wlsadmin/servers/server1/logs/server1.log
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
Samurai reads the log file and puts any thread dumps into the Thread Dumps tab.
Select that tab. The information displayed starts out in Samurais Table View. Scroll to
the bottom to see the legend.
f.
Each column in the table represents a thread dump. You are interested in one with
Blocked threads (red blocks). The thread dump of interest will be the last column (or
the only column). Select one of the Blocked threads by clicking its red block.
g.
Note: You may not have as many thread dumps (columns) in your table as shown in
the screen shot. In fact, you may only have one.
This takes you to the Sequence View, to the part of this thread that has the problem.
You may notice that even though a thread is blocked and waiting, it does not have to
be stuck, as in this example.
Note: The ACTIVE and BLOCKED notations have been highlighted in yellow in the
screenshot.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e.
7.
8.
To return to the Table view, scroll up and click the Table link, or click the Table View
icon near the bottom of the screen.
h.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
h.
9.
c.
d.
Note: This script uses the same deploy_app.py WLST script as the setup.sh
script does. However, after it undeploys the bad version of the application, it copies the
original version over the bad version in the domains apps directory and then deploys
the original.
Close the Terminal window.
Exit the VNC Viewer.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
i.
Perform the following tasks if you did not do this practice and want to use the finished solution.
Assumptions
You completed Practice 3-1: Harvesting Diagnostic Metrics.
All instances of WebLogic Server are running.
Solution Tasks
1.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 7
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In this practice, you debug an application error.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
Developers have created a new version of the contacts application. The missing add a new
contact functionality has been added. The application also now does validation of some fields
to check format. After deploying the new version of the application, however, there are problems
with it.
Overview
In this practice, you look at a Java stack trace to debug an application error. You analyze a
CLASSPATH error and correct it.
Assumptions
You completed Practice 6-1: Investigating Server Problems.
All instances of WebLogic Server are running.
Tasks
1.
2.
3.
Run the setup script to deploy the latest version of the contacts application.
a. Access host01. Open a Terminal Window and run the setup script in the current
practice directory.
$> cd /practices/tshoot/practice07-01
$> ./setup.sh
Note: This script copies the new version of the contacts application to the domains
apps directory and redeploys the application.
b. Minimize the VNC viewer for later.
Try the application to encounter an error.
a. From the gateway machine web browser, access the contacts application by entering
the URL:
http://host01.example.com:7011/contacts
b. Click the browse all contacts link.
c. Click the [edit] link next to one of the contacts.
d. Edit any field and click the Update button.
e. You should see Error 500--Internal Server Error.
Locate the error in the server1 log file.
a. Return to host01. Use a Terminal window or the File Browser to navigate to the server1
log file. Edit the file with the gedit editor.
Tip: Remember, the log file is here:
/u01/domains/tshoot/wlsadmin/servers/server1/logs/server1.log
b. Scroll to the bottom of the log file. Start looking from the bottom up for the last error
entry. It will look something like this:
####<Oct 29, 2013 12:25:12 PM UTC> <Error> <HTTP>
<host01.example.com> <server1>
...
Root cause of ServletException.
java.lang.NoClassDefFoundError: stcurr/utils/FieldValidator
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4.
5.
On host01, use the File Browser to navigate to the apps directory under the domain.
Tip: /u01/domains/tshoot/wlsadmin/apps
Right-click contacts.war and select Open with Archive Mounter.
Click contacts.war in the Places list.
Look for the stcurr.utils.FieldValidator class under WEB-INF/classes.
c.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
at
stcurr.DispatchServlet.validate(DispatchServlet.java:182)
6.
c.
d.
Double-check that the JAR file made it to host02. In the same Terminal window, use
ssh to list the contents of the lib directory.
$> ssh host02 "ls /u01/domains/tshoot/wlsadmin/lib"
readme.txt
validator.jar
e.
The downside of using the lib directory of a domain is that servers must be restarted
for the JAR files there to be added to the CLASSPATH of the servers. Use the admin
console to shut down and restart both server1 and server2.
Note: Wait until the servers are running before continuing.
Try the contacts application again. In the gateway machine web browser, enter the
contacts URL:
http://host01.example.com:7011/contacts
f.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
d.
h.
i.
Browse the contacts. Choose a contact to edit. Change the zip code to have too few
digits. Click Update. As you can see from the message, the validation code has been
found and is now working. Correct the zip code field and click the Update button again.
If you want to ensure it also works on server2, try the application again by using this
URL:
http://host02.example.com:7011/contacts
Once you have edited contacts, close the web browser.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
g.
Perform the following tasks if you did not do this practice and want to use the finished solution.
Assumptions
You completed Practice 6-1: Investigating Server Problems.
All instances of WebLogic Server are running.
Solution Tasks
1.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 8
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In this practice, you investigate some problems with an application that uses a data source to
access the database.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
The developers have once more created a new version of the contacts application. After
deploying the new version of the application, however, database problems arise.
Overview
In this practice, you find and resolve a data source configuration problem, troubleshoot a
database connection leak, and configure a data sources connection timeout.
Assumptions
You completed Practice 7-1: Investigating Application Problems.
All instances of WebLogic Server are running.
Tasks
1.
2.
3.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
5.
f.
g.
h.
f.
You should find multiple messages about the maximum capacity being reached for the
data source:
Reached maximum capacity of pool "datasource1"
g.
h.
i.
j.
Return to the admin console and navigate to the datasource1 data source.
Click the Monitoring > Statistics tabs.
Click Customize this table.
Ensure that the Chosen columns contain (the order does not matter):
Server
Enabled
Active Connections Current Count
Current Capacity
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4.
c.
d.
e.
6.
View data source diagnostic profiling data in the data source log file.
a. On host01, use a Terminal window or the File Browser to navigate to the log directory
under the server1 directory.
Tip: /u01/domains/tshoot/wlsadmin/servers/server1/logs
b.
c.
d.
7.
Use the admin console to update the maximum capacity of the data source. Lock the
configuration. Increase the datasource1 connection pool Maximum Capacity to 10.
Save and activate your changes.
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Number Available
k. Click Apply.
l. Verify that the number of active connections is the same as the capacity. As you can
see, this means that there are no connections available.
m. For example:
d.
e.
f.
g.
h.
8.
9.
Use the admin console to shut down and restart server1. When the server stops, the
connections that are still in use are closed. When the server comes back up, the
connection pool starts fresh.
Note: Alternatively, you could shut down and restart just the data source: Navigate to
datasource1. Select the Control tab. Select the check box next to server1 and click
Shutdown > Force Shutdown. Click Yes. Select the check box next to server1 again
and click Start. Click Yes.
i. Verify that all is well with the data source by returning to its Monitoring > Statistics
screen. You should see that for server1 the active connections is 0, the capacity is 1 (it
will grow as needed), and the number available is 1.
Disable data source diagnostic profiling.
a. Access the admin console and lock the configuration.
b. Navigate to the data source name datasource1.
c. Click the Configuration > Diagnostic tabs.
d. Deselect Profile Connection Usage, Profile Connection Reservation Wait, Profile
Connection Leak, and Profile Connection Reservation Failed.
e. Set the Profile Harvest Frequency Seconds to 300.
f. Save and activate your changes.
Configure data source connection timeouts.
Note: You already increased the maximum capacity of the data source. Now you will
ensure bad code that does not release connections will have those connections
automatically reclaimed by the data source.
a. In the admin console, lock the configuration.
b. Edit the datasource1 connection pool again.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
Note: You conferred with the DBA and 10 is the value you were told to use.
Use the admin console to shut down and restart server1. Wait for it to get to the
RUNNING state.
Return to the host01 Terminal window in which the rungrinder.sh script was run.
Run it again.
Wait a moment and return to the admin console data source monitoring screen from
earlier. Refresh the web browser. Do you have the same problem? Are the current
number of active connections equal to the capacity, and no connections are available?
Note: Increasing the maximum number of connections did not help. There must be an
issue with the application. After talking with the development group, they admit there is
a problem in their JDBC code, and they deliver an updated version of the application.
On host01, run the script to kill the Grinder processes again.
Run the script that deploys the fixed version of the application.
$> cd /practices/tshoot/practice08-01
$> ./deploygood.sh
d.
Note: The default value of 0 means that inactive connections never time out. Now after
30 seconds of inactivity* a connection will be automatically reclaimed by the
connection pool.
* Because of the way inactive connections are reclaimed, there could be, on average, a
delay of 50% more than the configured value.
Save and activate your changes.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
There is no solution for this practice. At the end of the practice the good version of the
application is redeployed, which is how the system starts before doing this practice. Any data
source configuration changes are not required for later practices.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 9
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In this practice, you investigate some problems with Node Manager.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
Something has happened. A server, server2, is shut down, but when you try and restart it by
using the admin console, the Node Manager on its machine is unreachable.
Overview
In this practice, you find and resolve a problem with the communication between the admin
server and Node Manager, use the WLST nmEnroll() command, and configure Node
Manager to restart failed servers that it started.
Assumptions
You completed Practice 7-1: Investigating Application Problems.
All instances of WebLogic Server are running.
Tasks
1.
2.
3.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
Note: You are killing Node Manager so you can start it in a Terminal window, to be
able to look at its output as it starts. (You could also look at the Node Manager log files,
but this is easier.)
Now navigate to the domains bin directory. Call the script to start Node Manager in
the Terminal window.
$> cd /u01/domains/tshoot/wlsadmin/bin
$> ./startNodeManager.sh
d.
e.
f.
g.
4.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
This shows that Node Manager is running. You must search further to find the
problem.
Navigate to the utilities directory and call the script to kill Node Manager.
$> cd /practices/tshoot/utilities
$> ./killnodemanager
d.
Using the Tab key to automatically fill in file names or commands does not work in
WLST. Sorry. Type carefully.
Run the nmEnroll() command.
nmEnroll('/u01/domains/tshoot/wlsadmin',
'/u01/domains/tshoot/wlsadmin/nodemanager')
Note:
Enter the command on one line.
The first parameter is the domain directory and the second parameter is the Node
Manager home directory.
e. Exit WLST.
exit()
f.
5.
6.
f.
Note: Find the Java process that is server2. Within the output for this process you
should see -Dweblogic.Name=server2. The process ID is the first thing displayed.
Make note of it.
Find the Terminal window in which the machine2 Node Manager is running. Resize
windows and move them around so that you can see both the Node Manager window
and the window in which you ran the ps command. In the ps command window, run
the kill command with the process ID of server2.
$> kill -9 nnnn
Note:
Replace nnnn with the actual process ID.
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note:
Enter the command on one line.
The prompt is not shown here (or in subsequent WLST commands) due to space
limitations.
The first parameter is the username, the second is the password, and the third is the
URL to the admin server (using the proprietary t3 protocol).
7.
Watch the Node Manager Terminal window after you enter the kill command. You
should see in the Node Manager output that Node Manager notices that server2 has
failed and restarts it.
h. Return to the admin console and verify that server2 is back in the RUNNING state.
Clean up by closing windows, running Node Manager in the background (as it has been),
and starting servers.
a. Return to host02.
b. Open a Terminal window, navigate to the utilities directory, and call the script to kill
Node Manager.
$> cd /practices/tshoot/utilities
$> ./killnodemanager.sh
c.
d.
e.
f.
g.
Find the Terminal window in which Node Manager was running and close it.
Start Node Manager again, in the background, by running the start Node Manager
script in the utilities directory.
$> ./startnodemanager.sh
Note: Wait for the message that Node Manager has started.
Close the Terminal window.
Exit the VNC Viewer.
Access the admin console. Start any managed servers that are not running.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
g.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 10
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In these practices, you troubleshoot a cluster. First you investigate issues with the OHS cluster
proxy. Then you investigate issues with session replication.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
It has been reported that there may be some issues with the cluster. It is not certain if the
problem is with one of the servers in the cluster or with the OHS proxy in front of the cluster.
Overview
In this practice, you investigate the OHS cluster proxy by using the proxy log file and a special
proxy query parameter.
Assumptions
You completed Practice 7-1: Investigating Application Problems.
All instances of WebLogic Server are running.
Tasks
1.
2.
3.
Starts (or restarts) OHS and prints out its status, by using opmnctl. The status
output does not line up well, but it should indicate that OHS is Alive and running
HTTP on port 7777.
Note: Wait for all the scripts to finish before continuing.
Access the admin console to monitor sessions. From host01, run the Grinder script.
a. Access the admin console. Navigate to Deployments. Select the supplies
deployment. Click Monitoring > Web Applications.
b. Click Customize this table. Place only the following fields in the Chosen column, and
then click the Apply button:
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e.
f.
Note: The order of the servers and the number of sessions for each one may be
different in your admin console. The exact numbers do not matter. Also, if you run the
Grinder script more than once, the Total Sessions will increase.
g. Open a new web browser window or tab and enter the following URL:
http://host01.example.com:7777
/supplies/?__WebLogicBridgeConfig=true
Note:
Enter the URL all together, with no spaces.
There are two underscore characters (__) in the parameter name.
h.
This URL asks the OHS proxy to display information about each server, as well as
configuration settings and communication statistics.
Using the display in the web browser, observe the status of the cluster members, from
the perspective of OHS.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
c.
d.
Application
Server
Machine
State
Sessions
Sessions High
Total Sessions
Note: The order does not matter.
Minimize the admin console to use in a moment.
Access host01. From a Terminal window navigate to the current practice directory and
run the script that runs the Grinder. The Grinder script simulates customers using the
supplies application.
$> cd /practices/tshoot/practice10-01
$> ./rungrinder.sh
Note: The exact numbers do not matter. But, notice that, even though all requests
were successful, there were some exceptions. The exceptions were READ_TIMEOUT
exceptions.
j.
k.
l.
m. When OHS times out trying to connect to a backend server, it tries again. After a
certain number of tries, it marks the backend server as bad. Try to determine which
server is having a problem. Go to the top of the log file and search for as bad:
2013-11-08T15:48:07.7192+00:00 <2765138392568712> Marking
192.0.2.11:7013 as bad
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
i.
n.
o.
p.
4.
Which machine is it? Make note of the IP address. (Your IP address may be
different.)
Close the log file.
To determine which machine, on the gateway machine, open a Terminal window. Print
out the contents of the hosts file to see how IP addresses are mapped to names.
$> cat /etc/hosts
Find the IP address of the server having issues. In this case, the IP address is mapped
to host01.example.com.
f.
g.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note:
h.
5.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
$> cd /practices/tshoot/practice10-01
$> ./rungrinder.sh
Perform the following tasks if you did not do this practice and want to use the finished solution.
Assumptions
You completed Practice 7-1: Investigating Application Problems.
All instances of WebLogic Server are running.
Solution Tasks
1.
b.
Note: This script calls a SQL*Plus script that creates a new table in the database,
which a new application requires.
Access host01. Navigate to the current practice directory and run the solution script.
$> cd /practices/tshoot/practice10-01
$> ./solution.sh
Note: This script calls the setup script followed by the cleanup script of the practice.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
The issue with the slow server in the cluster has been resolved. After a new version of the
supplies application is deployed, some users report that sometimes their shopping cart
mysteriously loses items. You investigate.
Overview
In this practice, you configure HTTP session debugging, view session debug messages in a
server log, observe session replication failure, and investigate the cause of that failure.
Assumptions
You completed Practice 10-1: Investigating Proxy Problems.
All four managed server instances of WebLogic Server are running. OHS is configured, up, and
running.
Tasks
1.
2.
3.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4.
5.
In a Terminal window, navigate to the current practice directory and run the Grinder
script.
$> cd /practices/tshoot/practice10-02
$> ./rungrinder.sh
g.
h.
i.
j.
k.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e.
l.
Immediately after the message stating that the session was created, find a replication
debug message that provides this sessions internal replication ID. For example:
####<Nov 11, 2013 1:40:46 PM UTC> <Debug> <Replication>
<host01.example.com> <server1> <[ACTIVE] ExecuteThread: '5' for
queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <>
<> <1384177246784> <BEA-000000>
<[roid:-8699644743353115416]
Creating primary for application key /supplies>
m. Use the Find capability of the editor again. This time search from this point forward for
that replication ID (the number after roid:). Find the message with the replication ID
that says created secondary. This should show you the backup server. For
example:
####<Nov 11, 2013 1:40:46 PM UTC> <Debug> <Replication>
<host01.example.com> <server1> <[ACTIVE] ExecuteThread: '5' for
queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <>
<> <1384177246793> <BEA-000000>
<[roid:-8699644743353115416]
Created secondary on
6002997145995730564S:host02.example.com:[7013,7013,-1,-1,-1,-1,1]:wlsadmin:server4>
6.
Note: In this example, the secondary is server4. It could be another server in your
case.
n. From what you have observed so far, it seems session replication is working. A primary
server is servicing your requests, and a secondary server has been chosen to back it
up.
Test session replication. If it fails, investigate the cause for replication (and therefore
failover) not working.
a. Use the admin console to force shut down the primary server. (In this example,
server1.)
b. After the server is shut down, return to the supplies application. Remembering what is
already in your shopping cart, add one more item. Scroll down and view the cart.
c. Are all the items in the cart, or just the last one?
Note: Only the last item added is in the shopping cart. This means that failover did not
work. Although it appears that session replication is set up and working, you know it did not
work because you lost your previous shopping cart items.
d. Return to the log file of your primary server. Scroll to the bottom of the file. Search
backwards for <Error>.
Note: Because you are editing a file that can change, the editor may ask if you want to
reload the file. If it does, click the Reload button.
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
7.
You should find an error written by the <Cluster> subsystem. The error complains:
Failed to replicate a non-serializable object.
Analyze the serialization error.
a. Still in the log file, search backwards for:
NotSerializableException
b.
When you find this exception, it should indicate the class that has the problem.
java.io.NotSerializableException: stcurr.supplies.model.Item
Note:
8.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
e.
Perform the following tasks if you did not do this practice and want to use the finished solution.
Assumptions
You completed Practice 10-1: Investigating Proxy Problems.
All four instances of WebLogic Server are running. OHS is configured, up, and running.
Solution Tasks
1.
Access host01. Navigate to the practices directory and run the cleanup script.
$> cd /practices/tshoot/practice10-02
$> ./cleanup.sh
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Chapter 11
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Practices Overview
In this practice, you set up the auditing provider and enable domain configuration auditing.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
Someone is making changes to the domain configuration in production. These changes are
causing problems. All administrators claim that they did not make the changes. You need to
discover who is making these changes.
Overview
In this practice, you configure the default auditing provider and configure auditing of domain
configuration changes.
Assumptions
You completed Practice 7-1: Investigating Application Problems.
All instances of WebLogic Server are running.
Tasks
1.
2.
i.
Tip: Hover over an entry for a tool tip pop-up that displays the full name of the entry.
All of the JMX elements are together.
Choose Custom from the Severity drop-down list.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
p.
3.
4.
5.
After the admin server is running, access the admin console again and use it to start
the managed servers.
Note: Wait for the managed servers to be running before continuing.
Set up domain configuration auditing.
a. Use the admin console to lock the configuration.
b. Select the domain, wlsadmin.
c. Click the Configuration > General tabs.
d. Click Advanced.
e. Use the Configuration Audit Type drop-down list to select Change Log and
Audit.
Note: This writes domain configuration audit messages to both the admin server log
and the audit provider log.
f. Save and activate your changes.
Note: Notice this change does not require any server restarts.
Make some domain configuration changes.
a. Log out of the admin console.
b. Log in to the admin console as Fred. The username is fred and the password is
Welcome1.
c.
Lock the configuration, make some innocuous domain configuration change, and
activate your changes.
Tip: For example, add a new server. Make the server name something unique, such as
fredserver1, which will be easy to find in the logs. Set the Server Listen Address to
either host01.example.com or host02.example.com. Use a port not already in
use (like 7015).
d.
e.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Note: With custom chosen, the check boxes determine which severity levels are
audited.
j. Select each of the check boxes to enable all severity levels.
k. Save and activate your changes.
Note: Notice that servers must be restarted.
l. Use the admin console to force shut down the managed servers.
m. Now use the admin console to force shut down the admin server.
n. Close the web browser.
o. Access host01. In a Terminal window, navigate to the practice utility scripts. Run the
script to start the admin server.
$> cd /practices/tshoot/utilities
$> ./startadmin.sh
Use the File Browser or a Terminal window to navigate to the directory where the
admin server keeps its log files.
$> cd /u01/domains/tshoot/wlsadmin/servers/AdminServer/logs
c.
Use the gedit editor to open the admin servers server log, and the audit log.
$> gedit AdminServer.log DefaultAuditRecorder.log
d.
In the AdminServer.log file, use the Find tool to search for the name of the domain
resource that you created (or modified) earlier as one of the other administrators. In
this example, the user fred created a new managed server called fredserver1.
You should find some audit records of the resource being created and modified. For
example:
####<Nov 14, 2013 2:04:16 PM UTC> <Info> <Configuration Audit>
<host01.example.com> <AdminServer> <[ACTIVE] ExecuteThread: '0'
for queue: 'weblogic.kernel.Default (self-tuning)'> <fred> <> <>
<1384437856692> <BEA-159900>
<USER fred CREATED wlsadmin:Name=fredserver1,Type=Server>
####<Nov 14, 2013 2:04:16 PM UTC> <Info> <Configuration Audit>
<host01.example.com> <AdminServer> <[ACTIVE] ExecuteThread: '0'
for queue: 'weblogic.kernel.Default (self-tuning)'> <fred> <> <>
<1384437856705> <BEA-159904>
<USER fred MODIFIED com.bea:Name=fredserver1,Type=Server
ATTRIBUTE ListenAddress FROM TO host01.example.com>
e.
Search for the same resource in the audit log, DefaultAuditRecorder.log. The
format is different, but the information is basically the same. In this example, it shows
the user fred creating and modifying the server fredserver1. Here is the audit
record of the servers creation:
#### Audit Record Begin <Nov 14, 2013 2:04:16 PM>
<Severity =SUCCESS>
<<<Event Type = Create Configuration Audit Event>
<Subject = Subject: 2
Principal = class
weblogic.security.principal.WLSUserImpl("fred")
Principal = class
weblogic.security.principal.WLSGroupImpl("Administrators")>
<Object = wlsadmin:Name=fredserver1,Type=Server>>> Audit Record
End ####
6.
Note: By using domain configuration auditing, you will be able to tell which
administrative user makes the next configuration change that causes a problem.
f. <OPTIONAL> Use the editor to find the audit records of the resource the other user,
wilma, created or modified.
g. Exit the editor.
Clean up.
a. Access host01. In a Terminal window, navigate to the current practice directory and run
the cleanup script.
$> cd /practices/tshoot/practice11-01
$> ./cleanup.sh
Copyright 2014, Oracle and/or its affiliates. All rights reserved.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
Note: This script disables domain configuration auditing and sets the auditing provider
severity level to ERROR, so less activity is audited.
If you want to, you can use the admin console to delete any unneeded domain
resources you created to test configuration auditing.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Scenario
In your domain, which uses the embedded LDAP authentication provider, you only set up one
administrative user (the one that is required to be configured when the domain is created). You
forget that users password, so you can no longer start servers or change the domain
configuration.
Overview
In this practice, you recover from the loss of the main admin-level users password by running
the AdminAccount utility.
Assumptions
You completed Practice 2-1: Accessing and Setting Up the Practice Environment. (This
practice can be done at any time after the domain has been created.)
The admin server is running.
Tasks
1.
2.
d.
3.
b.
c.
d.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
b.
c.
5.
6.
d.
e.
f.
When prompted for the username to boot WebLogic Server, enter: tempadmin
d.
When prompted for the password to boot WebLogic Server, enter: Password1
e.
In the Domain Structure click Security Realms. In the table, click myrealm.
Click the Users and Groups tab.
Ensure the Users subtab is selected.
Click the weblogic user (the main admin user that was configured when the domain
was created).
Click the Passwords tab.
Enter Welcome1 in both password fields and click Save.
h.
i.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
4.
Note: The arguments passed to this Java class are the new username, the new
password, and the location of the DefaultAuthenticatorInit.ldift file.
e. Go back to the File Browser and reload the current location (View > Reload). Look at
the timestamp of the DefaultAuthenticatorInit.ldift file, which should have
just been updated.
f. Do not close the File Browser.
Remove the admin servers DefaultAuthenticatormyrealmInit.initialized file.
Remove the admin servers boot identity file.
a. Use the File Browser to navigate to:
/u01/domains/tshoot/wlsadmin/servers/AdminServer/data/ldap
7.
c.
Type over the encrypted values for username and password with weblogic and
Welcome1. The file should look like this:
password=Welcome1
username=weblogic
d.
e.
f.
g.
h.
i.
j.
k.
l.
Note: The order of these attributes does not matter. The timestamp can be deleted, if
you want. When the values are encrypted a new timestamp is written.
Save the file and close the editor.
In the File Browser, navigate to the data/ldap directory of AdminServer and delete
the file DefaultAuthenticatormyrealmInit.initialized.backup.
Tip: Right-click on it a select Move to Trash.
Navigate to the data directory of AdminServer and delete the directory ldapbackup.
Close the File Browser.
Find the Terminal window in which the admin server is running. Press Ctrl + C to force
shut down the server.
In that same Terminal window, navigate to the utilities directory and start the
admin server with the script.
$> cd /practices/tshoot/utilities
$> ./startadmin.sh
Note: Wait for the admin server to start. If it starts successfully, the
boot.properties file (with the updated username and password) is working.
Close the Terminal window.
Exit the VNC Viewer.
If you are continuing to work in the domain, use the admin console to start the
managed servers.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
j.
k.
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED