Professional Documents
Culture Documents
Course WLS-A11-100-01
Session Module
1: Overview
A.M. 2: Setting up a WebLogic Server Environment
Day
1 3: Configure a WebLogic Server Environment
P.M. 4: Managing and Monitoring a WebLogic Server Environment
5: Basic Deployment
A.M.
Day 6: Understanding JNDI
2 7: Setting up JDBC
P.M.
8: Setting up JMS Applications
8: Setting up JMS Applications (Contd.)
A.M.
Day 9: Managing Transactions
3 10: Securing WebLogic Server Resources and Applications
P.M.
11: Advanced Deployment
Session Module
1. Distributed Architecture
– J2EE Technologies
– Web and WLS Terms
2. Setting Up a WebLogic Server Environment
Servlets
EJB Container
RMI-IIOP
JDBC
JNDI
JMS
JMX
JTA
Web Service
WebLogic Server
Management Tool MBeans
MBean
MBean
MBean
MBean
Server
C
Web servers:
– Provide Web content
– Communicate via HTTP, FTP, and so forth
– Can handle CGI requests
– Proxy some requests to application servers
Web Server
Web
Server
HTTP HTTP
WebLogic
Server
HTTPS Plug-in HTTPS
WebLogic Server
Provide services that J2EE Application Server
support the execution and
Web Container
availability of deployed
applications Servlets
EJB Container
JSPs
Handle heavier processing Session
EJBs
chores than Web servers
Entity
EJBs
JAX-RPC
RMI-IIOP
JDBC
JAAS
JNDI
JMS
JMX
JTA
Firewall
Client Firewall Web Application
Server Servers
Server
A
World
Wide WLS Server
Client
Web Plug-In B
Server
Client C
Inner Network
Your Network
Extranet
Client
or
App
Internet
Database
Client Local
App Client
App
Your Network
«server»
A server:
– Runs on a designated «cluster»
WLS machine
«server»
– Has a dedicated amount «server»
of RAM «server»
– Is multithreaded
«machine»
«server»
«logs»
Runs a supported
«server»
operating system
platform «cluster»
instances «server»
1. Distributed Architecture
2. Setting Up a WebLogic Server Environment
– WebLogic Server Architecture
– Installing and Running WebLogic Server
Installation complete!
Setting Up a WebLogic Server Environment-37 © 2007 BEA Systems, Inc. 51
Console-mode Installation
docs
Source code for sample domain
examples examples installed with WebLogic Server
medrec
1. Configuring Domains
– How WebLogic Server Domain works
– Domain Directory Structure and Files
– Creating a Domain
2. Configuring Servers
3. Domain Templates
4. Console Administration
5. Command Line Administration
Managed
Monitor/
Server 3
Update
Configuration LOG Local Logging
Repository
Configuring a WebLogic Server Environment-4 © 2007 BEA Systems, Inc. 64
Configuring a Domain
Minimal syntax:
java -server –Xms256m –Xmx512m -classpath "%CLASSPATH%"
-Dweblogic.Name=%SERVER_NAME% -Dplatform.home=%WL_HOME%
-Dweblogic.management.username=%WLS_USER%
-Dweblogic.management.password=%WLS_PW%
-Dweblogic.ProductionModeEnabled=%STARTMODE%
-Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy
weblogic.Server
Arguments:
%SERVER_NAME% - The name of the server to start.
10
0101
1110
Enter password
1. Configuring Domains
2. Configuring Servers
– Configuring Managed Servers
– Starting Managed Servers
– Running Multiple WLS Instances
3. Domain Templates
4. Console Administration
5. Command Line Administration
1 2
LOG ServerA
192.168.1.2:7001
Critical Domain
Get configuration LOG Local Logging
Notifications
at startup (http/https)
Admin Server
192.168.1.1:7001 ServerB
192.168.1.1:7002 192.168.1.3:7001
GET / SET LOG Local Logging
A multihomed machine:
– Is a machine with multiple IP addresses
– Can run a different WLS instance bound to each IP address
– Can be used to configure a cluster on a single machine
192.168.1.1
192.168.2.2
Machine
1. Configuring Domains
2. Configuring Servers
3. Domain Templates
– Creating Customized Domain Templates
4. Console Administration
5. Command Line Administration
Add
script to
domain
1. Configuring Domains
2. Configuring Servers
3. Domain Templates
4. Console Administration
– WebLogic Server Administration Console
– Setting Basic Properties via the Console
5. Command Line Administration
https://hostname:secureport/console (secure)
Example URLs:
http://localhost:7001/console
http://adminDNSName:7001/console
https://127.0.0.1:7002/console
10
0101
1110
Enter the user name and password that you set when
creating your domain.
2
3
File-based distribution
using Administration
Config.xml channel Config.xml
Edit works
on separate • Simple beans (not remote)
copy of files • File-based change distribution
• Separation of edit and activation
Lab Exercise
1. Configuring Domains
2. Configuring Servers
3. Domain Templates
4. Console Administration
5. Command Line Administration
– Managing WebLogic Server via the Command Line
WLST Tool
Interactive
– When you enter a command in the WLST console and view
the response immediately
Script
– When you create a text file with the .py extension that
contains a series of WLST commands
Embedded
– When you instantiate an instance of the WLST interpreter in
your Java code and use it to run WLST commands
1) Invoke WLST:
c:\>java weblogic.WLST
wls:/offline>
2) Use the writeIniFile command to convert WLST
definitions and method declarations to a .py file:
wls:/offline> writeIniFile("wl.py")
3) Open a new command shell and invoke Jython
directly by entering the following command:
c:\>java org.python.util.jython
4) Import the WLST module into your Jython module
using the Jython import command:
>>>import wl
5) Now you can use WLST methods in the module. For
example, to connect WLST to a server instance:
wl.connect('username','password')
Exit WLST:
wls:/mydomain/serverConfig> exit()
Exiting WebLogic Scripting Tool ...
c:\>
connect(‘weblogic’,
connect Connects to a server ’weblogic’,
instance (online mode) ’t3://localhost:7011’)
Lab Exercise
1. Remote Administration
– Configuring Machines
– Node Manager
– Configuring Node Manager
2. Logs and Monitoring
3. SNMP Concepts
4. WLS SNMP Agent
5. WLS SNMP Management Tools
6. Network Channels
Managing and Monitoring a WLS Environment-2 © 2007 BEA Systems, Inc. 140
Node Manager
Managing and Monitoring a WLS Environment-3 © 2007 BEA Systems, Inc. 141
What Node Manager Can Do
Managing and Monitoring a WLS Environment-4 © 2007 BEA Systems, Inc. 142
Node Manager Architecture
Machine A
WLST Node Admin
Manager Console
JMX
Client Admin
Server
Node
Node
Manager
Manager
Managed
Managed
Server 1 Secure Server 2
Machine C Connection
Machine B
Managing and Monitoring a WLS Environment-5 © 2007 BEA Systems, Inc. 143
How Node Manager Starts an
Administration Server
1. Issues command
to start 4. NM creates
Admin Server Node process for AS
Admin
WLST
Manager Server
3. NM obtains
startup properties
for AS
5. AS obtains
domain
2. NM determines configuration
domain directory,
authenticates user
Machine A
Managing and Monitoring a WLS Environment-6 © 2007 BEA Systems, Inc. 144
How Node Manager Starts a Managed
Server
1. Issues command
to start MS1 Admin
Admin
Console Server
4. MS1 obtains
configuration
Machine A
Managed 3. NM creates
Server 1 MS1 process
Machine B
Managing and Monitoring a WLS Environment-7 © 2007 BEA Systems, Inc. 145
How Node Manager Restarts an
Administration Server
3. NM creates
AS process Admin
Server
Node 1. NM determines
Manager AS needs restart
4. AS
2. NM obtains remote obtains domain
start username/ configuration
password,startup
properties for AS
Machine A
Managing and Monitoring a WLS Environment-8 © 2007 BEA Systems, Inc. 146
How Node Manager Restarts a
Managed Server
Machine A
3. NM creates
Managed
MS1 process
Server 1
Managing and Monitoring a WLS Environment-9 © 2007 BEA Systems, Inc. 147
How Node Manager Shuts Down a
Server Instance
Machine A
1. User issues shutdown
Admin Command for MS1 Admin
Console Server
Machine B
2. AS tries to 3. AS sends
Shut down shutdown
MS1 Operating command
System` for MS1 to
NM
5. Kill MS1 4. NM tries to
Managed shut down MS1
Server 1 Node
Manager
Managing and Monitoring a WLS Environment-10 © 2007 BEA Systems, Inc. 148
Versions of Node Manager
Managing and Monitoring a WLS Environment-11 © 2007 BEA Systems, Inc. 149
Node Manager Configuration
Managing and Monitoring a WLS Environment-12 © 2007 BEA Systems, Inc. 150
Node Manager Default Behaviors
Managing and Monitoring a WLS Environment-13 © 2007 BEA Systems, Inc. 151
Configuring Java-Based Node Manager
Managing and Monitoring a WLS Environment-14 © 2007 BEA Systems, Inc. 152
Reconfigure Startup Service for
Windows Installation
Managing and Monitoring a WLS Environment-15 © 2007 BEA Systems, Inc. 153
Daemonizing NM for UNIX Systems
Managing and Monitoring a WLS Environment-16 © 2007 BEA Systems, Inc. 154
Configuring Java-Based Node Manager
Security
Managing and Monitoring a WLS Environment-17 © 2007 BEA Systems, Inc. 155
Administration Console NM Security
Managing and Monitoring a WLS Environment-18 © 2007 BEA Systems, Inc. 156
Remote Server Start Security for Java-
Based Node Manager
Managing and Monitoring a WLS Environment-19 © 2007 BEA Systems, Inc. 157
Reviewing nodemanager.properties
Managing and Monitoring a WLS Environment-20 © 2007 BEA Systems, Inc. 158
Configuring Node Manager on Multiple
Machines
Managing and Monitoring a WLS Environment-21 © 2007 BEA Systems, Inc. 159
Configuring Script-Based Node
Manager
Managing and Monitoring a WLS Environment-22 © 2007 BEA Systems, Inc. 160
Using SSL with Script-based NM
Managing and Monitoring a WLS Environment-23 © 2007 BEA Systems, Inc. 161
Creating a Node Manager User
Managing and Monitoring a WLS Environment-24 © 2007 BEA Systems, Inc. 162
Configuring Script-based Node
Manager Security
Managing and Monitoring a WLS Environment-25 © 2007 BEA Systems, Inc. 163
Additional Configuration Information
Managing and Monitoring a WLS Environment-26 © 2007 BEA Systems, Inc. 164
Configuring a Machine to Use Node
Manager
Managing and Monitoring a WLS Environment-27 © 2007 BEA Systems, Inc. 165
Configuring the nodemanager.domains
File
Managing and Monitoring a WLS Environment-28 © 2007 BEA Systems, Inc. 166
Configuring Remote Startup
Arguments
Managing and Monitoring a WLS Environment-29 © 2007 BEA Systems, Inc. 167
Ensuring Administration Server
Address Is Defined
Managing and Monitoring a WLS Environment-30 © 2007 BEA Systems, Inc. 168
Setting Node Manager Environment
Variables
Environment Description
Variable
JAVA_HOME Root directory of JDK that you are using for Node Manager. For example:
set JAVA_HOME=c:\bea\jdk1.5.0_06
Node Manager has the same JDK version requirements as WebLogic Server.
PATH Must include the WebLogic Server bin directory and path to your Java executable. For example:
set PATH=%WL_HOME%\server\bin;%JAVA_HOME%\bin;%PATH%
LD_LIBRARY_ For HP UX and Solaris systems, you must include the path to the native Node Manager libraries.
PATH Solaris example:
(UNIX LD_LIBRARY_PATH:$WL_HOME/server/native/solaris:$WL_HOME/server/lib/solaris/oci816_8
only) HP UX example:
SHLIB_PATH=$SHLIB_PATH:$WL_HOME/server/native/hpux11:$WL_HOME/server/lib/hpux11/oci816_8
CLASSPATH You can set the Node Manager CLASSPATH either as an option on the java command line used to start Node
Manager, or as an environment variable.
Windows example:
set CLASSPATH=.;%WL_HOME%\server\lib\weblogic_sp.jar;%WL_HOME%\server\lib\weblogic.jar
Managing and Monitoring a WLS Environment-31 © 2007 BEA Systems, Inc. 169
Node Manager Configuration and Log
Files
Node
Manager
Server configuration files:
boot.properties
Node manager log files startup.properties
nodemanager.log
Server state files:
server_2.lck
server_2.pid
server_2 server_2.state
Server log files:
server_2.out
Managing and Monitoring a WLS Environment-32 © 2007 BEA Systems, Inc. 170
Node Manager Configuration and Log
Files
Managing and Monitoring a WLS Environment-33 © 2007 BEA Systems, Inc. 171
Section Review
Managing and Monitoring a WLS Environment-34 © 2007 BEA Systems, Inc. 172
Exercise
Lab Exercise
Managing and Monitoring a WLS Environment-35 © 2007 BEA Systems, Inc. 173
Exercise
Lab Exercise
Managing and Monitoring a WLS Environment-36 © 2007 BEA Systems, Inc. 174
Road Map
1. Remote Administration
2. Logs and Monitoring
– Using Log Files
– Monitoring Servers
3. SNMP Concepts
4. WLS SNMP Agent
5. WLS SNMP Management Tools
6. Network Channels
Managing and Monitoring a WLS Environment-37 © 2007 BEA Systems, Inc. 175
Using Logs
Managing and Monitoring a WLS Environment-38 © 2007 BEA Systems, Inc. 176
Main Server Logs
A server log:
– Logs all server activity
– Is stored in serverName\logs\<serverName>.log
by default
A domain log:
– Logs all domain activity
– Is stored in
<AdminServer>\logs\<domainName>.log
by default
These logs are independently configured.
Managing and Monitoring a WLS Environment-39 © 2007 BEA Systems, Inc. 177
Configuring Server Logging
Managing and Monitoring a WLS Environment-40 © 2007 BEA Systems, Inc. 178
Messages Forwarded to Domain Log
Forwarded to
Severity Domain Log Meaning
by Default
Trace No Used for messages from the Diagnostic Action Library.
Info No Used for reporting normal operations.
Notice Yes An informational message with a higher level of importance
A suspicious operation or configuration has occurred but it
Warning Yes
may not have an impact on normal operation.
A user error has occurred. The system or application is able
Error Yes to handle the error with no interruption and limited
degradation of service.
A system or service error has occurred. The system is able
Critical Yes to recover but there might be a momentary loss or
permanent degradation of service.
A particular service is in an unusable state while other parts
of the system continue to function. Automatic recovery is
Alert Yes
not possible; the immediate attention of the administrator is
needed to resolve the problem.
The server is in an unusable state. This severity indicates a
Emergency Yes
severe system failure or panic.
Debug Yes A debug message was generated.
Managing and Monitoring a WLS Environment-41 © 2007 BEA Systems, Inc. 179
Message Attributes…
####<May 2, 2007 2:42:36 PM EDT> <Notice> <Security> <Ivory05>
<AdminServer> <[ACTIVE] ExecuteThread: '1' for queue:
'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <>
<1178131356062> <BEA-090078> <User johndoe in security realm myrealm
has had 5 invalid login attempts, locking account for 30 minutes.>
Attribute Description
The time and date when the message originated, in a format that is
Timestamp
specific to the locale.
Indicates the degree of impact or seriousness of the event reported by the
Severity
message.
This attribute denotes the particular subsystem of WebLogic Server that
Subsystem
was the source of the message, for example, EJB, RMI, JMS.
Managing and Monitoring a WLS Environment-42 © 2007 BEA Systems, Inc. 180
…Message Attributes
Attribute Description
User ID The user from the security context when the message was generated.
Transaction ID Present only for messages logged within the context of a transaction.
Diagnostic Context information to correlate messages coming from a specific request or
Context ID application.
Raw Time Value The timestamp in milliseconds.
A unique six-digit identifier. Message IDs through 499999 are reserved for
Message ID
WebLogic Server system messages.
For WebLogic Server messages, this contains the Short Description as
Message Text defined in the system message catalog. For other messages, this is text
defined by the developer of the program.
Managing and Monitoring a WLS Environment-43 © 2007 BEA Systems, Inc. 181
Log Filters
Managing and Monitoring a WLS Environment-44 © 2007 BEA Systems, Inc. 182
Creating Log Filters
3
4
Managing and Monitoring a WLS Environment-45 © 2007 BEA Systems, Inc. 183
Assigning a Log Filter
Managing and Monitoring a WLS Environment-46 © 2007 BEA Systems, Inc. 184
Message Catalog
Managing and Monitoring a WLS Environment-47 © 2007 BEA Systems, Inc. 185
Message Catalog
Managing and Monitoring a WLS Environment-48 © 2007 BEA Systems, Inc. 186
Using the Console to Monitor
Attribute Description
Many of the Console’s objects have a Monitoring
tab that allows you to view monitoring
information for that object.
Managing and Monitoring a WLS Environment-49 © 2007 BEA Systems, Inc. 187
Monitoring Running Servers
Managing and Monitoring a WLS Environment-50 © 2007 BEA Systems, Inc. 188
Customizing views
Managing and Monitoring a WLS Environment-51 © 2007 BEA Systems, Inc. 189
Monitoring Individual Servers
Managing and Monitoring a WLS Environment-52 © 2007 BEA Systems, Inc. 190
Section Review
Managing and Monitoring a WLS Environment-53 © 2007 BEA Systems, Inc. 191
Road Map
1. Remote Administration
2. Logs and Monitoring
3. SNMP Concepts
– Architecture, MIB, OID
– SNMP Agent
– Trap Notifications
– SNMP Features of WLS
4. WLS SNMP Agent
5. WLS SNMP Management Tools
6. Network Channels
Managing and Monitoring a WLS Environment-54 © 2007 BEA Systems, Inc. 192
SNMP
Managing and Monitoring a WLS Environment-55 © 2007 BEA Systems, Inc. 193
SNMP Architecture
Managed
Device
Managing and Monitoring a WLS Environment-56 © 2007 BEA Systems, Inc. 194
Management Information Base (MIB)
Managing and Monitoring a WLS Environment-57 © 2007 BEA Systems, Inc. 195
SNMP Polling
Management
Console SNMP polling
MIBs is done on
UDP port 161.
1 Manager "polls" for a
specific managed
object (asks for value)
4
Agent returns
data to requestor 2 Agent interacts Managed
with device to get Device
Agent requested data
Data is
3 returned to agent
Managing and Monitoring a WLS Environment-58 © 2007 BEA Systems, Inc. 196
SNMP Traps
Managed
Agent
Device
3 Agent
4 monitors the
Alert generated
events
Managing and Monitoring a WLS Environment-59 © 2007 BEA Systems, Inc. 197
OIDs
.1
Each managed object is represented by an
identifier, called the Object IDentifier (OID). .2 .3
The OIDs:
.6
– Are represented as dot-separated integers
(for example: .1.3.6.1.4.1.140 …) .0 .9
– Are hierarchical .1
– Refer to single objects (leaf) or groups (branches)
.4
.1 .8
.140
Managing and Monitoring a WLS Environment-60 © 2007 BEA Systems, Inc. 198
The Root for WLS OIDs
Managing and Monitoring a WLS Environment-61 © 2007 BEA Systems, Inc. 199
WebLogic Server 10.0 MIB Reference
Managing and Monitoring a WLS Environment-62 © 2007 BEA Systems, Inc. 200
WebLogic Server 10.0 MIB Reference
Managing and Monitoring a WLS Environment-63 © 2007 BEA Systems, Inc. 201
WLS SNMP Support
Managing and Monitoring a WLS Environment-64 © 2007 BEA Systems, Inc. 202
WLS SNMP Architecture
Request
SNMP
The WLS SNMP Managemet
Response SNMP Service
(SNMP Agent)
Agent: Station Traps
GET GET
Managed Managed
Server Server
Managing and Monitoring a WLS Environment-65 © 2007 BEA Systems, Inc. 203
WLS Managed Objects
Managing and Monitoring a WLS Environment-66 © 2007 BEA Systems, Inc. 204
WLS Traps
Managing and Monitoring a WLS Environment-67 © 2007 BEA Systems, Inc. 205
SNMP and WLS MBeans
MBeans MIB
Managing and Monitoring a WLS Environment-68 © 2007 BEA Systems, Inc. 206
WLS SNMP Management Tools
Managing and Monitoring a WLS Environment-69 © 2007 BEA Systems, Inc. 207
SNMP Vendors
Managing and Monitoring a WLS Environment-70 © 2007 BEA Systems, Inc. 208
Section Review
Managing and Monitoring a WLS Environment-71 © 2007 BEA Systems, Inc. 209
Road Map
1. Remote Administration
2. Logs and Monitoring
3. SNMP Concepts
4. WLS SNMP Agent
– Activating the SNMP Agent
– Registering Managers to Receive Traps
– Setting Up Traps
5. WLS SNMP Management Tools
6. Network Channels
Managing and Monitoring a WLS Environment-72 © 2007 BEA Systems, Inc. 210
Turning On the WLS SNMP Agent
Managing and Monitoring a WLS Environment-73 © 2007 BEA Systems, Inc. 211
Registering Managers for Traps
Managing and Monitoring a WLS Environment-74 © 2007 BEA Systems, Inc. 212
Creating User-Defined Traps
Managing and Monitoring a WLS Environment-75 © 2007 BEA Systems, Inc. 213
Section Review
Managing and Monitoring a WLS Environment-76 © 2007 BEA Systems, Inc. 214
Road Map
1. Remote Administration
2. Logs and Monitoring
3. SNMP Concepts
4. WLS SNMP Agent
5. WLS SNMP Management Tools
– Overview
– Using snmpwalk and snmptrapd
6. Network Channels
Managing and Monitoring a WLS Environment-77 © 2007 BEA Systems, Inc. 215
SNMP Tools
Managing and Monitoring a WLS Environment-78 © 2007 BEA Systems, Inc. 216
Getting All Objects In a Branch
Syntax:
Arguments:
port The port for the trap notifications; see agent‟s configuration. The default is 161.
community The password-like identifier that this manager tool will use. The default is „public.‟
host The address of the agent to poll.
OID The full numeric object identifier of the branch to traverse.
10
0101
1110
Managing and Monitoring a WLS Environment-79 © 2007 BEA Systems, Inc. 217
Listening to Trap Notifications
Syntax:
Arguments:
port The port for the trap notifications; see agent‟s configuration. The default
is 162.
community The password-like identifier which this manager tool will use. The
default is „public‟.
10
0101
1110
Managing and Monitoring a WLS Environment-80 © 2007 BEA Systems, Inc. 218
Example: Polling an Object
OID root for jvmRuntimeOSName
“Complete” OID
Managing and Monitoring a WLS Environment-81 © 2007 BEA Systems, Inc. 219
Example: Catching a Trap
Managing and Monitoring a WLS Environment-82 © 2007 BEA Systems, Inc. 220
Section Review
Managing and Monitoring a WLS Environment-83 © 2007 BEA Systems, Inc. 221
Exercise
Lab Exercise
Managing and Monitoring a WLS Environment-84 © 2007 BEA Systems, Inc. 222
Road Map
1. Remote Administration
2. Logs and Monitoring
3. SNMP Concepts
4. WLS SNMP Agent
5. WLS SNMP Management Tools
6. Network Channels
– Addressing Features
– Administration Port
Managing and Monitoring a WLS Environment-85 © 2007 BEA Systems, Inc. 223
Network Addressing Features…
Managing and Monitoring a WLS Environment-86 © 2007 BEA Systems, Inc. 224
…Network Addressing Features
Machine Machine
Default Channel
NIC1 Server A NIC1
Channel 1
Server C
Default Channel
NIC2 Server B NIC2
Channel 2
Managing and Monitoring a WLS Environment-87 © 2007 BEA Systems, Inc. 225
Network Channels
Network channels:
– Define a set of basic attributes of a network connection to
WLS.
– Can assign multiple channels to a single server (segment
network traffic).
– Can prioritize internal (non-URL) connections.
– Can separate incoming client traffic from internal server to
server traffic in a domain.
• “Default” channel gets generated when a server is created.
Managing and Monitoring a WLS Environment-88 © 2007 BEA Systems, Inc. 226
Configuring Network Channels
Managing and Monitoring a WLS Environment-89 © 2007 BEA Systems, Inc. 227
Using Channels Example 1
Server A
Multiple NICs per server NIC_A1
StandardChannel 192.168.1.100 8001
– Each server has 2 NICs.
NIC_A2
– Each NIC has one channel, SecureChannel 192.168.1.101 8002
Managing and Monitoring a WLS Environment-90 © 2007 BEA Systems, Inc. 228
Using Channels Example 2
Servlet EJB
NIC
ClientChannel 192.168.1.100
NIC NIC
192.168.1.105 AppChannel AppChannel 192.168.1.200
Managing and Monitoring a WLS Environment-91 © 2007 BEA Systems, Inc. 229
Administration Port…
Managing and Monitoring a WLS Environment-92 © 2007 BEA Systems, Inc. 230
…Administration Port
Managing and Monitoring a WLS Environment-93 © 2007 BEA Systems, Inc. 231
Override Administration Port
Managing and Monitoring a WLS Environment-94 © 2007 BEA Systems, Inc. 232
Section Review
Managing and Monitoring a WLS Environment-95 © 2007 BEA Systems, Inc. 233
Exercise
Lab Exercise
Managing and Monitoring a WLS Environment-96 © 2007 BEA Systems, Inc. 234
Module Review
Managing and Monitoring a WLS Environment-97 © 2007 BEA Systems, Inc. 235
Module 5
Basic Deployment
1. Web Servers
– Web Servers Defined
– HTTP
– Static and Dynamic Content
2. Web Applications
3. EJB Applications
4. Enterprise Applications
5. Deployment
Indicating success:
The default status code is 200, which indicates success.
Reason for failure:
A status code of 404 tells the client the requested resource was not found.
Providing alternate behavior:
If a browser receives a 401 status code, the browser can prompt the user for an ID
and password to login. WLS 10 is a full-featured Web server.
1. Web Servers
2. Web Applications
– Web Applications
– Directory Structure and Deployment Descriptors
– Using the Console to Deploy Web Applications
– Monitoring Web Applications
3. EJB Applications
4. Enterprise Applications
5. Deployment
</weblogic-web-app>
Static Resources:
HTML, text images
Deployment
Descriptiors
HTML
HTML
HTML
XML
web.xml
weblogic.xml
jar .war
JSP
JSP
JSP
JSPs
Servlet
Servlets, JavaBeans
and other classes
Basic Deployment-19 © 2007 BEA Systems, Inc. 255
URLs and Web Apps
Virtual directories:
– Can be used to refer to physical directories
– Let you avoid the need to hard-code paths to physical
directories
– Allow multiple Web applications to share common physical
directories for specific requests such as images
– Decrease duplication of files across applications
– Are configured in weblogic.xml
1. Web Servers
2. Web Applications
3. EJB Applications
– Major EJB Types and Their Purpose
4. Enterprise Applications
5. Deployment
Represent a player’s
Represent persisted data statistics
Entity
Are synchronous Represent a stock’s
history
Message Asynchronous & stateless
Store logging messages
Driven Consume JMS messages
J2EE Modules
Basic Deployment-33 © 2007 BEA Systems, Inc. 269
Why Enterprise Applications?
1. Web Servers
2. Web Applications
3. EJB Applications
4. Enterprise Applications
5. Deployment
– Auto-deployment
– Console Deployment
– Command-line Deployment
10
11
weblogic.Deployer Syntax:
% java weblogic.Deployer [options]
[-deploy|-undeploy|-redeploy|-start|-stop|-listapps]
[file(s)]
10
0101
1110
weblogic.Deployer Examples:
appname = "mbeanlister"
applocation = "c:/domains/dizzyworld/apps/mbeanlister"
# Start deploy
print 'Deploying application ' + appname
deploy(appname, applocation, targets='myserver',
planPath='c:/myapps/plan/plan.xml')
print 'Done Deploying the application '+ appname
exit()
Lab Exercise
Understanding JNDI
1. Introduction to JNDI
– What Are Directory and Naming Services and How Do
They Work
– The High-level Architecture of JNDI
– Viewing JNDI Tree via the Administration Console and
the Command Line
2. Startup and Shutdown Classes
Written by
Application Code Developer
JNDI API
Naming Manager JNDI API
JNDI SPI
WLS LDAP File Sys DNS
Other Purchased
Driver Driver Driver Driver
Objects
method for mapping identifiers to
entities or objects: ID2
ID3
ID4
Naming Service vocabulary:
Context “B”
is bound to
A B Initial Context
O1
Object “O1”
is bound to
Initial C
Context O2 O3 O3 O4
Object “O2” Object “O3”
is bound to is bound to both
Context “A” Context “A” and “B”
Understanding JNDI-7 © 2007 BEA Systems, Inc. 311
Contexts and Subcontexts
4 5
wls:/base_domain/serverConfig> jndi()
wls:/base_domain/jndi> cd('AdminServer')
wls:/base_domain/jndi/AdminServer> ls()
dr-- ejb
dr-- javax
dr-- weblogic
-r-- cgDataSource weblogic.rmi.cluster.ClusterableRemoteObject
-r-- cgDataSource-nonXA weblogic.rmi.cluster.ClusterableRemoteObject
-r-- mejbmejb_jarMejb_EO weblogic.rmi.cluster.ClusterableRemoteObject
-r-- samplesDataSource weblogic.rmi.cluster.ClusterableRemoteObject
10
0101
1110
1. Introduction to JNDI
2. Startup and Shutdown Classes
– What Are Startup and Shutdown Classes and How
Do They Work
– Deploying a Startup or Shutdown Class Using the
Administration Console
3
4
Lab Exercise
Setting Up JDBC
At the end of this module you will be able to:
Describe the high level architecture of JDBC
List the four driver types and those provide by WLS
Describe and configure Data Sources
Use the administration console to manage JDBC
resources
1. Overview of JDBC
– High Level Architecture of JDBC and the Driver Model
– Four Different Driver Types
– Differences Between Two-tier and Multi-tier Models
– Drivers Provided by WebLogic Server
2. Data Sources
3. Monitoring and Testing Data Sources
Data
Client
Java Application
JDBC API
JDBC-ODBC JDBC-Native JDBC-Net All Java
Bridge Bridge Bridge JDBC Driver
(Type 1) (Type 2) (Type 3) (Type 4)
ODBC Native API
Driver (C, C++)
Network
Server
DBMS
1. Overview of JDBC
2. Data Sources
– Describe a Data Source and How It Works
– Use the Administration Console to Create a Data Source
3. Monitoring and Testing Data Sources
« DataSource»
: Connection
« Component» : Connection
JNDI
3 getConnection()
DBMS
Connection 5 Database Access
2
1
10
11
12
13
14
15
16
17
18
Setting Up JDBC-25 © 2007 BEA Systems, Inc. 351
Creating a Data Source: Test Database
Connections & Select Targets
20
19
22
21
jdbc:<subprotocol>:<subname>
Where:
<subname> identifies the data source. The subname can vary depending on
the subprotocol
10
0101
1110
jdbc:pointbase:server://dbhost:9092/HRDATABASE
jdbc:oracle:thin:@dbhost:1521:SALESINFO
10
0101
1110
JNDI
JDBC Conn. Pool
Multi Data Source
« DataSource»
: Connection
« Component»
JDBC Conn. Pool
« DataSource»
1. Overview of JDBC
2. Data Sources
3. Monitoring and Testing Data Sources
– Monitoring
– Testing
Lab Exercise
Distribution 3
Sender Receiver
Queue
1
9 8 7 6 5 4 Receiver
Queue Manager 2
Sender Receiver
WebLogic Server
Distribution
Publisher 3 2 1
Topic Subscriber
9 8 7 6 5 4
3 2 1
Subscriber
Topic Manager
Publisher 3 2 1
WebLogic Server
Subscriber
Client WLS
lookup
ConnectionFactory ConnectionFactory 1
Destination: Topic
JMS Server
4Create a Session
Session
To send messages,
these are required:
Look up a Destination 3 - Connection
Destination
- Session
- Destination
Destination Returned 4
Connection
5
Session
Message
Destination Destination: Topic
Client
Database
Producer Consumer
Queues
Queues
Queues
JMS Client JMS Client
Topics JMS
Topics
Topics Server A
JMS Client JMS Client
… Queues
Queues …
Queues
JMS Client Topics JMS JMS Client
Topics
Topics Server B
WebLogic Server
Persistence
config.xml
«deploy»
«EAR»
«weblogic-
application.xml DD»
«demo-jms.xml»
«MyJMSDescriptor-
jms.xml»
System Module
Application Module
A connection factory:
– Encapsulates connection configuration information
– Is used to create pre-configured connections
– Is stored in JNDI
– Can be targeted to servers or clusters
WLS provides a default connection factory that is
bound in JNDI to weblogic.jms.ConnectionFactory.
When a new configuration is required, a new
connection factory can be created.
1
2
11
10
2`
Topic A Associated
Publisher Client
(A Durable Subscription) with
Persistent Store
Database or File
JMS Server
Managing Transactions
Application 1
$500
Account 1 -$100
1) Withdraw: $100
$400
B ATM
Transfer: $100
Bank
Failed Account 2
From: Acct 1 Deposit $1000
To: Acct 2
XA
RM1
Transaction
Client
Manager RM2
XA
Resource
Manager Database
XA
Transaction XA Resource
Application Printer
Manager Manager
XA Resource Another
Manager App
Transaction Context started by Transaction Manager
pre-commit Resource
Application Manager Database
Transaction Resource
Printer
Manager Manager
Resource Another
TLOG Manager App
ready
Phase 1
Phase 2
commit Resource
Manager Database
Application
Transaction Resource
Printer
Manager Manager
Resource Another
TLOG committed Manager App
pre-commit Resource
Application Manager Database
Transaction Resource
Printer
Manager ready Manager
Resource Another
TLOG not Manager App
ready
Phase 1
Phase 2
abort Resource
Manager Database
Application
Transaction Resource
Printer
Manager Manager
Resource Another
TLOG Manager App
Unregister Resource Grace Specifies the grace period, in seconds, that the
Period transaction manager waits for transactions
involving the resource to complete before
unregistering a resource
Security Interoperability Mode Specifies the security mode to use for XA calls in
inter-domain transactions
Producer Consumer
Lab Exercise
Securing WLS Resources and Applications-1 © 2007 BEA Systems, Inc. 461
Road Map
Securing WLS Resources and Applications-2 © 2007 BEA Systems, Inc. 462
Architecture Goals
Securing WLS Resources and Applications-3 © 2007 BEA Systems, Inc. 463
Security Architecture
Client Client
Securing WLS Resources and Applications-4 © 2007 BEA Systems, Inc. 464
Process Architecture
Directory Service
Agent (LDAP)
Web Server
HTTP(s) MBeans JNDI
Connection Filter
Proxy
Plug-in
Web Client
HTTP(s)
Security Service
Securing WLS Resources and Applications-5 © 2007 BEA Systems, Inc. 465
Road Map
Securing WLS Resources and Applications-49 © 2007 BEA Systems, Inc. 509
What Is SSL?
Securing WLS Resources and Applications-50 © 2007 BEA Systems, Inc. 510
Trust and Identity
Securing WLS Resources and Applications-51 © 2007 BEA Systems, Inc. 511
Using an SSL Connection
Securing WLS Resources and Applications-52 © 2007 BEA Systems, Inc. 512
Enabling Secure Communication
Securing WLS Resources and Applications-53 © 2007 BEA Systems, Inc. 513
WebLogic Server SSL Requirements
Securing WLS Resources and Applications-54 © 2007 BEA Systems, Inc. 514
The keytool Utility
Securing WLS Resources and Applications-55 © 2007 BEA Systems, Inc. 515
Obtaining a Digital Certificate:
keytool Examples
Generate a CSR:
keytool –certreq -v –alias dwkey –file dw_cert_request.pem
-keypass dwkeypass -keystore dw_identity.jks
–storepass dwstorepass
Securing WLS Resources and Applications-56 © 2007 BEA Systems, Inc. 516
Configuring SSL for a WebLogic
Server
Securing WLS Resources and Applications-57 © 2007 BEA Systems, Inc. 517
Configuring Keystores
Securing WLS Resources and Applications-58 © 2007 BEA Systems, Inc. 518
Section Review
Securing WLS Resources and Applications-59 © 2007 BEA Systems, Inc. 519
Exercise
Configuring SSL
In this lab you are going to configure Secure Socket
Layer.
Ask the instructor for any clarification.
The instructor will
determine the stop time.
Lab Exercise
Securing WLS Resources and Applications-60 © 2007 BEA Systems, Inc. 520
Road Map
Securing WLS Resources and Applications-61 © 2007 BEA Systems, Inc. 521
Protecting Against Attacks
Securing WLS Resources and Applications-62 © 2007 BEA Systems, Inc. 522
Man in the Middle Attacks
Man in
the Middle
Host
Client
Server
Securing WLS Resources and Applications-63 © 2007 BEA Systems, Inc. 523
Man in the Middle Countermeasures
Securing WLS Resources and Applications-64 © 2007 BEA Systems, Inc. 524
Configuring Hostname Verifier
Securing WLS Resources and Applications-65 © 2007 BEA Systems, Inc. 525
Denial of Service Attacks
Securing WLS Resources and Applications-66 © 2007 BEA Systems, Inc. 526
DoS Countermeasures
Securing WLS Resources and Applications-67 © 2007 BEA Systems, Inc. 527
Filtering Network Connections
Securing WLS Resources and Applications-68 © 2007 BEA Systems, Inc. 528
Connection Filter
Securing WLS Resources and Applications-69 © 2007 BEA Systems, Inc. 529
Consuming WLS Resources
Securing WLS Resources and Applications-70 © 2007 BEA Systems, Inc. 530
Large Buffer Attacks…
Securing WLS Resources and Applications-71 © 2007 BEA Systems, Inc. 531
…Large Buffer Attacks
Securing WLS Resources and Applications-72 © 2007 BEA Systems, Inc. 532
Connection Starvation…
Securing WLS Resources and Applications-73 © 2007 BEA Systems, Inc. 533
…Connection Starvation
Securing WLS Resources and Applications-74 © 2007 BEA Systems, Inc. 534
User Lockout
Securing WLS Resources and Applications-75 © 2007 BEA Systems, Inc. 535
Configuring User Lockout
Securing WLS Resources and Applications-76 © 2007 BEA Systems, Inc. 536
Unlocking Users
Securing WLS Resources and Applications-77 © 2007 BEA Systems, Inc. 537
Protecting the Admin Console…
Securing WLS Resources and Applications-78 © 2007 BEA Systems, Inc. 538
…Protecting the Admin Console
Securing WLS Resources and Applications-79 © 2007 BEA Systems, Inc. 539
Section Review
Securing WLS Resources and Applications-80 © 2007 BEA Systems, Inc. 540
Exercise
Lab Exercise
Securing WLS Resources and Applications-81 © 2007 BEA Systems, Inc. 541
Module Review
Securing WLS Resources and Applications-82 © 2007 BEA Systems, Inc. 542
Module 12
Introduction to Clustering
At the end of this module, you will be able to:
Understand the uses of a cluster
Describe the basic cluster architecture
Describe the multi-tier cluster architecture
Understand how clusters communicate
1. Cluster Architecture
– Cluster Definition
– Basic Cluster Architecture
– Multi-tier Cluster Architecture
– Proxy Servers
2. Networks and Clusters
3. Cluster Communication
server 1
web ejb
container container
Load
Balancer server 2
web ejb
container container
Firewall Cluster
The web tier and the business logic with services can
be separated into two clusters.
domain
server 1 server 3
web EJB
container container
Load
Balancer
server 2 server 4
web EJB
container container
domain
server 1
HTTP Servlet/ ejb
container
Server JSP
Load Plug-in
Balancer
server 2
HTTP
Servlet/ ejb
Server container
JSP
Plug-in
Firewall
Cluster
server 1 server 3
web ejb
HTTP container container
Server
HttpClusterServlet:
– Is deployed in the default
Web application of the
proxy server domain
server
client
Internet WLS Proxy Server
client HttpClusterServlet server
server
client
Plug-ins:
– Delegate dynamic content requests to WLS
– Round-robin across a cluster
– Support routing based on the URL path or on MIME type of
the requested file or both
– Route HTTP requests to back-end WLS instances based on
session cookie or URL rewriting
– Avoid failed servers in the cluster
1. Cluster Architecture
2. Networks and Clusters
– Local Area Networks
– Metropolitan Area Networks
– Wide Area Networks
3. Cluster Communication
1. Cluster Architecture
2. Networks and Clusters
3. Cluster Communication
– One-to-many communications
– Peer-to-peer communications
Configuring a Cluster
At the end of this module, you will be able to:
Prepare your environment for a cluster
Create and configure a cluster
Create and configure a proxy server
<license
component="Cluster"
cpus="unvalued"
expiration="never"
ip="any"
licensee="BEA Internal Development"
serial="616351266349-1844896394531"
type="SDK"
units="5"
signature="MC0CFQCQrk+Kbddfz3RHVH6uGfj"
/>
1
2
connect('system','weblogic', 't3://localhost:7001')
edit()
startEdit(-1,-1,'false')
cd('/')
cmo.createCluster('dizzyworldCluster')
cd('/Clusters/dizzyworldCluster')
set('MulticastAddress','239.192.0.0')
set('MulticastPort','7050')
cd('/')
cd('/Servers/dizzy1')
cmo.setCluster(getMBean('/Clusters/dizzyworldCluster'))
cd('/Servers/dizzy2')
cmo.setCluster(getMBean('/Clusters/dizzyworldCluster'))
cd('/Servers/dizzy3')
cmo.setCluster(getMBean('/Clusters/dizzyworldCluster'))
activate()
disconnect()
exit()
1
011
HttpClusterServlet Declaration:
<servlet>
<servlet-name>HttpClusterServlet</servlet-name>
<servlet-class>
weblogic.servlet.proxy.HttpClusterServlet
</servlet-class>
… …
</servlet>
10
0101
<web.xml> 1110
</servlet>
10
0101
<web.xml> 1110
<servlet-mapping>
<servlet-name>HttpClusterServlet</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
10
0101
<web.xml> 1110
<IfModule mod_weblogic.c>
WebLogicCluster
127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7
007
</IfModule>
<Location /weblogic>
SetHandler weblogic-handler
WebLogicCluster
127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
DebugConfigInfo ON
PathTrim /weblogic
</Location>
Create a Cluster
For details on the exercise, refer to the Lab Guide.
If questions arise, ask the instructor.
The instructor will determine the stop time.
Managing Clusters
At the end of this module, you will be able to:
Deploy applications to a cluster
Manage session state in a cluster
Troubleshoot a cluster
Application (Version 1)
Application (Version 2)
Server A
Application Deployed
(Version 2)
Application (Version 1)
Application (Version 2)
Server B
Cluster
Yes Yes 1
No Yes 2
Yes No 3
No No 4
Server 1
Server 1
Primary
Primary
Server 2
Server 2
Primary
Secondary
Server 3 Server 3
Secondary
Cluster Cluster
Before After
domain
machine 1
X
server A
servlet
primary
Load X state
Balancer machine 2
server B server C
servlet servlet
client primary secondary
state state
Firewall Cluster
Cookie
Primary: server A
Secondary: server B
10
0101
1110
<weblogic.xml>
10
0101
<weblogic.xml> 1110
Replication Channel
Cluster A Cluster B
Domain A Domain B
Clustering Services
At the end of this module, you will be able to:
Set up whole server migration
Understand JNDI clustering
Understand JDBC clustering
Migrate a JMS server
Migrate transactions
1. Clustering Services
– Clusterable Services
– Service Level Migration
– Server Level Migration
2. JNDI
3. JDBC
4. Transactions
5. JMS
Migratable servers
– Managed servers that host pinned services
Cluster master
– One server instance that orchestrates the process of automatic server
migration
Target machines
– Allowable or preferred hosts for migratable servers
Node Manager
– A process that starts and stops server instances
Lease table
– A database table where migratable servers persist their state information
Administration Server
– Configures migratable servers and target machines as well as obtains the
state of migratable servers and orchestrates the manual migration process
Start cluster
Contact NM
Start MS1
Obtain configuration
Cache
Config
Obtain migratable server leases and cluster master lease
Renew leases (periodically)
Contact NM
Start MS2
Obtain configuration
Cache
Config
Obtain migratable server leases
Renew leases (periodically)
Obtain configuration
Obtain lease
Cache config
Initiate manual
migration
Contact NM
Stop Managed
Server 2
Give up lease
Contact NM
Start Managed
Server 2
Obtain configuration
Cache
config
1. Clustering Services
2. JNDI
– Cluster-Wide JNDI Server
– JNDI Naming Conflicts
3. JDBC
4. Transactions
5. JMS
JNDI
server B
Cluster
1. Clustering Services
2. JNDI
3. JDBC
– JDBC Clustering
– Clustering vs. Multi-Data Sources
– Targeting a Data Source to a Cluster
4. Transactions
5. JMS
When you target a JDBC data source, a new instance of the data
source is created on the target.
– Single server target—a data source instance is created on the server.
– Cluster target—a data source instance is created on all member servers in
the cluster.
1 2
1. Clustering Services
2. JNDI
3. JDBC
4. Transactions
– Transaction Recovery Service
– Migrating JTA
5. JMS
1. Clustering Services
2. JNDI
3. JDBC
4. Transactions
5. JMS
– Clustering JMS
– Distributed Destinations
– JMS Failover
...
s1 s3 m9 m8 m3 queue
Q
s2 Receivers
JMS ServerB
r1
Dest3
...
m7 m5 m4 queue r2
Q
r3
WebLogic Server 2
JNDI Tree r4
Dest1 JMS ServerC
Dest2
Dest3 ...
Dest4 m6 m2 m1 queue
Q
...
p1 p3 m3 m2 m1 topicT
p2 Subscribers
JMS ServerB
s1
...
Dest3 s2
m3 m2 m1 topicT
s3
WebLogic Server 2
JNDI Tree s4
Dest1 JMS ServerC
Dest2 ...
Dest3
Dest4 m3 m2 m1 topicT
...
s1 s3 m6 m3 m2 queue
Q
s2
JMS ServerB
r1
Dest3 X queueQ
r3
WebLogic Server 2
JNDI Tree r4
Dest1 JMS ServerC
Dest2
Dest3 ...
Dest4 m5 m4 m1 queue
Q
Ed.Lab:
– Is an extensible Java framework used to install and execute
labs and demos within BEA courses
– Allows students and instructors to concentrate on a lab’s
learning objectives, not on its infrastructure
– Maximizes a student’s time to complete an exercise
– Avoids course-specific setup instructions and scripts
– Supports both Windows and Linux
Ed.Lab consists of the following components:
– Course Installer
– Lab Framework
3
1 «Ant»
«Ant» «Ant» «Ant»
«Ant» :Task
«Ant»
build.xml dispatcher.xml :Task
build.xml :Task
2
edlab.properties
:Event Handlers
:Tasks
jdkhome=d\:\\bea100\\jdk150_06
beahome=d\:\\bea100 Initialized by Installer
wlhome=d\:\\bea100\\wlserver_10.0
event.setup_exercise.path=exercise
handler.handler2=domainbackupwork,appbackupwork,setcurrentlab,
initdomain,startdb,startserver
Assign tasks
task.domainbackupwork=tasks/domain/backup_work.xml to handlers
task.appbackupwork=tasks/app/backup_work.xml
task.setcurrentlab=tasks/misc/set_current_lab.xml
task.initdomain=tasks/domain/init_domain.xml Register task
task.startdb=tasks/db/start_db.xml Ant scripts
task.startdb.db1.url=jdbc:pointbase:server://localhost:9093/demo
...
1
011
<edlab.properties>
Introduction to BEA Ed.Lab-21 © 2007 BEA Systems, Inc. 839
Section Review
Virtual Host
Virtual hosts:
– Have one or more Web addresses associated with them
(Domain name and IP address)
– Allow you to make one Web server behave as if it were
multiple servers
Virtual hosting can be used to allow one Web server to
host multiple internal and external corporate sites.
It is often convenient to have the same Web server
respond to requests for more than one domain name.
Web Web
App 1 App 2
VirtualHost1 Web
App 3
VirtualHost2
Web Web
App 4 App 5
WLS
2
1
3
Virtual Host Application