You are on page 1of 683

Module 1

BEA Systems, Inc.

BEA WebLogic Server 9/10: System Administration
Course WLS-A11-100-01
Overview-1 © 2007 BEA Systems, Inc. 1

Skills Learned
 At the end of this course, you will be learn about

installing and configuring WebLogic Server 10 by:
– – – – – – – – – – – Setting up the WebLogic Server Environment Configuring a WebLogic Server Environment Managing and Monitoring a WebLogic Server Environment Understanding JNDI Deploying Applications Setting up JDBC Setting up JMS Applications Managing Transactions Securing WebLogic Server Resources and Applications Configuring and Managing a Cluster Clustering EJB Objects and Services
© 2007 BEA Systems, Inc. 2


Course Topics
 The course presents: – Core WLS concepts such as domains, machines, managed servers and virtual hosting

– Application Deployment

– Resource management, such as JNDI, JDBC and JMS – Security planning and implementation – Clustering


© 2007 BEA Systems, Inc.


Course Objectives
 At the end of this course you should be able to: – Describe the architecture of WebLogic Server including domains, servers and machines

– Install, configure and use WebLogic Server

– Perform everyday WLS system administration functions for databases, Web sites, application deployments, security and other services – Set up a cluster of servers and distribute applications and resources to the cluster – Take advantage of cluster capabilities such as load balancing and failover


© 2007 BEA Systems, Inc.


Target Audience
 This seminar is targeted to individuals who will be: – Administering WLS application server environment

– Deploying applications


© 2007 BEA Systems, Inc.


 Please tell us about yourself: – Name

– Job responsibility – Experience with BEA products and technologies, and with Java & J2EE – Course objectives


© 2007 BEA Systems, Inc.


Course Schedule…
Session 1: Overview Module

Day 1


2: Setting up a WebLogic Server Environment
3: Configure a WebLogic Server Environment

P.M. A.M. Day 2 P.M. A.M.
Day 3

4: Managing and Monitoring a WebLogic Server Environment

5: Basic Deployment
6: Understanding JNDI 7: Setting up JDBC

8: Setting up JMS Applications 8: Setting up JMS Applications (Contd.) 9: Managing Transactions
10: Securing WebLogic Server Resources and Applications


11: Advanced Deployment
© 2007 BEA Systems, Inc. 9


Course Schedule
Session A.M. P.M. A.M. 12: Introduction to Clustering 13: Configuring a Cluster Module

Day 4

14: Managing Clusters
15: Clustering EJB Objects 16: Clustering Services 17: Virtualization

Day 5


© 2007 BEA Systems, Inc.


Course Workshops
 During the course, you will complete various hands-on

– – – – – – – – Installing and configuring WebLogic Server Monitoring transactions in the Administration Console Setting up JDBC and JMS Setting up users, groups and policies for security Deploying Web, EJB and Enterprise Applications Setting up a cluster Deploying resources to a cluster Load balancing and failing over resources and applications in a cluster
© 2007 BEA Systems, Inc. 11


Module 2

Setting Up a WebLogic Server Environment
At the end of this module you will be able to:
 Explain the motivation behind distributed systems  List the major components of the J2EE specification

 Know the terminology used throughout the course
 Understand WebLogic Server architecture  Install and run WebLogic Server

Setting Up a WebLogic Server Environment-1

© 2007 BEA Systems, Inc.


Road Map
1. Distributed Architecture
– – J2EE Technologies Web and WLS Terms

2. Setting Up a WebLogic Server Environment

Setting Up a WebLogic Server Environment-2

© 2007 BEA Systems, Inc.


The J2EE Standard
 Java Platform 2 Enterprise Edition (J2EE) helps to

overcome distribution liabilities.
 Applications deployed with J2EE technologies are: – Standardized

– Adherent to specification guidelines

– Written in Java – Deployable in any compliant application server

Setting Up a WebLogic Server Environment-5

© 2007 BEA Systems, Inc.


The J2EE Architecture
WebLogic Server J2EE Application Server Directory Service

Web Client

Web Container


EJB Container


Session EJBs Entity EJBs


Client Application
Setting Up a WebLogic Server Environment-6

Java App




Message Queue





Web Service

© 2007 BEA Systems, Inc.


27 .or system-scoped resources – Interoperability with other messaging systems JMS Server Destination Consumer Consumer Consumer Setting Up a WebLogic Server Environment-13 © 2007 BEA Systems.  The interface supports: – – – – – The point-to-point domain The publish/subscribe domain Guaranteed message delivery Transactional participation Dynamically configurable services – Application.Java Message Service (JMS)  JMS is a Java API for Producer Producer accessing message-oriented middleware. Inc.

Inc.JMX  The Java Management Extensions (JMX): – Defines a standard infrastructure to manage a device from Java programs – Decouples the managed device from the management tools  The specification describes MBeans. WebLogic Server Management Tool MBeans MBean MBean MBean MBean Setting Up a WebLogic Server Environment-15 © 2007 BEA Systems. 29 . which are the building blocks of JMX.

Inc. 32 .Proxy Server  Forwards requests to other machines  Can be used as a level of Server A indirection and security  Can be used to load balance a system Client Proxy Server Server B Server C Setting Up a WebLogic Server Environment-18 © 2007 BEA Systems.

and so forth – Can handle CGI requests – Proxy some requests to application servers Web Server Web Server HTTP HTTPS WebLogic Server Plug-in HTTP HTTPS Setting Up a WebLogic Server Environment-20 © 2007 BEA Systems. FTP.Web Server  Web servers: – Provide Web content – Communicate via HTTP. Inc. 34 .

35 .Application Servers  Provide services that WebLogic Server J2EE Application Server Web Container Servlets EJB Container support the execution and availability of deployed applications  Handle heavier processing JSPs chores than Web servers Session EJBs Entity EJBs JAX-RPC RMI-IIOP JDBC JAAS JNDI JMS JMX JTA Setting Up a WebLogic Server Environment-21 © 2007 BEA Systems. Inc.

Inc. 36 .A Web App Server Configuration Firewall Client Firewall Web Server Application Servers Server A Client World Wide Web WLS Plug-In Server B Server C Inner Network Client Your Network Setting Up a WebLogic Server Environment-22 © 2007 BEA Systems.

An Application Server Configuration Firewall Firewall App Server Client App Extranet or Internet Database Client App Local Client App Your Network Setting Up a WebLogic Server Environment-23 © 2007 BEA Systems. Inc. 37 .

test. and production applications – Organizational divisions «server» Setting Up a WebLogic Server Environment-24 © 2007 BEA Systems.  A WebLogic Server «server» «server» domain can logically separate: – Development.  A domain provides one point of administration. Inc. 38 .Definition: Domain  A domain is a logically «domain» «machine» «server» «cluster» «machine» related group of WebLogic Server resources that you manage as a unit.

Inc. for technical or business reasons. test and production applications – Administration and operational responsibilities – Organizational or business divisions Setting Up a WebLogic Server Environment-25 © 2007 BEA Systems. 39 .Why Use Domains?  A domain is an administration feature that: – Is transparent to applications – Can be configured and administered. even after applications are developed or in production  WebLogic Server domains can be used to separate: – Development.

Definition: Server  A server is an instance of «domain» «machine» «machine» weblogic. 40 .  A server: – Runs on a designated WLS machine «server» «cluster» «server» – Has a dedicated amount of RAM – Is multithreaded «server» «server» Setting Up a WebLogic Server Environment-26 © 2007 BEA Systems.Server executing in a JVM. Inc.

41 .xml information and logs for a domain  Runs the WebLogic Administration Console «server» «logs» «machine» «server» «logs» «logs» Setting Up a WebLogic Server Environment-27 © 2007 BEA Systems.Definition: Administration Server  Is the central point of «domain» «machine» «server» «logs» «admin server» control for a domain  Stores the configuration config. Inc.

xml server for configuration information  Runs business «server» «logs» «machine» «server» «logs» «logs» applications in a production environment Setting Up a WebLogic Server Environment-28 © 2007 BEA Systems. 42 . Inc.Definition: Managed Server  Is any server in a domain «domain» «machine» «server» «logs» «admin server» that is not the admin server  Contacts the admin config.

43 . Inc.Definition: Machine  Is a computer that hosts «domain» «machine» «server» «cluster» «machine» WebLogic Server(s)  Runs a supported operating system platform  Can host multiple «server» «server» WebLogic Server instances «server» Setting Up a WebLogic Server Environment-29 © 2007 BEA Systems.

Inc.  WebLogic clusters provide automatic: – High Availability – Load balancing  A cluster is transparent «server» «server» to a client. «server» Setting Up a WebLogic Server Environment-30 © 2007 BEA Systems. 44 .Definition: Cluster  A cluster is a logical «domain» «machine» «server» «cluster» «machine» group of WLS servers.

and maintainability  The ways that standards for distributed systems improve the cost effectiveness of software development projects  The J2EE architecture and many J2EE technologies  The terms used to discuss Web architectures  The terms used to describe WebLogic Server features Setting Up a WebLogic Server Environment-31 © 2007 BEA Systems. Inc.Section Review In this section we discussed:  The ways that distributed systems improve availability. 45 . scalability.

Distributed Architecture 2. 46 .Road Map 1. Setting Up a WebLogic Server Environment – – WebLogic Server Architecture Installing and Running WebLogic Server Setting Up a WebLogic Server Environment-32 © 2007 BEA Systems. Inc.

WebLogic Server Installation  You can install WebLogic Server in three different ways: – Graphical User Interface mode – Console mode – Silent mode  The BEA installer program supports a number of platforms including: – Windows 2000. XP – Sun Solaris – HP-UX – Linux Setting Up a WebLogic Server Environment-33 © 2007 BEA Systems. 47 . Inc. 2003 Server.

Inc. 48 .GUI-mode Installation Read the Welcome Screen Accept the License Agreement Choose a BEA Home Setting Up a WebLogic Server Environment-34 © 2007 BEA Systems.

Choose an Install Type  Select the software to be installed on your system. Setting Up a WebLogic Server Environment-35 © 2007 BEA Systems. 49 . Inc.

Inc. Setting Up a WebLogic Server Environment-36 © 2007 BEA Systems. 50 .Select Optional Tools  Choose the Mercury profiling tool as an option only for the development environment.

51 . Inc.Choose the Product Directory  Choose the target directory for WebLogic Server 10. Installation complete! Setting Up a WebLogic Server Environment-37 © 2007 BEA Systems.

Console-mode Installation
 Console-mode installation is the text-based method of

executing the BEA installation program.
 A WebLogic Server installer for a UNIX platform

takes one of two forms:
– A UNIX-specific Java installer which includes JDK 1.5.0_06
• Has a filename ending in .bin

– A platform-independent Java installer without a JDK
• Has a filename ending in .jar

 The installation steps are similar to GUI-based


Setting Up a WebLogic Server Environment-38

© 2007 BEA Systems, Inc.


Post Installation: BEA Directory
Directory and Files
bea jdk150_06

BEA Home directory Prepackaged 1.5.0_06 JDK/JRE Prepackaged JRockit 1.5.0_06 Default location of user domains Additional/utility JAR files WebLogic Server home directory

user_projects utils wlserver_10.0 license.bea registry.dat UpdateLicense.cmd

License file Record of all installed BEA products
Updates license.bea file

Setting Up a WebLogic Server Environment-39

© 2007 BEA Systems, Inc.


WebLogic Directory Structure
Directory / File
wlserver_10.0 common bin
lib nodemanager templates samples

WLS 10 product components

Files shared by WLS 10 components including template JAR files used by the Configuration Wizard when creating domains

Sample code and resources

server bin
db ext

Server software components Executables
Oracle Database ddl files for v8.1.7 & v9.2.0 XML JAR files, alternative JDBC Drivers, etc WebLogic Server JAR files Code required for uninstalling WLS 10
© 2007 BEA Systems, Inc. 54

lib uninstall
Setting Up a WebLogic Server Environment-40

Samples Directory Structure
Directory / File
samples domains medrec wl_server

Sample code and resources

Sample domains
Sample domain for medrec application Sample domain for wl_server application Sample domain for workshop application


examples medrec

Source code for sample domain examples installed with WebLogic Server

Setting Up a WebLogic Server Environment-41

© 2007 BEA Systems, Inc.


Section Review In this section we discussed:
 WebLogic Server product overview  WebLogic Server installation  The WebLogic Server directory structure

Setting Up a WebLogic Server Environment-42

© 2007 BEA Systems, Inc.


Exercise Install BEA Software
 In this lab you will install WLS and set up your

working environment. You will also run WLS for the first time.
 For details on the exercise, refer to the Lab Guide.  If questions arise, ask the instructor.

 The instructor will determine the stop time.

Setting Up a WebLogic Server Environment-43

© 2007 BEA Systems, Inc.


Exercise Set up the BEA Ed.Lab Environment
 For details on the exercise, refer to the Lab Guide.  If questions arise, ask the instructor.  The instructor will determine the stop time.

Setting Up a WebLogic Server Environment-44

© 2007 BEA Systems, Inc.


Module Review In this module we discussed:
 Distributed architecture and J2EE technologies  Web and WebLogic terminology  WebLogic Server in a Web-based distributed

 How to install and configure WebLogic Server

Setting Up a WebLogic Server Environment-45

© 2007 BEA Systems, Inc.


Module 3

Configuring a WebLogic Server Environment
At the end of this module you will be able to:
 Configure domains, machines, and managed servers  Start the WebLogic Server Administration Console
 Start managed servers at boot time  Set Basic properties using the Administration Console

 Perform basic Administration from the Command Line
 Administer servers and managed servers

Configuring a WebLogic Server Environment-1

© 2007 BEA Systems, Inc.


Road Map

Configuring Domains
– How WebLogic Server Domain works

– Domain Directory Structure and Files – Creating a Domain

Configuring Servers

3. 4.

Domain Templates Console Administration Command Line Administration

Configuring a WebLogic Server Environment-2

© 2007 BEA Systems, Inc.


Domain Overview
 A domain is the basic administration unit for

WebLogic Server.
 A domain always includes one WebLogic Server

instance that is configured as an Administration Server.
 All other optional WebLogic Server instances in a

domain are called Managed Servers.
 A domain may also

include clusters of server instances that work together.

Configuring a WebLogic Server Environment-3

© 2007 BEA Systems, Inc.


Domain Overview
Domain Log

Get Configuration at Startup

Critical Domain Notifications

Managed Server 1

Local Logging


Administration Server

Domain Log Messages

Managed Server 2

Local Logging

Monitor/ Update

Managed Server 3

Configuration Repository
Configuring a WebLogic Server Environment-4 © 2007 BEA Systems, Inc.

Local Logging


Configuring a Domain
 After installation, you configure a WLS domain on

which to develop and deploy applications.  When you create a domain, you define a collection of resources, such as:
– – – – – Managed servers Clusters Database connections Security services J2EE applications

 You use the Configuration Wizard to create and

configure WLS domains.

Configuring a WebLogic Server Environment-5

© 2007 BEA Systems, Inc.


cmd –mode=console – [Unix/Linux] config. –mode=console Configuring a WebLogic Server Environment-6 © 2007 BEA Systems.Starting Configuration Wizard  Scripts in <WEBLOGIC_HOME>/common/bin directory  Graphical mode – Windows Start menu – [Windows] config.cmd – [Unix/Linux] config. 66 .sh  Console mode – [Windows] config.

67 .Configuration Wizard – Graphical Mode  The graphical version of the domain configuration wizard walks the user through each step. Inc. Configuring a WebLogic Server Environment-7 © 2007 BEA Systems.

One subdirectory for each server in the domain. but not yet activated. JAR files added to the classpath of each server instance. Domain-wide security-related files. 0 autodeploy 0 bin 0 config 0 console-ext In development mode. 0 pending 0 security 1 servers Domain configuration changes that have been requested. The server directory for the WLS instance with the same name. 0 init-info 0 lib Domain initialization information. 68 . Inc. The current configuration and deployment state of the domain.Domain Directory Structure Directory 1 domain-name Column Head The name of this directory is the name of the domain.xml. 0 server-name Configuring a WebLogic Server Environment-8 © 2007 BEA Systems. WLS automatically deploys any applications or modules that you place in this directory. The scripts for starting and stopping the Administration Server and the Managed Servers in the domain. Console extensions. config.

Inc.5.  WebLogic Server supports JDK 1.0 Syntax for running a virtual machine: java options FullyQualifiedJavaClass ProgramOptions Some virtual machine options: -Xms The minimum size of the dynamic heap -Xmx The maximum size of the dynamic heap -Dprop=val An environment variable accessible by the program -classpath classpath The list of files/directories containing dependent classes 10 0101 1110 Configuring a WebLogic Server Environment-9 © 2007 BEA Systems.JVM Run-Time Arguments  WebLogic Server can be executed with most Java Virtual Machines. 69 .

70 .WebLogic Server Dependencies  To run WLS. Inc. you must configure: – PATH to include all executable programs (including the Java interpreter) – CLASSPATH to include dependencies  These parameters can be set: – In your computer’s environment settings – In a custom batch file or shell script To see an exhaustive list of DOS environment properties: set To set a DOS environment variable: set VAR_NAME=VALUE 10 0101 1110 Configuring a WebLogic Server Environment-10 © 2007 BEA Systems.

71 . shutdown classes 3rd-party libraries Other common classes 10 0101 1110 Configuring a WebLogic Server Environment-11 © 2007 BEA Systems.jar Any additional service pack jar files (See release notes) Files that can be in the CLASSPATH: %WL_HOME%/common/eval/pointbase/lib/pbclient51.jar JDBC drivers Startup classes.Configuring Your CLASSPATH  The WLS CLASSPATH is completely configured by the Java system CLASSPATH environment variable. Files that must be in the CLASSPATH: %WL_HOME%/server/lib/weblogic.jar %WL_HOME%/common/eval/pointbase/lib/pbtools51. Inc.jar %WL_HOME%/common/eval/pointbase/lib/pbembedded51.jar %WL_HOME%/server/lib/xmlx.

management. Inc.username=%WLS_USER% -Dweblogic. 10 0101 1110 Configuring a WebLogic Server Environment-12 © 2007 BEA Systems.Server class. 72 .home=%WL_HOME% -Dweblogic.policy=%WL_HOME%\server\lib\weblogic.Server Arguments: %SERVER_NAME% .security.The name of the server to start.policy weblogic. Minimal syntax: java -server –Xms256m –Xmx512m -classpath "%CLASSPATH%" -Dweblogic.Starting WebLogic Server  Start WebLogic Server by running the weblogic.Name=%SERVER_NAME% -Dplatform.password=%WLS_PW% -Dweblogic.ProductionModeEnabled=%STARTMODE%

73 .cmd Execute the start script from the appropriate directory! 10 0101 1110 Configuring a WebLogic Server Environment-13 © 2007 BEA weblogic.Example: Starting WLS Directly To start WebLogic Server by hand (Windows): java -server –Xms256m –Xmx512m -classpath "%CLASSPATH%" -Dweblogic.username=system -Dweblogic.password=weblogic -Djava.>startWebLogic.policy=%WL_HOME%\server\lib\ -Dweblogic. To start WebLogic using the default domain script (Windows): c:\>cd bea\user_projects\domains\someDomain c:\.Name=myServer –Dplatform.home=C:\bea\wlserver_10.

74 . Inc.Initial Output Enter password Configuring a WebLogic Server Environment-14 © 2007 BEA Systems.

Inc. 75 .Section Review In this section we discussed:  How a WebLogic Server domain works  The domain directory structure  Domain files  How to create a domain  How to start WebLogic Server from the command line Configuring a WebLogic Server Environment-15 © 2007 BEA Systems.

5. Domain Templates Console Administration Command Line Administration Configuring a WebLogic Server Environment-16 © 2007 BEA Systems. Inc.Road Map 1. Configuring Domains Configuring Servers – Configuring Managed Servers – Starting Managed Servers – Running Multiple WLS Instances 3. 2. 76 . 4.

77 . Inc.Configuring Managed Servers  Managed Servers can be configured using: – Domain Configuration Wizard – Administration Console – Command Line (WLST) 1 2 3 Configuring a WebLogic Server Environment-17 © 2007 BEA Systems.

.168.Starting Managed Servers… Domain Domain Log Get configuration at startup (http/https) Cluster LOG Critical Domain Notifications Get configuration at startup (http/https) ServerA 192.1:7001 LOG Local Logging Admin Server Inc. LOG Local Logging 78 © 2007 BEA Systems.168.1:7002 GET / SET ServerB 192.3:7001 LOG Local Logging Configuration Repository Configuring a WebLogic Server Environment-18 Get configuration at startup (http/https) Proxy 192. <startManagedWeblogic.username=%WLS_USER% -Dweblogic. you must: – Specify a server name – Specify an administration server URL from which to load configuration information To start a managed server: java -server –Xms256m –Xmx512m 1 -Dweblogic.home=C:\bea\wlserver_10.password=%WLS_PW% 2 -Dweblogic.0\server\lib\ 79 .…Starting Managed Servers  To start a managed server.cmd> 10 0101 1110 Configuring a WebLogic Server Environment-19 © 2007 BEA Systems.ProductionModeEnabled=%STARTMODE% -Djava.Name=%SERVER_NAME% -Dplatform.policy weblogic.

Creating a Boot Identity File  Create a file called boot.  Thereafter. Configuring a WebLogic Server Environment-20 © 2007 BEA Systems. Inc. the server reads the Boot Identity file and overwrites it with an encrypted version of the username and password. 80 . the server will remember your identity for the subsequent startup located in the <DOMAIN_HOME>\servers\servername\security directory containing two lines: – username=username – password=password  The first time you start the server.

managed servers can function independently of the administration server.Managed Server Independence…  By default.  You configure the Managed Server Independence mode from the WebLogic Administration Console: Configuring a WebLogic Server Environment-21 © 2007 BEA Systems. Inc. 81 .

dat – boot.xml .xml.…Managed Server Independence  If the administration server is unavailable at boot time. managed servers search for: – config.a replica of the domain's config. 82 . Inc. Configuring a WebLogic Server Environment-22 © 2007 BEA  Each managed server looks in its local config directory for config.xml – SerializedSystemIni.

What If an Admin Server Is Down?  The administration server: – Can go down without affecting the operation of managed servers – Can be restarted while managed servers are still running  When an administration server goes down: – Domain log entries are lost while it is down – Managed servers can start in independent mode – The administration console and management tools are unavailable Configuring a WebLogic Server Environment-23 © 2007 BEA Systems. Inc. 83 .

Inc.Administration Server Backup  WLS allows the creation of a backup of the server as follows: – – – – Install (if necessary) WLS on a backup machine Copy application files to a backup machine Copy configuration files to a backup machine Restart the Administration server on a new machine  The new Administration server will contact managed servers and inform them that it is running on a new IP address. 84 . Configuring a WebLogic Server Environment-24 © 2007 BEA Systems.

Running Multiple WLS Instances  You can run multiple instances of WLS using different configurations on the same physical machine at the same time by either: – Assigning multiple IP addresses to a machine (multihoming) and defining each server to use a unique IP address – Specifying the same IP address but using different listen ports Configuring a WebLogic Server Environment-25 © 2007 BEA Systems. Inc. 85 .

2 Machine Configuring a WebLogic Server Environment-26 © 2007 BEA Systems.168. 86 .1.2. Inc.168.1 192.Multihoming  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.

Inc. 87 .Section Review In this section we discussed:  How to define and start an administration server  How to create and start a managed server  Managed server independence  Administration server backup Configuring a WebLogic Server Environment-27 © 2007 BEA Systems.

5. 2. Configuring Domains Configuring Servers 3.Road Map 1. Console Administration Command Line Administration Configuring a WebLogic Server Environment-28 © 2007 BEA Systems. Inc. 88 . Domain Templates – Creating Customized Domain Templates 4.

you may wish to create your own or customize an existing template. 89 .Custom Domain Templates  A domain template defines the full set of resources within a domain.  Although BEA provides templates for creating any platform domain.  The Domain Template Builder lets you define templates: – Define a domain and replicate it across multiple projects – Distribute a domain packed with an application that has been developed to run in it Configuring a WebLogic Server Environment-29 © 2007 BEA Systems. Inc.

3. Add files to the Template. 90 . Specify Start Menu entries. Username and Password. Create a new template using Domain Template Builder Select Configuration Template Source Describe the template. 6. Add SQL Scripts to the Template Configure the Administration Server. Inc. Review Domain Template Create Template Configuring a WebLogic Server Environment-30 © 2007 BEA Systems. 9. 5. 7. 8. 2.Creating a Domain Template To create a domain template: 1. 4.

Configuring a WebLogic Server Environment-31 © 2007 BEA Systems.Starting Domain Template Builder  Using the GUI mode in Windows environment or  Using script under \common\bin directory. Inc. 91 .cmd or config_builder.

92 .Create a New Template Configuring a WebLogic Server Environment-32 © 2007 BEA Systems. Inc.

Inc.Select Configuration Template Source Configuring a WebLogic Server Environment-33 © 2007 BEA Systems. 93 .

Describe the Template Configuring a WebLogic Server Environment-34 © 2007 BEA Systems. 94 . Inc.

Add Files to the Template Add script to domain Configuring a WebLogic Server Environment-35 © 2007 BEA Systems. Inc. 95 .

Add SQL Files to the Template Configuring a WebLogic Server Environment-36 © 2007 BEA Systems. Inc. 96 .

Inc. 97 .Configure the Administration Server Configuring a WebLogic Server Environment-37 © 2007 BEA Systems.

Inc. 98 .Configure Administrator Username and Password Configuring a WebLogic Server Environment-38 © 2007 BEA Systems.

Inc.Specify Start Menu Entries Configuring a WebLogic Server Environment-39 © 2007 BEA Systems. 99 .

Inc.Replacement Variables Configuring a WebLogic Server Environment-40 © 2007 BEA Systems. 100 .

Review Domain Template Configuring a WebLogic Server Environment-41 © 2007 BEA Systems. 101 . Inc.

Create Template Configuring a WebLogic Server Environment-42 © 2007 BEA Systems. Inc. 102 .

Domain Template Created Configuring a WebLogic Server Environment-43 © 2007 BEA Systems. Inc. 103 .

Inc. 104 . we learned how to:  Understand the benefits of using a custom domain template  Create a custom domain template Configuring a WebLogic Server Environment-44 © 2007 BEA Systems.Section Review In this section.

 The instructor will determine the stop time. ask the instructor.  If questions arise. refer to the Lab Guide.Exercise Create a Domain Template  For details on the exercise. 105 . Inc. Configuring a WebLogic Server Environment-45 © 2007 BEA Systems.

Road Map 1. 4. Command Line Administration Configuring a WebLogic Server Environment-46 © 2007 BEA Systems. Inc. 106 . Domain Templates Console Administration – WebLogic Server Administration Console – Setting Basic Properties via the Console 5. Configuring Domains Configuring Servers 3. 2.

107 .Using the Administration Console  Using the Administration Console you can: – Configure attributes of resources – Deploy applications or components – Configure. Inc. collect and view diagnostic information – Start and shut down servers or perform other management actions Configuring a WebLogic Server Environment-47 © 2007 BEA Systems.

you can start the console in the browser of your choice: Starting the Administration Console: http://hostname:port/console https://hostname:secureport/console (unsecure) (secure) hostname := The name or IP address of the administration server port := The port number the administration server is listening on secureport := The SSL port number the administration server is listening on Example URLs: http://localhost:7001/console http://adminDNSName:7001/console https://127.0.1:7002/console 10 0101 1110 Configuring a WebLogic Server Environment-48 © 2007 BEA Systems. Inc. 108 .Starting the Console  After starting the administration server.0.

Console Login  Enter the user name and password that you set when creating your domain. Inc. 109 . Configuring a WebLogic Server Environment-49 © 2007 BEA Systems.

Using the Console 2 1 Configuring a WebLogic Server Environment-50 © 2007 BEA Systems. 110 . Inc.

111 . Inc.Using the Administration Console… 1 2 Configuring a WebLogic Server Environment-51 © 2007 BEA Systems.

Setting Basic Properties  Changing the Stdout severity threshold: 2 3 1 4 Configuring a WebLogic Server Environment-52 © 2007 BEA Systems. 112 . Inc.

Inc. 113 .Shutting Down a Server 2 1 4 3 Configuring a WebLogic Server Environment-53 © 2007 BEA Systems.

 To display the Advanced Options section.  If you do not want to see the Advanced Options on the console display. click Advanced one more time. 114 . Configuring a WebLogic Server Environment-54 © 2007 BEA Systems. click Advanced. Inc.Advanced Options in Console  The WebLogic Server Administration Console hides options that are not frequently used.

xml is now located (by default) in the user_projects/domains/domain_name/con fig folder. Inc.xml aggregates configuration information from other configuration files representing WLS subsystems.  Subsidiary configuration files are located in subfolders. Configuring a WebLogic Server Environment-55 © 2007 BEA Systems.xml file adheres to an XML schema that can be used for validation. which adhere to their own XML schemas. 115 .xml  The config.XML Schema for config.  config.  config.

Cached configuration information. System modules for the security framework. 116 . Configuring a WebLogic Server Environment-56 © 2007 BEA Systems.Configuration Directory Structure Directory Column Head 1 config 0 configCache 1 deployments 0 diagnostics 0 jdbc 0 jms 0 nodemanager 0 security The current domain configuration and deployment state (config. System modules for JDBC. System modules for JMS. The staging area for staged applications. Inc. System modules for instrumentation in the WebLogic Diagnostic Service. Node Manager configuration information.xml).

regardless of whether you are using: – The WLS Administration Console – The new WebLogic Scripting Tool – JMX  To use change management. use the Change Center region in the WLS Administration Console. and predictably.  Change management behavior is the same. Inc. Configuring a WebLogic Server Environment-57 © 2007 BEA Systems. 117 .Predictable Distribution of Domain Configuration Changes  Change management features of WLS enable you to distribute configuration changes throughout a domain securely. consistently.

– If all servers are able to accept the change.  When you activate changes. Configuring a WebLogic Server Environment-58 © 2007 BEA Systems. you edit a separate hierarchy of Configuration MBeans that resides on the administration server. 118 . centralized in the config. they update their working configuration hierarchy and the change is completed. it's a 2-phase commit (2PC) process: – Each server determines whether it can accept the change. Inc.  The domain configuration is represented two ways: – On the file system by a set of XML configuration files.xml file – At run time by a hierarchy of Configuration MBeans  When you edit the domain configuration.The Configuration Change Process  WLS configuration change management process loosely resembles a database transaction.

xml Edit works on separate copy of files File-based distribution using Administration channel Config. Inc. 119 Configuring a WebLogic Server Environment-59 .xml • Simple beans (not remote) • File-based change distribution • Separation of edit and activation © 2007 BEA Systems.Configuration Management Architecture Administration Server Managed Server edit read read Config.

Section Review In this section we discussed how to:  Start the WLS Administration Console  Set basic properties using the console Configuring a WebLogic Server Environment-60 © 2007 BEA Systems. 120 . Inc.

 Ask the instructor for any clarification. Inc. Lab Exercise Configuring a WebLogic Server Environment-61 © 2007 BEA Systems. 121 .Exercise Using the Administration Console  In this lab you will configure and stop WLS using the console.  The instructor will determine the stop time.

Domain Templates Console Administration Command Line Administration – Managing WebLogic Server via the Command Line WLST Tool Configuring a WebLogic Server Environment-62 © 2007 BEA Systems. 5. 4. Configuring Domains Configuring Servers 3.Road Map 1. 122 . Inc. 2.

xml – Automate configuration tasks and application deployment Configuring a WebLogic Server Environment-63 © 2007 BEA Systems.The WebLogic Scripting Tool (WLST)  Command-line tools are useful: – For automating administration using scripts – As an alternative to the administration console  WLST provides a command-line interface that: – Configures WLS instances and domains – Manages and persists WLS configuration changes  WLST enables you to: – Retrieve domain configuration and run-time information – Edit the domain configuration and persist the changes in config. 123 . Inc.

Inc. supplied one-at-a-time from a command prompt – In a batch supplied in a file (script) or embedded in your Java code Configuring a WebLogic Server Environment-64 © 2007 BEA Systems. 124 . use any existing Java classes)  WLST interprets commands in two ways: – Interactively.Built on Jython  Jython advantages include: – 100% pure Java implementation of Python – Simple and clear syntax – Fast and reliable – Highly extensible (create your own commands.

 Offline (not connected to a running server): – WLST limits access to only persisted configuration information. Inc. Configuring a WebLogic Server Environment-65 © 2007 BEA Systems.Online and Offline Modes  Online (connected to a running server): – WLST provides simplified access to MBeans. – You can perform administrative tasks and initiate WLS configuration changes while connected to a running server. – You can create a new domain or update an existing domain without connecting to a running WLS—this functionality resembles that of the Configuration Wizard. 125 .

Inc.Modes of Operation  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 Configuring a WebLogic Server Environment-66 © 2007 BEA Systems. 126 .

ignoreHostnameVerification=true -Dweblogic.SSL.Deployer – wlconfig Ant tasks – Configuration wizard (silent mode)  It allows you to navigate the WLS MBean tree like a file system.TrustKeyStore=DemoTrust  To access WLST: – In a non-secure environment.WLST – In a secure environment.Admin (deprecated in 9. use: java weblogic.Simplified Command-Line Access  WLST includes the capabilities of: – 127 . use: java -Dweblogic.X) – weblogic. Inc.WLST Configuring a WebLogic Server Environment-67 © 2007 BEA Systems.

128 . Inc.Setting Environment  Install and configure the WebLogic Server software.cmd can be used to set this  Add WL_HOME\server\bin to the PATH environment variable. – DOMAIN_HOME\bin\setDomainEnv. Configuring a WebLogic Server Environment-68 © 2007 BEA Systems.  Add WebLogic Server classes to the CLASSPATH environment variable.

Inc.WLST Example Configuring a WebLogic Server Environment-69 © 2007 BEA Systems. 129 .

 Use arguments enclosed in single or double quotes.  Display help – Example: wls:/mydomain/serverConfig> help(‘disconnect’) Configuring a WebLogic Server Environment-70 © 2007 BEA Systems. – Example: readTemplate(r'c:\mytemplate.WLST Command Requirements  Use case sensitive names and arguments of commands.jar') offline: – Period (.  Precede the quoted string by r while specifying backslash (\) in a string. Inc.) – Forward slash (/) – Backward slash (\)  Note these invalid characters in object names while using WLST  You cannot access security information through WLST while updating a domain. 130 .

Running Scripts  WLST incorporates two Jython functions that support running scripts: – java weblogic.WLST‖) which executes a script file after you invoke WLST Configuring a WebLogic Server Environment-71 © 2007 BEA Inc. 131 . which invokes WLST and executes a script file in a single command – execfile(―filePath.

For example. to connect WLST to a server instance: wl.'password') © 2007 BEA") 2) Open a new command shell and invoke Jython directly by entering the following command: c:\>java org.Import WLST as a Jython Module 1) Invoke WLST: c:\>java weblogic. 132 Configuring a WebLogic Server Environment-72 .WLST wls:/offline> Use the writeIniFile command to convert WLST definitions and method declarations to a file: wls:/offline> writeIniFile("wl.connect('username'. Inc.util.jython 4) Import the WLST module into your Jython module using the Jython import command: >>>import wl 3) 5) Now you can use WLST methods in the module.

c:\> Configuring a WebLogic Server Environment-73 © 2007 BEA Systems.. Inc.. 133 .Exiting WLST Exit WLST: wls:/mydomain/serverConfig> exit() Exiting WebLogic Scripting Tool .

Inc. 134 . ’t3://localhost:7011’) disconnect() disconnect exit readDomain updateDomain Exits WLST (online mode) Opens an existing domain for updating (offline mode) Updates and saves the current domain (offline mode) exit() readDomain('c:/bea/user_pro jects/domains/onlinestore') updateDomain() Configuring a WebLogic Server Environment-74 © 2007 BEA Systems.Some WLST Commands… Command connect Description Connects to a server instance (online mode) Disconnects from a server instance (online mode) Syntax connect(‘weblogic’. ’weblogic’.

’humanresources’. ’Cluster’) startServer(‘adminserver’. ’t3://localhost:7011’) Starts the administration server (offline mode) Resumes a server that is in the ADMIN state (online mode) resume(‘mainserver’) Configuring a WebLogic Server Environment-75 © 2007 BEA Systems. 'Cluster') suspend(‘mainserver’) shutdown(‘myCluster’. Inc.…Some WLST Commands Command start suspend shutdown startServer resume Description Start a managed server instance or a cluster (online mode) Suspends a running server (online mode) Gracefully shuts down a WLS instance or a cluster (online mode) Syntax start('mycluster'. 135 .

Section Review In this section we discussed:  Managing WebLogic Server from the command line Configuring a WebLogic Server Environment-76 © 2007 BEA Systems. Inc. 136 .

 Ask the instructor for any clarification. Inc. Lab Exercise Configuring a WebLogic Server Environment-77 © 2007 BEA Systems.  The instructor will determine the stop time. 137 .Exercise Using Command-line Administration  In this exercise you are going to gain experience using the command-line administration utility.

138 . Inc.Module Review In this module we discussed:  The WebLogic Server Administration Console  Domain concepts  How to create domains  How to create and start the Administration server and managed servers  The creation and use of domain templates Configuring a WebLogic Server Environment-78 © 2007 BEA Systems.

139 . Inc.Module 4 Managing and Monitoring a WebLogic Server Environment At the end of this module you will be able to:  Understand machines and Node Manager  Describe simple logging  Use commands to get attributes from an MBean  Explain basic SNMP concepts  Configure the WLS SNMP agent  Use the WLS SNMP management command-line tools Managing and Monitoring a WLS Environment-1 © 2007 BEA Systems.

Remote Administration – Configuring Machines – Node Manager – Configuring Node Manager 2. Logs and Monitoring 3. SNMP Concepts WLS SNMP Agent WLS SNMP Management Tools Network Channels © 2007 BEA Systems.Road Map 1. 4. 6. 5. Inc. 140 Managing and Monitoring a WLS Environment-2 .

Inc. 141 . a cluster – Is available as either a Java-based or (for UNIX or Linux) a script-based process.Node Manager  Node Manager (NM): – Lets you start and kill managed servers remotely: one server. a domain. as a Windows service or a Unix daemon Managing and Monitoring a WLS Environment-3 © 2007 BEA Systems. – Monitors and acts on server health – Runs on the same computers as the managed servers – Can be run automatically in the background.

Shut Down. Inc. 4. Start. Shut Down.What Node Manager Can Do  You can use Node Manager to: 1. 2. Start. 3. 142 . and Restart Managed Servers. Monitor Servers and collect log data. Managing and Monitoring a WLS Environment-4 © 2007 BEA Systems. Suspend. Automatically Restart Administration and Managed Servers on failure. and Restart an Administration Server.

Node Manager Architecture Machine A WLST Node Manager Admin Console JMX Client Admin Server Node Manager Node Manager Managed Server 1 Machine C Managing and Monitoring a WLS Environment-5 Secure Connection © 2007 BEA Systems. Managed Server 2 Machine B 143 . Inc.

NM creates process for AS Admin Server 3. Inc. NM determines domain directory. 144 . Issues command to start Admin Server WLST Node Manager 4. authenticates user 5. AS obtains domain configuration Machine A Managing and Monitoring a WLS Environment-6 © 2007 BEA Systems.How Node Manager Starts an Administration Server 1. NM obtains startup properties for AS 2.

AS invokes NM. Inc. 145 . provides startup properties Node Manager Machine B Managing and Monitoring a WLS Environment-7 © 2007 BEA Systems. MS1 caches configuration 3. MS1 obtains configuration Admin Server Machine A Managed Server 1 5. NM creates MS1 process 2.How Node Manager Starts a Managed Server Admin Console 1. Issues command to start MS1 4.

AS obtains domain configuration Machine A Managing and Monitoring a WLS Environment-8 © 2007 BEA Systems.startup properties for AS 4. NM creates AS process Admin Server Node 1. Inc. 146 . NM obtains remote start username/ password. NM determines Manager AS needs restart 2.How Node Manager Restarts an Administration Server 3.

MS1 obtains configuration Admin Server Machine A Managed Server 1 (5. NM obtains remote start username/password. NM determines MS1 needs restart Machine B Managing and Monitoring a WLS Environment-9 © 2007 BEA Systems. 147 . NM creates MS1 process Node Manager 2. MS1 obtains cached configuration) 3. startup properties for MS 1 1.How Node Manager Restarts a Managed Server 4. If AS is not Available. Inc.

Inc. NM tries to shut down MS1 Node Manager Managing and Monitoring a WLS Environment-10 © 2007 BEA Systems. Kill MS1 3. AS tries to Shut down MS1 Operating System` 5. 148 . User issues shutdown Command for MS1 Admin Server Machine B 2. AS sends shutdown command for MS1 to NM Managed Server 1 4.How Node Manager Shuts Down a Server Instance Machine A Admin Console 1.

Versions of Node Manager  There are two versions of Node Manager 1. Inc. but provides the ability to remotely manage servers over a network using Secure Shell (SSH). Managing and Monitoring a WLS Environment-11 © 2007 BEA Systems. Java-Based Node Manager 2. 149 . Script-Based Node Manager  Java-based Node Manager runs within a Java Virtual Machine (JVM) process  Script-based Node Manager (used only for UNIX and Linux systems) – Script-based does not have as much security.

 NM should run as an operating system service. and assign each server instance to be controlled by NM to the machine it runs on.Node Manager Configuration  NM must run on each computer that hosts WLS instances that you want to control with NM. Managing and Monitoring a WLS Environment-12 © 2007 BEA Systems. so that it automatically restarts upon system failure or reboot.  You should configure each computer as a machine in WLS. Inc. 150 .

 By default. Node Manger is “ready-to-run” if the Node Manager and Administration Server are on the same machine. 151 . the following behaviors are configured: – The administration console can use the Node Manager to start managed servers. Managing and Monitoring a WLS Environment-13 © 2007 BEA Systems. – Node Manager monitors the Managed Servers that it started. – The automatic restart of Managed Servers is enabled.Node Manager Default Behaviors  After WebLogic Server installation. Inc.

Inc.Configuring Java-Based Node Manager  BEA recommends configuring NM to run as an operating system service. 152 .properties – Configuring Node Manager on multiple machines Managing and Monitoring a WLS Environment-14 © 2007 BEA Systems.  Configuration tasks for Java-based Node Manager include: – Reconfiguring startup service for Windows installation – Daemonizing Node Manager for UNIX systems – Configuring Java-based Node Manager security – Reviewing nodemanager.

Delete the service using uninstallNodeMgrSvc.cmd to reinstall NM as a service. 153 .cmd. Run installNodeMgrSvc.Reconfigure Startup Service for Windows Installation 1. Inc. Managing and Monitoring a WLS Environment-15 © 2007 BEA Systems. listening on the updated address and port. Edit installNodeMgrSvc. 3.cmd to specify NM‟s Listen Address and Listen Port. 2.

Daemonizing NM for UNIX Systems 1. Inc. Reinstall NM daemon. 3. Remove NM daemon process setup from WLS installation. Configure NM: – – – – – – Set WL_HOME Set NODEMGR_HOME Add JDK and WL directories to system path Add JDK and WL jars to classpath Set LD_LIBRARY_PATH Set JAVA_VM – – Set NODEMGR_HOST Set NODEMGR_PORT – Set PROD_NAME=BEA WebLogic Platform 10 © 2007 BEA Systems. 154 Managing and Monitoring a WLS Environment-16 . 2.

Inc. Managing and Monitoring a WLS Environment-17 © 2007 BEA Systems.  The nmConnect command requires a username and password.  WLST uses the nmConnect command to establish a connection to the Java Node Manager.Configuring Java-Based Node Manager Security  NM Security relies on a one-way SSL connection between client and server. 155 . which is verified against the file.

Administration Console NM Security Managing and Monitoring a WLS Environment-18 © 2007 BEA Systems. 156 . Inc.

Inc. – Managed Servers – When you invoke NM to start a Managed Server. 157 . the remote start username come from either the command-line or the boot. – Administration Servers – When you invoke NM to start an Administration file.Remote Server Start Security for JavaBased Node Manager  Credentials for Managed Servers and Administration Servers are handled differently. Managing and Monitoring a WLS Environment-19 © 2007 BEA Systems. it gets its remote username and password from the Administration Server.

properties file. 158 .properties file:  You can specify properties for a Java-based Node Manager process either at the command line or in the nodemanager.  To configure the Node Manager to use a start script. Set the StartScriptEnabled property to true. Inc. Managing and Monitoring a WLS Environment-20 © 2007 BEA Systems.Reviewing nodemanager. 2. in the nodemanager.  Values supplied on the command line take precedence over those in the nodemanager. Set the StartScriptName property to the name of your file.

nmEnroll([domainDir].properties. which contains the encrypted username and password that is used for server authentication – SerializedSystemIni.dat file Managing and Monitoring a WLS Environment-21 © 2007 BEA Systems. 159 .  You can do this with the WLST nmEnroll command to copy all required domain and configuration information from one machine to another. [nmHome])  This command downloads the following files from the Administration Server: – nm_password.Configuring Node Manager on Multiple Machines  Node Manager has to be installed and configured on each machine on which there is a Managed Server. Inc. Script-Based Node Manager  The SSH Node Manager is a shell script.  Configuration tasks for a script-based Node Manager include: – Using SSL with Script-based Node Manager – Creating a Node Manager user – Configuring script-based Node Manager security Managing and Monitoring a WLS Environment-22 © 2007 BEA Systems.  An executable SSH client must reside on each machine where Node Manager or Node Manager client runs. – An SSH client is typically a standard part of a Unix or Linux installation. 160 . located in NM_HOME/common/bin. wlscontrol.

and all Managed Servers. Inc. 161 . identity and trust must be obtained for the Node Manager. Managing and Monitoring a WLS Environment-23 © 2007 BEA Systems. the Administration Server.  To configure SSL for the production environment.Using SSL with Script-based NM  Script-based Node Manager communicates with Administration Servers and Managed Servers using one-way SSL.  The default WLS installation includes demonstration Identity and Trust keystores that allow SSL to be used out of the box.

 You should add this user to all machines that will host the SSH Node Manager and to all machines that will host a Node Manager client. including the Administration Server. you should create a dedicated UNIX user account for performing Node Manager functions. 162 .Creating a Node Manager User  Before running Node Manager. Inc. Managing and Monitoring a WLS Environment-24 © 2007 BEA Systems.

commands without providing a username and password. Inc. 163 .  A user logged in as this user can issue Node Manager Managing and Monitoring a WLS Environment-25 © 2007 BEA Systems.  You create a UNIX user account – typically one per domain – for running Node Manager commands and scripts.Configuring Script-based Node Manager Security  The Node Manager SSH shell script relies on SSH user-based security to provide a secure trust relationship between users on different machines.  Authentication is not required.

Additional Configuration Information  Other Node Manager configuration tasks include: – Configuring a machine to User Node Manager – Configuring nodemanager. 164 .domains file – Configuring remote startup arguments – Ensuring that the Administration Server address is defined – Setting Node Manager environment variables Managing and Monitoring a WLS Environment-26 © 2007 BEA Systems. Inc.

Inc.Configuring a Machine to Use Node Manager  A WLS Machine resource maps a machine with the server instances it hosts. Managing and Monitoring a WLS Environment-27 © 2007 BEA Systems. 165 . provides additional security by restricting Node Manager client access to the domains listed in this file specifies the domains that a Node Manager instance controls. Managing and Monitoring a WLS Environment-28 © 2007 BEA Systems. NM looks up the domain directory from this file. 166 .domains File  The nodemanager.  When a user issues a command for a domain.Configuring the nodemanager.  nodemanager.

Configuring Remote Startup Arguments Managing and Monitoring a WLS Environment-29 © 2007 BEA Systems. Inc. 167 .

168 .Ensuring Administration Server Address Is Defined  You must define a Listen Address for each Administration Server that will connect to the Node Manager process. Inc. Managing and Monitoring a WLS Environment-30 © 2007 BEA Systems.

Setting Node Manager Environment Variables Environment Variable Description JAVA_HOME Root directory of JDK that you are using for Node Manager.0 WL_HOME PATH Must include the WebLogic Server bin directory and path to your Java executable.%PATH% For HP UX and Solaris systems. WebLogic Server installation directory. Windows example: set CLASSPATH=. For example: set JAVA_HOME=c:\bea\jdk1. Solaris example: LD_LIBRARY_PATH:$WL_HOME/server/native/solaris:$WL_HOME/server/lib/solaris/oci816_8 HP UX example: SHLIB_PATH=$SHLIB_PATH:$WL_HOME/server/native/hpux11:$WL_HOME/server/lib/hpux11/oci816_8 LD_LIBRARY_ PATH (UNIX only) CLASSPATH You can set the Node Manager CLASSPATH either as an option on the java command line used to start Node Manager.jar.. For example: set PATH=%WL_HOME%\server\bin.%JAVA_HOME%\bin.5.%WL_HOME%\server\lib\weblogic_sp.jar Managing and Monitoring a WLS Environment-31 © 2007 BEA Systems. 169 .%WL_HOME%\server\lib\weblogic.0_06 Node Manager has the same JDK version requirements as WebLogic Server. or as an environment variable. you must include the path to the native Node Manager libraries. For example: set WL_HOME=c:\bea\wlserver_10. Inc.

state Server log files: Server state files: nm_data.log Server configuration files: boot.hosts Node manager configuration files: nodemanager.out Managing and Monitoring a WLS Environment-32 © 2007 BEA Systems.out server_1 Node Manager Node manager log files nodemanager.state Server log files: server_1.Node Manager Configuration and Log Files Server configuration files: boot.lck server_2 server_2. 170 .properties Server state files: server_2.lck server_1. Inc.

Node Manager Configuration and Log Files  Node Manager config files include: – nodemanager. 171 .properties – – server_name.state  Node Manager log files include: – – nm_data.hosts – nodemanager.lck – server_name.out Managing and Monitoring a WLS Environment-33 © 2007 BEA – – – nm_password. Inc.log – – boot.

Inc.Section Review In this section we discussed:  The way to create a machine definition  The way to target servers to a machine  The benefits of Node Manager  The steps to setting up Node Manager Managing and Monitoring a WLS Environment-34 © 2007 BEA Systems. 172 .

 The instructor will determine the stop time. Lab Exercise Managing and Monitoring a WLS Environment-35 © 2007 BEA Systems.Exercise Configuring Servers and Machines  In this lab you are going to create and configure two machines. Inc. 173 .  Ask the instructor for any clarification.

Inc.  Ask the instructor for any clarification. Lab Exercise Managing and Monitoring a WLS Environment-36 © 2007 BEA Systems. 174 .  The instructor will determine the stop time.Exercise Starting Servers Using Node Manager  In this lab you will use Node Manager to control managed servers.

– Using Log Files – Monitoring Servers SNMP Concepts 4. WLS SNMP Agent 5. WLS SNMP Management Tools 6. Network Channels 3.Road Map Remote Administration 2. 175 . Managing and Monitoring a WLS Environment-37 © 2007 BEA Systems. Inc. Logs and Monitoring 1.

Inc.Using Logs  Logs can aid in the discovery of: – Frequently accessed resources – – – – – – Activity by day and time interval The amount of data sent and received The IP addresses of users accessing the site The number of actual “hits” The problems servicing requests Performance statistics Managing and Monitoring a WLS Environment-38 © 2007 BEA Systems. 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.


Configuring Server Logging

Managing and Monitoring a WLS Environment-40

© 2007 BEA Systems, Inc.


Messages Forwarded to Domain Log

Forwarded to Domain Log by Default

Used for messages from the Diagnostic Action Library.



Used for reporting normal operations.
An informational message with a higher level of importance A suspicious operation or configuration has occurred but it may not have an impact on normal operation. A user error has occurred. The system or application is able to handle the error with no interruption and limited degradation of service. A system or service error has occurred. The system is able 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 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 severe system failure or panic. A debug message was generated.
© 2007 BEA Systems, Inc. 179









Emergency Debug

Yes Yes

Managing and Monitoring a WLS Environment-41

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.>

Timestamp Severity

The time and date when the message originated, in a format that is specific to the locale. Indicates the degree of impact or seriousness of the event reported by the message. This attribute denotes the particular subsystem of WebLogic Server that was the source of the message, for example, EJB, RMI, JMS. These attributes identify the origins of the message.


Machine Name Server Name Thread ID

•Server Name is the name of the WebLogic Server instance on which the

message was generated.
•Machine Name is the DNS name of the computer that hosts the server

•Thread ID is the ID that the JVM assigns to the thread in which the

message originated.
Managing and Monitoring a WLS Environment-42 © 2007 BEA Systems, Inc. 180

…Message Attributes

User ID
Transaction ID Diagnostic Context ID Raw Time Value Message ID Message Text

The user from the security context when the message was generated.
Present only for messages logged within the context of a transaction. Context information to correlate messages coming from a specific request or application. The timestamp in milliseconds. A unique six-digit identifier. Message IDs through 499999 are reserved for WebLogic Server system messages. For WebLogic Server messages, this contains the Short Description as 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.


Log Filters
 Log filters provide control over the log messages that

get published.
– You can filter out messages of a certain severity level, from a particular subsystem, or according to specified criteria
 You can create separate filters for the messages that

each server instance writes to:
– Its server log file

– Standard out – Memory buffer – Domain-wide log

Managing and Monitoring a WLS Environment-44

© 2007 BEA Systems, Inc.


Creating Log Filters
1 2

3 4

Managing and Monitoring a WLS Environment-45

© 2007 BEA Systems, Inc.


Assigning a Log Filter

Managing and Monitoring a WLS Environment-46

© 2007 BEA Systems, Inc.


Message Catalog
 Message catalogs are available in HTML format on e-

docs as part of the documentation deliverable. You can search for messages by error number using the search engine.

Managing and Monitoring a WLS Environment-47

© 2007 BEA Systems, Inc.


Message Catalog

Managing and Monitoring a WLS Environment-48

© 2007 BEA Systems, Inc.


Using the Console to Monitor
 The Administration Console offers some monitoring

Attribute Description
Many of the Console’s objects have a Monitoring tab that allows you to view monitoring information for that object. The monitoring view can be customized by clicking Customize this table…

Managing and Monitoring a WLS Environment-49

© 2007 BEA Systems, Inc.


Monitoring Running Servers



Managing and Monitoring a WLS Environment-50

© 2007 BEA Systems, Inc.


Customizing views
 Columns can be customized on views.

Managing and Monitoring a WLS Environment-51

© 2007 BEA Systems, Inc.


190 . Inc.Monitoring Individual Servers Managing and Monitoring a WLS Environment-52 © 2007 BEA Systems.

Inc. 191 .Section Review In this section we discussed:  Using log files  Monitoring servers Managing and Monitoring a WLS Environment-53 © 2007 BEA Systems.

Architecture. Inc. – – – – 4. 192 . SNMP Concepts 1. MIB. OID SNMP Agent Trap Notifications SNMP Features of WLS WLS SNMP Agent 5. Network Channels Managing and Monitoring a WLS Environment-54 © 2007 BEA Systems.Road Map Remote Administration 2. Logs and Monitoring 3. WLS SNMP Management Tools 6.

193 .  Examples of devices include: – Bridges – Routers – Servers – Printers Managing and Monitoring a WLS Environment-55 © 2007 BEA Systems. Inc.SNMP  The Simple Network Management Protocol (SNMP) is a protocol for managing distributed devices.

194 .  Agents report information to a manager: – On demand (polling) – Automatically (traps) MIBs Agent Management Console Managed Device Managing and Monitoring a WLS Environment-56 © 2007 BEA Systems. Inc.SNMP Architecture  SNMP works by monitoring devices through software known as agents.

 A MIB is a file that: – Contains a list of these objects – Is related to a single device type – Is used by the manager to: • Determine the available objects that can be polled • Make sense of values returned by trap notifications Managing and Monitoring a WLS Environment-57 © 2007 BEA Systems.Management Information Base (MIB)  A “managed object” is a value that can be monitored by an Agent. 195 . Inc.

Inc. 4 Agent returns data to requestor 2 Agent Agent interacts with device to get requested data Managed Device 3 Data is returned to agent Managing and Monitoring a WLS Environment-58 © 2007 BEA Systems.SNMP Polling Management Console MIBs 1 Manager "polls" for a specific managed object (asks for value) SNMP polling is done on UDP port 161. 196 .

Inc.SNMP Traps Management Console MIBs SNMP traps are sent on UDP port 162. 2 Custom trap events may be defined 1 Manager is registered to the agent Agent 4 Alert generated 3 Agent monitors the events Managed Device Managing and Monitoring a WLS Environment-59 © 2007 BEA Systems. 197 .

4 .2 .  The OIDs: – Are represented as dot-separated integers (for example: . 198 .8 Managing and Monitoring a WLS Environment-60 © 2007 BEA Systems.1.0 .OIDs  Each managed object is represented by an .6 .4.1. Inc.3 identifier.140 .1 .3.9 .140 …) – Are hierarchical – Refer to single objects (leaf) or groups (branches) .1 . called the Object IDentifier (OID).1.6.1 .

625.340.1.1. you can query the managed object jvmRuntimeOSName. located under the OID .  All WLS SNMP objects are located on some hierarchical level under the root. for example: To know the current operating system.1.45 Managing and Monitoring a WLS Environment-61 © 2007 BEA Systems.6.3. 199 . Inc.The Root for WLS OIDs  The base for all objects in WLS is: .3.

Managing and Monitoring a WLS Environment-62 © 2007 BEA Systems.  You can locate the OID root for an object and write it down.WebLogic Server 10. 200 .bea.  Your SNMP manager tool can then use this OID root to poll objects under it.0 MIB Reference  You can look up the available managed objects and their OIDs online: – http://e-docs.

0 MIB Reference Managing and Monitoring a WLS Environment-63 © 2007 BEA Systems. 201 .WebLogic Server 10. Inc.

202 .WLS SNMP Support  WLS provides an SNMP Agent that: – Provides monitoring capability to SNMP managers – Generates standard and user-defined trap notification sent to registered managers – Runs inside the administration server (weblogic.Server) – Doesn‟t support the SET operation Managing and Monitoring a WLS Environment-64 © 2007 BEA Systems. Inc.

Inc.WLS SNMP Architecture Request  The WLS SNMP Agent: – Caches its data and refreshes the cache regularly – Has the ability to proxy other SNMP agents SNMP Response Managemet Station Traps SNMP Service (SNMP Agent) GET Cache Proxy Admin Server Request Response Non-WLS SNMP Agent Admin Server Host GET Managed Server Managing and Monitoring a WLS Environment-65 © 2007 BEA Systems. GET Managed Server 203 .

clustering Deployment Applications (enterprise. JMS. 204 . EJB. for example: – – – – – – Domain. Web server.WLS Managed Objects  The WLS MIB supports polling for hundreds of managed objects. Web) Execute queues JDBC. Inc. JTA services JVM information Managing and Monitoring a WLS Environment-66 © 2007 BEA Systems.

205 . counter)  The last three allow user-defined trap notifications monitored by the agent. Managing and Monitoring a WLS Environment-67 © 2007 BEA Systems. Inc. string.WLS Traps  The WLS MIB defines standard trapping notifications for: – – – – – Server start Server shutdown MBean attribute changed Logging notification MBean monitoring notification (gauge.

managed objects map to MBean attributes – User-defined traps test MBean attributes for certain conditions MBeans MIB Managing and Monitoring a WLS Environment-68 © 2007 BEA Systems.SNMP and WLS MBeans  In WLS. 206 . Inc. SNMP and MBeans are closely related because: – Internally.

Inc. or all of them under a branch) – Alert the user of all trap notifications – Generate trap events for testing Managing and Monitoring a WLS Environment-69 © 2007 BEA Systems. 207 .WLS SNMP Management Tools  WLS comes with command-line management utilities that can: – Poll information (one managed object.

SNMP Vendors  Some SNMP management systems compatible with WLS 10 include: – – – – IBM Tivoli HP Openview Sun Domain/SunNet/Site Manager CA Unicenter Managing and Monitoring a WLS Environment-70 © 2007 BEA Systems. 208 . Inc.

Section Review In this section we discussed:  SNMP definitions: – Agent – Manager – Managed object – MIB – OID – Polling – Traps  WLS support for SNMP Managing and Monitoring a WLS Environment-71 © 2007 BEA Systems. Inc. 209 .

Inc. Remote Administration Logs and Monitoring 3. 210 Managing and Monitoring a WLS Environment-72 . 2. WLS SNMP Management Tools Network Channels © 2007 BEA Systems. SNMP Concepts WLS SNMP Agent – Activating the SNMP Agent – Registering Managers to Receive Traps – Setting Up Traps 5. 6. 4.Road Map 1.

211 . Inc.Turning On the WLS SNMP Agent Restart the server! Managing and Monitoring a WLS Environment-73 © 2007 BEA Systems.

212 . Inc.Registering Managers for Traps Managing and Monitoring a WLS Environment-74 © 2007 BEA Systems.

Creating User-Defined Traps Managing and Monitoring a WLS Environment-75 © 2007 BEA Systems. 213 . Inc.

214 . Inc.Section Review In this section we discussed:  Configuring the WLS SNMP Agent  Registering managers to receive traps  Setting up custom traps Managing and Monitoring a WLS Environment-76 © 2007 BEA Systems.

Inc. 5. Remote Administration Logs and Monitoring 3. 2.Road Map 1. 215 . Network Channels Managing and Monitoring a WLS Environment-77 © 2007 BEA Systems. SNMP Concepts WLS SNMP Agent WLS SNMP Management Tools – Overview – Using snmpwalk and snmptrapd 6. 4.

– snmpget: return information from an agent using SNMP GET. 216 . – snmptrapd: receive and dump SNMP traps. Managing and Monitoring a WLS Environment-78 © 2007 BEA Systems.SNMP Tools  WebLogic Server supports five testing tools for testing SNMP: – snmpwalk: return all data using SNMP GET and GETNEXT request for tabular data. Inc. – snmpv1trap: generate a test SNMP trap. – snmpgetnext: return information using SNMP GETNEXT.

Getting All Objects In a Branch  snmpwalk traverses all managed objects in a branch and writes them out. The password-like identifier that this manager tool will use. Inc. The default is „public. 217 . Syntax: java snmpwalk [-p <port>] [-c <community>] <host> <OID> Arguments: port community host OID The port for the trap notifications. see agent‟s configuration. The full numeric object identifier of the branch to traverse.‟ The address of the agent to poll. 10 0101 1110 Managing and Monitoring a WLS Environment-79 © 2007 BEA Systems. The default is 161.

The password-like identifier which this manager tool will use. The default is 162. The default is „public‟. 10 0101 1110 Managing and Monitoring a WLS Environment-80 © 2007 BEA Systems. see agent‟s configuration.Listening to Trap Notifications  snmptrapd listens to trap notifications from an agent and displays them. Syntax: java snmptrapd [-p <port>] [-c <community>] Arguments: port community The port for the trap notifications. Inc. 218 .

Inc. 219 .Example: Polling an Object OID root for jvmRuntimeOSName “Complete” OID Value of this object Managing and Monitoring a WLS Environment-81 © 2007 BEA Systems.

Example: Catching a Trap WLS has started A server has started Managing and Monitoring a WLS Environment-82 © 2007 BEA Systems. 220 . Inc.

Inc.Section Review In this section we discussed:  WLS-provided SNMP management tools  The use of snmpwalk and snmptrapd Managing and Monitoring a WLS Environment-83 © 2007 BEA Systems. 221 .

agents and trap destinations. Lab Exercise Managing and Monitoring a WLS Environment-84 © 2007 BEA Systems.Exercise Using SNMP with WebLogic Server  In this lab you will set up SNMP managers.  Ask the instructor for any clarification.  The instructor will determine the stop time. Inc. 222 .

Road Map 1. Inc. 223 . 5. 2. 4. SNMP Concepts WLS SNMP Agent WLS SNMP Management Tools Network Channels – Addressing Features – Administration Port Managing and Monitoring a WLS Environment-85 © 2007 BEA Systems. Remote Administration Logs and Monitoring 3. 6.

Managing and Monitoring a WLS Environment-86 © 2007 BEA Systems. – The ability to configure the cluster multicast port number independently of the port numbers used by cluster members. – A single IP address can be used with multiple ports. – Specific NICs or multiple port numbers on a NIC for specific WLS servers. 224 .Network Addressing Features…  Adds flexibility to networking configuration: – Multiple NICs for a single WLS server. Inc. – Multiple IP addresses can be used with each server. – Multiple SSL configurations on one server.

225 . Inc.…Network Addressing Features  Adds flexibility to networking configuration: – Administration traffic only port – Interoperability with previous WLS versions Machine Machine NIC1 NIC2 Default Channel Default Channel Server A Server B NIC1 NIC2 Channel 1 Server C Channel 2 Managing and Monitoring a WLS Environment-87 © 2007 BEA Systems.

226 . Managing and Monitoring a WLS Environment-88 © 2007 BEA Systems.Network Channels  Network channels: – Define a set of basic attributes of a network connection to WLS. • “Default” channel gets generated when a server is created. – Can prioritize internal (non-URL) connections. – Can assign multiple channels to a single server (segment network traffic). Inc. – Can separate incoming client traffic from internal server to server traffic in a domain.

227 . Inc.Configuring Network Channels Managing and Monitoring a WLS Environment-89 © 2007 BEA Systems.

100 8001 – Each NIC has one channel. Server A NIC_A1 StandardChannel NIC_A2 192.Using Channels Example 1  Multiple NICs per server – Each server has 2 NICs. 228 .168.168.201 8002 Managing and Monitoring a WLS Environment-90 © 2007 BEA Systems. – Types of channels • StandardChannel – Enables HTTP – Disables other protocols NIC_B1 StandardChannel NIC_B2 SecureChannel SecureChannel hence there are 2 channels per server.101 8002 Server B 192.168.200 8001 • SecureChannel – Enables HTTPS – Disables other protocols 192.1.1. Inc. Inc.168.200 Managing and Monitoring a WLS Environment-91 © 2007 BEA Systems.Using Channels Example 2  Separate Internal and External traffic: – AppChannel is common between servers • Used for internal communications • OutgoingEnabled attribute is enabled – ClientChannel is used for external access • Clients can only connect to public IP address 192.168.100 Support Server EJB NIC 192.105 AppChannel NIC AppChannel 192.100 • OutgoingEnabled attribute is disabled Client Edge Server NIC ClientChannel Servlet 192.168. 229 .

– Specifies that channel settings are as the default channel except if: – Allows only admin traffic from the Administration Console. SSL traffic. – Generates an Administration channel. Inc. weblogic. 230 • All connections via the port require authentication by a server administrator. and Managed Servers – Enables to start the server in Standby mode Managing and Monitoring a WLS Environment-92 © 2007 BEA Systems.Admin.Administration Port…  WLS allows configuration of a dedicated administration port: – Accepts only secure. • Separate SSLListenPort value is defined • Non-SSL ListenPort is disabled .

Inc.…Administration Port Managing and Monitoring a WLS Environment-93 © 2007 BEA Systems. 231 .

Override Administration Port Managing and Monitoring a WLS Environment-94 © 2007 BEA Systems. Inc. 232 .

Section Review In this section we discussed:  Network channels  Administration port Managing and Monitoring a WLS Environment-95 © 2007 BEA Systems. Inc. 233 .

Inc.  Ask the instructor for any clarification. 234 .Exercise Configuring Network Channels/Network Access Points  In this lab you will configure Network Channels. Lab Exercise Managing and Monitoring a WLS Environment-96 © 2007 BEA Systems.  The instructor will determine the stop time.

Inc. 235 .Module Review In this module we discussed:  The benefits of Node Manager  The way to monitor domains and servers  SNMP concepts  The WLS SNMP Agent  WLS-provided SNMP manager commands  The Network Channels configuration Managing and Monitoring a WLS Environment-97 © 2007 BEA Systems.

Module 5 Basic Deployment At the end of this module you will be able to:  Describe the Web server capabilities of WebLogic Server  Use static and dynamic deployment  Work with the built-in WebLogic Server servlets  Define and work with enterprise applications Basic Deployment-1 © 2007 BEA Systems. 237 . Inc.

Web Applications EJB Applications Enterprise Applications Deployment Basic Deployment-2 © 2007 BEA Systems. 238 . 5. Inc. 3. Web Servers – Web Servers Defined – HTTP – Static and Dynamic Content 2.Road Map 1. 4.

 Web servers typically return: – Static content (HTML pages. Inc. …) Basic Deployment-3 © 2007 BEA Systems.The Role of Web Servers  Web servers are responsible for handling HTTP requests from clients. CGIs. JSPs. …) – Dynamic content (Servlet. 239 . graphics.

A Typical Web Interaction 1 HTTP Request Example client request header: POST /Servlet/ProductInfoServlet HTTP/1. Inc.1 Accept: text/plain User-agent: MyApplication Host: localhost:80 Connection: keep-alive WLS Retrieves Resource 2 Example client request body: product=Weblogic%20Server&version=10 WebLogic Server Web Client 4 Web Client Displays Results Example server response header: content-type: text/plain content-length: 37 3 HTTP Response Example server response body: WLS 10 is a full-featured Web server © 2007 BEA Systems. Basic Deployment-4 240 .

Inc. Basic Deployment-5 © 2007 BEA Systems.MIME Types  Multipurpose Internet Mail Extensions (MIME) is a protocol for identifying and encoding binary data.  All HTTP response data is encoded with a MIME content type. 241 .  Browsers interpret HTTP response data differently depending upon the MIME type of the data: – HTML pages are parsed and displayed. – PDF documents can be sent to Adobe Acrobat. – Application code can be directly executed.

the browser can prompt the user for an ID and password to login. WLS 10 is a full-featured Web server. 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. Basic Deployment-6 © 2007 BEA Systems. 242 .HTTP Status Codes  HTTP status codes: – Indicate to the client whether or not the request was successful – Provide the client a reason for a failed request – Are used by clients to provide alternate behavior Indicating success: The default status code is 200. Inc. which indicates success.

Static Content  Static content documents are predefined on the server and do not change.  WebLogic Server can be used to serve static content such as: – HTML documents – Images – PDF documents  WebLogic Server can serve static documents: – Over standard HTTP – Through SSL using HTTPS Basic Deployment-7 © 2007 BEA Systems. Inc. 243 .

 HTML documents can be created by using: – Servlets – JSPs – Common Gateway Interface (CGI) programs Basic Deployment-8 © 2007 BEA Systems. Inc. 244 .Dynamic Content  Dynamic content documents may change based on the client's request.

status codes  Serving static HTML. images and files  Serving JSP and servlet requests Basic Deployment-9 © 2007 BEA Systems. responses. Inc. 245 . MIME types.Section Review In this section we discussed:  The role of Web servers  HTTP requests.

Road Map 1. 246 . Deployment Basic Deployment-10 © 2007 BEA Systems. 4. EJB Applications Enterprise Applications 5. Inc. Web Applications – Web Applications – Directory Structure and Deployment Descriptors – Using the Console to Deploy Web Applications – Monitoring Web Applications 3. Web Servers 2.

What Is a Web Application?  A Web application is a group of server-side resources that create an interactive online application. 247 . Inc.  Server-side resources include: – Servlets (small server-side applications) – JavaServer Pages (dynamic content) – Static documents (HTML. images) – Server-side classes – Client-side applets and beans Basic Deployment-11 © 2007 BEA Systems.

Packaging Web Applications  Before deploying an application package and registering it with a WLS server. 248 . Inc. Develop web. Arrange resources in a prescribed directory structure. Deploy Web App onto WLS. 4.xml Deployment Descriptor (WLS-Specific). 2. Archive Web App into . 5. Configure Web App with WLS Administration Console. 6. 3. Develop weblogic.war file using jar. follow these steps to package a Web App: 1. Basic Deployment-12 © 2007 BEA Systems.xml Deployment Descriptor (or copy as required).

249 .Web Application Structure  The structure of Web applications is defined by the Servlet specification.  A Web application can be either: – An archived file (.war file) – An expanded directory structure Directory/File Description Document root of Web application Information for archive tools (manifest) Private files that will not be served to clients Server-side classes such as servlets and applet . Inc.jar files used by Web app Web app deployment descriptor WLS-specific deployment descriptor Basic Deployment-13 © 2007 BEA Systems.

xml which: – – – – – – Define run-time environment Map URLs to servlets and JSPs Define application defaults such as welcome and error pages Specify J2EE security constraints Define work managers for applications Set the context-root for the application Basic Deployment-14 © 2007 BEA Systems. 250 .Configuring Web Applications  Web applications are configured through deployment descriptors web. Inc.xml and weblogic.

xml file is a deployment descriptor for configuring: – – – – – – – – – Servlets and JSP registration Servlet initialization parameters JSP tag libraries MIME type mappings Welcome file list Error pages Security constraints and roles Resources EJB references © 2007 BEA Systems. 251 Basic Deployment-15 .xml File  The web. Inc.The web.

xml File  The weblogic. Inc.xml is a WebLogic Server-specific deployment descriptor for configuring: – – – – – – – – – JSP properties JNDI mappings security role mappings HTTP session parameters Work managers Context root Virtual directory mappings Logging parameters Library modules © 2007 BEA Systems.The weblogic. 252 Basic Deployment-16 .

org/2001/XMLSchema-instance"> </weblogic-web-app> Basic Deployment-17 © 2007 BEA Systems. <?xml version='1.xml Deployment Descriptor  Example of weblogic.0' encoding='utf-8'?> <weblogic-web-app xmlns="" xmlns:xsi="http://www.bea. 253 . Inc.xml deployment descriptor.weblogic.w3.

Web Application Archive…  Web application archives (. Inc. 254 . Basic Deployment-18 © 2007 BEA Systems. Web applications are not archived until the end of production.war files) – Are compressed files that contain directory structures that represent Web applications – Simplify the distribution and sharing of Web applications across a network – Can share common resources – Can be combined into larger applications  For ease of development and debugging.

war Servlets. text images HTML HTML HTML Deployment Descriptiors XML web.xml jar JSP JSP JSP JSPs Servlet .…Web Application Archive  Web archives are created using the jar utility: Static Resources: HTML.xml weblogic. JavaBeans and other classes Basic Deployment-19 © 2007 BEA Systems. 255 . Inc.

Inc. Servlet mapping.URLs and Web Apps  The URL used to reference a resource in a Web application must include the name of the Web application. not necessary if this is the default Web application MyWebApplication resource Static page. 256 . or JSP Basic Deployment-20 © 2007 BEA Systems. Accessing a resource in a Web application: http://hostname:port/MyWebApplication/resource Where: Hostname Host name mapped to virtual host or hostname:port Name of the Web application.

Virtual Directory Mappings  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 Basic Deployment-21 © 2007 BEA Systems. Inc. 257 .

jar</local-path> <url-pattern>*.Virtual Directory Mapping Example Virtual Directory Mapping Example: <virtual-directory-mapping> <local-path>c:/usr/gifs</local-path> <url-pattern>/images/*</url-pattern> <url-pattern>*. Inc. 258 .jsp</url-pattern> </virtual-directory> 10 0101 1110 Basic Deployment-22 © 2007 BEA Systems.jpg</url-pattern> </virtual-directory> <virtual-directory-mapping> <local-path>c:/usr/common_jsps.

259 . Expanded Directory  Archive Web applications if: – In production phase – Deploying to several machines  Do not archive Web applications if: – In development/debugging phase – Application will be updated frequently – Deploying to a single machine (Administration Server) Basic Deployment-23 © 2007 BEA Systems.Archive vs. Inc.

Section Review In this section we discussed:  Web applications  Deployment descriptors  Deployment and monitoring of Web application  The way to update production Web applications  Virtual directories Basic Deployment-24 © 2007 BEA Systems. Inc. 260 .

EJB Applications – Major EJB Types and Their Purpose 4. 5.Road Map 1. Enterprise Applications Deployment Basic Deployment-25 © 2007 BEA Systems. 2. Inc. Web Servers Web Applications 3. 261 .

 The EJB specification defines relationships between: – The EJB and its container – The container and the application server – The container and the client Basic Deployment-26 © 2007 BEA Systems.Enterprise JavaBeans™  Enterprise JavaBeans™ (EJB) standardizes development and deployment of Java server components. Inc. 262 .

Inc.Types of EJBs EJB Type Stateless Session Description  not maintain state Do  Are synchronous Example  Check validity of stock symbol  Calculate billing of a  Are maintained in memory  Conversational interaction phone call  Book a flight & car rental Stateful Session  Maintain state for client  Are synchronous for travel  Manage a shopping cart  Represent a player’s Entity  Represent persisted data statistics  Represent a stock’s  Are synchronous  Asynchronous & stateless  Consume JMS messages © 2007 BEA Systems. history Message Driven Basic Deployment-27  Store logging messages 263 .

EJB Application Directory Structure  EJB components come packaged in JAR files. Inc. 264 . EJB App JAR Format: Basic Deployment-28 © 2007 BEA Systems.  EJBs are configured by modifying deployment descriptors.

EJB Administrator Tasks with WLS  EJB administrator tasks include: – Configure and deploy – Resolve JNDI and other infrastructure issues – Monitor EJB caches and pools Basic Deployment-29 © 2007 BEA Systems. Inc. 265 .

266 .Section Review In this section we discussed:  EJB applications  Major types of EJBs Basic Deployment-30 © 2007 BEA Systems. Inc.

Web Servers 2.ear) File Structure – Enterprise Application Configuration 5. Inc. 4. Web Applications EJB Applications Enterprise Applications – Enterprise Application Concepts – Enterprise Archive (. 3. Deployment Basic Deployment-31 © 2007 BEA Systems. 267 .Road Map 1.

jar) – Java applications (.war) – EJB applications (. 268 . Inc.jar) – Resource adapters (.ear file.  These resources include: – Web applications (.rar) Basic Deployment-32 © 2007 BEA Systems.What Is an Enterprise Application?  An enterprise application is a grouping of several resources into one deployable unit packaged in an .

xml weblogic-ejbjar.xml Web application module (WAR) web.xml weblogic-pplication. Inc.xml (RAR) J2EE Modules Basic Deployment-33 © 2007 BEA Systems.xml J2EE Enterprise Application (EAR) application.xml weblogic.xml Application client module weblogic(JAR) appclient. EJB-JAR WAR JAR RAR 269 .J2EE Enterprise Application Deployment descriptor EJB EJB EJB Web Web EJB module (JAR) ejb-jar.xml Resource adapter module weblogic-ra.

Inc. 270 .Why Enterprise Applications?  Use enterprise applications to: – Avoid name space clashes – – – – – – Declare application-wide security roles Deploy an application as one unit Share application-wide EJB resources Configure local JDBC data sources Configure local JMS resources Configure local XML resources Basic Deployment-34 © 2007 BEA Systems.

271 . Inc.EAR File Structure  An example directory structure of an enterprise application is shown below: Directory / File Description Document root of enterprise application META-INF directory Enterprise application deployment descriptor WLS Enterprise application deployment descriptor An EJB module Another EJB module A Java module Another Java module A Web application module Another Web application module Basic Deployment-35 © 2007 BEA Systems.

Inc.Configuring WLS Specific Features  Configure enterprise-wide WLS-specific features with the weblogic-application. 272 .xml deployment descriptor: – XML parsers – – – – XML entity mappings JDBC data sources JMS connection factories and destinations Security realms Basic Deployment-36 © 2007 BEA Systems.

Inc. 273 . System Classpath Class Loader App A Class Loader loads all EJBs App B Class Loader loads all EJBs Web App 1 Class Loader Enterprise App A Basic Deployment-37 Web App 2 Class Loader Web App 3 Class Loader Enterprise App B © 2007 BEA Systems.WLS Application Class Loader  Each application receives its own class loader hierarchy with the system class loader as its parent.

BEA has added APP-INF/lib and APP-INF/classes to the standard J2EE ear file structure. Inc. paths extracted are  Classes are added to the root classloader of the prefixed to the beginning of the application’s class path.EAR Class Libraries  Extending the J2EE spec.  When the application is initialized. Basic Deployment-38 © 2007 BEA Systems. application. 274 .

275 . you can create a library of J2EE modules.  Afterwards.  This allows for more reusability between applications. Basic Deployment-39 © 2007 BEA Systems. other applications can use the modules as if they were packaged in their own EAR files.J2EE Library Support  To make things easier. and then deploy and register it with the application container. Inc. package them into an Enterprise application (EAR).

Inc. 276 .Section Review In this section we discussed:  The structure of enterprise applications  The deployment of enterprise applications Basic Deployment-40 © 2007 BEA Systems.

Web Applications EJB Applications Enterprise Applications Deployment – Auto-deployment – Console Deployment – Command-line Deployment Basic Deployment-41 © 2007 BEA Systems. 277 . 4.Road Map 1. 3. Inc. Web Servers 2. 5.

Choosing whether to package the application as an archived file or keep it in an exploded directory 2. Configuring – Creating a deployment plan to maintain configuration changes without changing the deployment descriptors 3. Inc.Deployment Process Overview  Deploying an application involves the following tasks: 1. 278 . Deploying – Targeting and distributing the application to WebLogic servers in a domain Basic Deployment-42 © 2007 BEA Systems. Preparing .

Inc.war. JMS and Diagnostic Framework modules  Applications and EJBs can be deployed: – In an archived file (. 279 .jar) – In exploded (open) directory format Basic Deployment-43 © 2007 BEA Systems. .Deployment Methods  WLS supports three deployment methods: – Auto-deployment – Console deployment – Command-line deployment  You can deploy: – EJB components – Enterprise applications – Resource adapters – Web applications – Optional packages – Web services – Client application archives – J2EE libraries – JDBC. .ear.

– The Administration Server monitors this folder for new. Location of Applications Directory: %BEA_HOME%\user_projects\domains\domain_name\autodeploy 10 0101 1110 Basic Deployment-44 © 2007 BEA Systems. – This configures. or removed applications. 280 . changed.Auto-Deployment – Copying Files  If Production Mode is OFF: – You can install an application simply by copying it (manually or using the console) to the ‘autodeploy’ folder of the domain. targets and deploys the application to the Administration server only. Inc.

Production Modes  An Administration Server starts either using: – development mode. Basic Deployment-45 © 2007 BEA Systems. which turns auto-deployment off  The Administration server starts in the mode selected at domain creation time. which turns auto-deployment on – production mode. Inc. 281 .Development vs.  The mode is set for all WebLogic servers in a given domain.

Production Mode Flag  When Production mode is disabled. Basic Deployment-46 © 2007 BEA Systems. 282 . applications can be dynamically deployed. Inc. – Application poller will be enabled in Development Mode.

283 . Inc.Console Deployment Method…  Deploying with the console allows full administrator control: – – – – – Installation from a location of your choice Manual configuration of application name Targeting of application to individual servers and/or clusters Configuring the application without targeting it Activating deployment when desired Basic Deployment-47 © 2007 BEA Systems.

284 . Inc.…Console Deployment Method  Best used with Production Mode Basic Deployment-48 © 2007 BEA Systems.

285 .Console Deployment… 3 1 2 4 Basic Deployment-49 © 2007 BEA Systems. Inc.

…Console Deployment… 5 6 Basic Deployment-50 © 2007 BEA Systems. 286 . Inc.

287 .…Console Deployment… 7 Basic Deployment-51 © 2007 BEA Systems. Inc.

288 .…Console Deployment… 8 9 10 Basic Deployment-52 © 2007 BEA Systems. Inc.

Inc.…Console Deployment 11 Basic Deployment-53 © 2007 BEA Systems. 289 .

Inc. Basic Deployment-54 © 2007 BEA Systems.DD Editing  Some deployment descriptor elements are editable via the console. 290 .

Inc.Application Monitoring 1 2 Basic Deployment-55 © 2007 BEA Systems. 291 .

Application Testing  You can test a deployed application using the administration console. Inc. 292 . Basic Deployment-56 © 2007 BEA Systems.

Inc.Application Update and Delete…  Using the console.  All concurrent deployment activity is tracked by the Administration server in a series of tasks: – Task progress and outcome can be queried for each application. or delete or undeploy them. 293 . you can either update or redeploy applications after configuration or component changes. – Reasons for failure are logged. Basic Deployment-57 © 2007 BEA Systems.

294 .…Application Update and Delete… 1 2 3 Basic Deployment-58 © 2007 BEA Systems. Inc.

295 . Inc.…Application Update and Delete 2 1 3 Basic Deployment-59 © 2007 BEA Systems.

Deployer actions can also be scripted with the Ant task wldeploy weblogic. 296 .Command-Line Deployment  The weblogic.Deployer Syntax: % java weblogic.Deployer [options] [-deploy|-undeploy|-redeploy|-start|-stop|-listapps] [file(s)] 10 0101 1110 Basic Deployment-60 © 2007 BEA Systems.  weblogic.Deployer utility allows you to perform deployment operations similar to those available in the console. Inc.

server2 -redeploy jsps/*.jsp To undeploy an application: java weblogic.Deployer -adminurl t3://localhost:7001 -username system -password weblogic -name app –redeploy To redeploy part of an application: java weblogic.Deployer Examples: To deploy a new application: java weblogic. 297 .server2 -deploy To redeploy an application: java weblogic.Deployer -adminurl t3://localhost:7001 -username system -password weblogic -targets server1.weblogic. Inc.server2 10 0101 1110 Basic Deployment-61 © 2007 BEA Systems.Deployer -adminurl t3://localhost:7001 -username system -password weblogic -undeploy -name myapp –targets server1.Deployer Examples… weblogic.Deployer -adminurl t3://localhost:7001 -username system -password weblogic -name app -source /myapp/app.ear -targets server1.

Deployer -adminurl http://localhost:7001 -username system –password weblogic -cancel -id tag 10 0101 1110 Basic Deployment-62 © 2007 BEA Systems. 298 .Deployer -adminurl t3://localhost:7001 -username system -password weblogic -listapps To list all deployment tasks: java weblogic.Deployer Examples More weblogic.…weblogic.Deployer Examples: To list all deployed applications: java weblogic.Deployer -adminurl http://localhost:7001 -username system –password weblogic -listtask To cancel a deployment task: java weblogic. Inc.

Inc. undeploy. and redeploy applications and standalone modules to a WebLogic Server instance – Update an existing deployment plan – Start and stop a deployed application Basic Deployment-63 © 2007 BEA Systems.Deploying Applications with WLST  WLST provides a number of deployment commands. 299 .  You can use these commands to: – Deploy. # # WLST script for Deploying J2EE Application # # Connect to the server print 'Connecting to server .'weblogic'.. targets='myserver'. applocation. planPath='c:/myapps/plan/plan.Deploying an Application with WLST Deploy an application (deployapp.xml') print 'Done Deploying the application '+ appname exit() # # # Basic Deployment-64 © 2007 BEA Systems. 300 . ' connect('system'. Inc.'t3://localhost:7001') appname = "mbeanlister" applocation = "c:/domains/dizzyworld/apps/mbeanlister" # Start deploy print 'Deploying application ' + appname deploy(appname.

Section Review In this section we discussed:  Auto-deployment  Console deployment  Command-line deployment Basic Deployment-65 © 2007 BEA Systems. 301 . Inc.

 The instructor will determine the stop time. Lab Exercise Basic Deployment-66 © 2007 BEA Systems.Exercise Deploying & Undeploying Web Applications  In this lab you will learn about deploying and Undeploying Web applications. 302 . Inc.  Ask the instructor for any clarification.

Inc. 303 .Module Review In this module we discussed:  Web server and Web application basics  Packaging and deploying Web applications  Enterprise JavaBeans concepts  EJB configuration  Enterprise application concepts Basic Deployment-67 © 2007 BEA Systems.

Inc.Module 6 Understanding JNDI At the end of this module you will be able to:  Describe naming and directory services  Detail the high-level architecture of JNDI  Define basic terminology  View the JNDI tree in WebLogic Server  Use the Administration Console to deploy a startup or shutdown class Understanding JNDI-1 © 2007 BEA Systems. 305 .

Inc. Startup and Shutdown Classes Understanding JNDI-2 © 2007 BEA Systems. 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. 306 .Road Map 1.

What Is JNDI?  The Java Naming and Directory Interface is an API for accessing different naming and directory services uniformly. files. directories. Inc. 307 . objects and networks Understanding JNDI-3 © 2007 BEA Systems.  This is a major step forward because: – Different services use vastly different naming schemes – Java applications will be able to navigate seamlessly across databases.

Inc. JNDI serves as a repository and lookup service for J2EE objects including: – – – – EJB home stubs JDBC DataSources JMS connection factories. 308 . queues and topics RMI stubs Understanding JNDI-4 © 2007 BEA Systems.Why JNDI?  In WebLogic Server.

JNDI Structure Application Code Written by Developer JNDI API Naming Manager JNDI SPI WLS Driver LDAP Driver File Sys Driver DNS Driver Other JNDI API Purchased WLS Server LDAP Server File System DNS System Other Service Understanding JNDI-5 © 2007 BEA Systems. Inc. 309 .

com/ products 310 Understanding JNDI-6 .bea.10.Naming Service  A naming service provides a ID1 ID2 ID3 ID4 Objects method for mapping identifiers to entities or objects:  Naming Service vocabulary: Term Binding Namespace Definition Association of an atomic name and an object A set of unique names in a naming system © 2007 BEA Systems.38 is bound to 209.217.bea. Example www. Inc.

Inc. O4 Understanding JNDI-7 311 .A JNDI Tree Root R Context A binding associates an object with a logical name and a context IC Initial Context A O1 Object “O1” is bound to Initial Context B Context “B” is bound to Initial Context O2 Object “O2” is bound to Context “A” C O3 O3 Object “O3” is bound to both Context “A” and “B” © 2007 BEA Systems.

ejb. Inc.bea.examples.ejb Understanding JNDI-8 © 2007 BEA Systems.)  Subcontexts must be created before objects are placed into them. If the following context exists: com.  Typically when objects are bound to the JNDI tree.examples you cannot bind: com.bea.SomeObject without first creating: com.Contexts and Subcontexts  Subcontexts are referenced through dot delimiters (.bea.examples. 10 0101 1110 312 . subcontexts are automatically created based on the JNDI name.

JNDI for Administrators  Administrators need to understand JNDI because it will be their job to: – Verify objects are bound in the JNDI tree – Set security on contexts within the JNDI tree Understanding JNDI-9 © 2007 BEA Systems. 313 . Inc.

Viewing the JNDI Tree 1 2 3 4 5 Understanding JNDI-10 © 2007 BEA Systems. Inc. 314 .

cluster. wls:/offline> connect("weblogic".rmi. 315 .cluster.ClusterableRemoteObject weblogic.Listing JNDI Contents  WLST provides a command line utility for viewing JNDI bindings.ClusterableRemoteObject weblogic.cluster. Inc.ClusterableRemoteObject weblogic."weblogic".rmi.  jndi() changes to the jndi tree and ls() lists the bindings.ClusterableRemoteObject 10 0101 1110 Understanding JNDI-11 © 2007 BEA Systems."t3://localhost:7001") wls:/base_domain/serverConfig> jndi() wls:/base_domain/jndi> cd('AdminServer') wls:/base_domain/jndi/AdminServer> dr-ejb dr-javax dr-weblogic -r-cgDataSource -r-cgDataSource-nonXA -r-mejbmejb_jarMejb_EO -r-samplesDataSource ls() weblogic.rmi.cluster.rmi.

Section Review In this section we discussed:  Directory and naming services and how they work  The high-level architecture of JNDI  The view of the JNDI tree via the Administration Console and the command line Understanding JNDI-12 © 2007 BEA Systems. 316 . Inc.

Road Map 1. Inc. 2. Introduction to JNDI 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 Understanding JNDI-13 © 2007 BEA Systems. 317 .

Inc. 318 .  You can use a startup class to: – Initialize objects in memory – Reconstruct a JNDI tree – Load critical values from the database – Recover the system to the state that existed before shutdown Understanding JNDI-14 © 2007 BEA Systems.What Is a Startup Class?  A startup class is a class that is loaded and executed when WebLogic Server boots.

Understanding JNDI-15 © 2007 BEA Systems. Inc.What Is a Shutdown Class?  A shutdown class is a class that gets executed when WebLogic Server is shutting down. 319 .  Shutdown classes are usually used to free resources obtained by startup classes.

Inc. 320 .Defining Startup/Shutdown Classes… 2 1 3 4 Understanding JNDI-16 © 2007 BEA Systems.

321 . Inc.…Defining Startup/Shutdown Classes 6 5 7 Understanding JNDI-17 © 2007 BEA Systems.

 If “Run Before Application Deployments” is checked. 322 . Web Applications.  J2EE deployment units load in this order: JDBC. Inc. EJBs. startup classes are loaded after the J2EE deployment units. Understanding JNDI-18 © 2007 BEA Systems. then startup class are loaded right before deploying JDBC Data Sources. JMS.When Are Startup Classes Loaded?  By default. Connectors.

323 . Inc.Section Review In this section we discussed:  What startup and shutdown classes are and how they work  How to deploy a startup or shutdown class using the Administration Console Understanding JNDI-19 © 2007 BEA Systems.

Inc.Exercise Working With Startup Classes and JNDI  In this lab you are going to deploy a startup class that binds objects into the JNDI tree. 324 .  Ask the instructor for any clarification. Lab Exercise Understanding JNDI-20 © 2007 BEA Systems.  The instructor will determine the stop time.

Module Review In this module we discussed: – – – – – Naming and directory services The high-level architecture of JNDI Terminology used in naming and directory services How to view the JNDI tree in WebLogic Server How to deploy a startup or shutdown class via the Administration Console Understanding JNDI-21 © 2007 BEA Systems. 325 . Inc.

Inc.Module 7 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 Setting Up JDBC-1 © 2007 BEA Systems. 327 .

Inc. 328 . 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. 3. Data Sources Monitoring and Testing Data Sources Setting Up JDBC-2 © 2007 BEA Systems.Road Map 1.

Inc.What Is JDBC?  JDBC is an API for accessing databases in a uniform way.  JDBC provides: – Platform independent access to databases – Location transparency – Transparency to proprietary database issues – Support for both two-tier and multi-tier models for database access Data Setting Up JDBC-3 © 2007 BEA Systems. 329 .

Inc. C++) Network Server JDBC-Net Bridge (Type 3) All Java JDBC Driver (Type 4) DBMS Setting Up JDBC-6 © 2007 BEA Systems. 332 .JDBC Architecture Client Java Application JDBC API JDBC-ODBC Bridge (Type 1) ODBC Driver JDBC-Native Bridge (Type 2) Native API (C.

341 . Monitoring and Testing Data Sources Setting Up JDBC-15 © 2007 BEA Systems.Road Map 1. 2. Overview of JDBC Data Sources – Describe a Data Source and How It Works – Use the Administration Console to Create a Data Source 3. Inc.

Inc. 342 .  A data source: – Is stored in the WLS JNDI tree – Can support transactions – Is associated with a connection pool Setting Up JDBC-16 © 2007 BEA Systems.What Is a Data Source?  A data source object provides a way for a JDBC client to obtain a database connection from a connection pool.

343 .What Is a Connection Pool?  A connection pool is a group of ready-to-use database connections associated with a data source.  Connection pools: – Are created at WebLogic Server startup – Can be administered using the administration console – Can be dynamically resized to accommodate increasing load Setting Up JDBC-17 © 2007 BEA Systems. Inc.

Benefits of Data Sources Plus Connection Pools  Some advantages of this approach are: – Time and overhead are saved by using an existing database connection. 344 . – The DBMS can be changed without the application developer having to modify underlying code.  A connection pool allows an application to “borrow” a DBMS connection. – Connection information is managed in one location in the administration console. – The number of connections to a database can be controlled. Setting Up JDBC-18 © 2007 BEA Systems. Inc.

Inc. Pool « DataSource» Setting Up JDBC-19 © 2007 BEA Systems.JDBC Data Source Architecture WebLogic Server JNDI « DataSource» JDBC Conn. Pool JDBC Conn. 345 . Pool « Application» « DataSource» : Connection : Connection : Connection « Component» : Connection JDBC Conn.

Modular Configuration and Deployment of JDBC Resources  JDBC configurations in WLS are stored in XML documents: – All JDBC configurations must conform to the new weblogic-jdbc. 346 . – IDEs and other tools can validate JDBC modules based on the schema.xsd schema.  JDBC application modules are a WLS-specific extension of J2EE modules and can be deployed either within a J2EE application or as standalone modules.  You create and manage JDBC resources either as system modules or as application modules. Setting Up JDBC-20 © 2007 BEA Systems. Inc.

WLS Client Lookup 1 Data Source Connection Pool Return Data Source 2 JNDI 3 getConnection() DataSource Return Connection 4 DBMS Connection Setting Up JDBC-21 5 Database Access © 2007 BEA Systems.How Data Sources Are Used  A client retrieves a data source through a JNDI lookup and uses it to obtain a database connection. Inc. 347 .

Creating a JDBC Data Source 1 2 Setting Up JDBC-22 © 2007 BEA Systems. 348 . Inc.

Creating a Data Source: Properties 3 4 5 6 7 Setting Up JDBC-23 © 2007 BEA Systems. Inc. 349 .

Creating a Data Source: XA Options 8 9 10 11 12 Setting Up JDBC-24 © 2007 BEA Systems. Inc. 350 .

351 . Inc.Creating a Data Source: Connection Properties 13 14 15 16 17 18 Setting Up JDBC-25 © 2007 BEA Systems.

Inc.Creating a Data Source: Test Database Connections & Select Targets 20 19 22 21 Setting Up JDBC-26 © 2007 BEA Systems. 352 .

353 . Inc.Configuring a Connection Pool 1 2 Setting Up JDBC-27 © 2007 BEA Systems.

354 .Configuring Settings of a Connection Pool… Setting Up JDBC-28 © 2007 BEA Systems. Inc.

…Configuring Settings of a Connection Pool Setting Up JDBC-29 © 2007 BEA Systems. Inc. 355 .

Connection Pool Checklist  You can modify a connection pool after the data source has been created  Before modifying a connection pool. Inc. 356 . you should understand: – The JDBC URL of the database – The connection properties used to authenticate a user or optionally configure the driver  Ask your DBA for: – The maximum number of connections your application will be allowed Setting Up JDBC-30 © 2007 BEA Systems.

JDBC URLs  Database locations are specified using a JDBC Uniform Resource Locator (URL). The syntax for a JDBC URL is: jdbc:<subprotocol>:<subname> Where: <subprotocol> identifies the database connectivity mechanism <subname> identifies the data source. The subname can vary depending on the subprotocol 10 0101 1110 Setting Up JDBC-31 © 2007 BEA Systems. Inc. 357 .

JDBC URL Examples Example 1.” the subname is a location of PointBase database named “HRDATABASE. This URL specifies that the “oracle:thin” subprotocol should be used to connect to an Oracle database: jdbc:oracle:thin:@dbhost:1521:SALESINFO 10 0101 1110 Setting Up JDBC-32 © 2007 BEA Systems. This URL could be used to access a PointBase database: jdbc:pointbase:server://dbhost:9092/HRDATABASE The subprotocol is “pointbase:server.” 10 0101 1110 Example 2. 358 . Inc.

Connection Properties…  Are key/value pairs  Are used to configure JDBC connections and are passed to the driver during connection setup For a complete list. Inc. 359 . see your driver documentation! Setting Up JDBC-33 © 2007 BEA Systems.

database. ServerName. Password. Password. PortNumber User. DatabaseName.…Connection Properties  A partial list of connection properties for the supplied drivers: Driver Oracle Sybase Some Connection Properties User. PortNumber User. Inc.pagesize © 2007 BEA Systems. database.size. ServerName. DatabaseName. PortNumber MSSQL Informix PointBase* cache. ServerName. DatabaseName. crypto. PortNumber User. communication. ServiceName. ServerName. Password.home. 360 Setting Up JDBC-34 . Password.

Setting Up JDBC-35 © 2007 BEA Systems. Inc.Multi Data Sources…  Multi data source: – Is an abstraction around a group of data sources – Determines which data source to use to satisfy the request depending on the algorithm selected in the multi data source configuration: • Load balancing Or • Failover – Is bound to the JNDI tree  XA support for multi data sources – The WLS JDBC supports using multi data sources in XA transactions. 361 . – You can configure the data sources contained within the multi data source to use XA JDBC drivers.

Pool JDBC Conn. Inc. 362 . Pool : Connection « Application» « DataSource» : Connection : Connection « Component» « DataSource» : Connection JDBC Conn.… Multi Data Sources WebLogic Server JNDI Multi Data Source « DataSource» JDBC Conn. Pool Setting Up JDBC-36 © 2007 BEA Systems.

363 .Section Review In this section we discussed:  Data source definition and workings  Data source management with the administration Console  Multi data sources Setting Up JDBC-37 © 2007 BEA Systems. Inc.

2. Overview of JDBC Data Sources 3.Road Map 1. Monitoring and Testing Data Sources – Monitoring – Testing Setting Up JDBC-38 © 2007 BEA Systems. 364 . Inc.

Setting Up JDBC-39 © 2007 BEA Systems. 365 . Inc.Monitoring Data Sources: Statistics  The administration console provides two types of data source monitoring: statistics and testing.

Setting Up JDBC-40 © 2007 BEA Systems. Inc.Monitoring Data Sources: Testing  The administration console provides a mechanism for manually testing individual data sources. 366 .

Setting Up JDBC-41 © 2007 BEA Systems. 367 . Inc.Section Review In this section we discussed:  Monitoring statistics and the testing of an individual data source.

Exercise Configuring Data Sources  In this lab you will work with configuring and monitoring data sources. Lab Exercise Setting Up JDBC-42 © 2007 BEA Systems. 368 . Inc.  The instructor will determine the stop time.  Ask the instructor for any clarification.

Module Review In this module we discussed:  JDBC high-level architecture  WebLogic Server provided JDBC driver types  Data source definition and workings  Connection pool definition and workings  Managing JDBC resources with the administration console Setting Up JDBC-43 © 2007 BEA Systems. Inc. 369 .

Inc.Module 8 Setting Up JMS (Java Message Service) Applications At the end of this module. 371 . you will be able to:  Understand how WebLogic Server JMS is implemented  Configure JMS administered objects using the administration console  Configure persistent messages  Use the WLS administration console to monitor JMS Setting Up JMS Applications-1 © 2007 BEA Systems.

372 . WebLogic Server JMS Administration – Messaging Fundamentals – Point-to-Point (PTP) and Publish-Subscribe (Pub/sub) Domains – Configuring JMS Objects – Fine-Tuning WLS JMS Configuring Persistent Messaging 3. Inc. Monitoring JMS in WLS 2. Setting Up JMS Applications-2 © 2007 BEA Systems.Road Map 1.

 Typical message-oriented middleware architectures define these elements: – Message structure – The way to send and receive messages – Scaling guidelines Setting Up JMS Applications-3 © 2007 BEA Systems.Message-Oriented Middleware  Message-oriented middleware refers to an infrastructure that supports messaging. Inc. 373 .

374 . Messages are delivered to one client Sender Distribution Queue 9 8 7 6 5 4 3 Receiver Receiver 1 Queue Manager WebLogic Server Sender 2 Receiver Setting Up JMS Applications-4 © 2007 BEA Systems.Point-to-Point Queue  Many producers can serialize messages to multiple receivers in a queue. Inc.

Messages are delivered to more than one client Publisher Distribution Topic 9 8 7 6 5 4 3 2 1 Subscriber 3 2 1 Subscriber Publisher Topic Manager WebLogic Server 3 2 1 Subscriber Setting Up JMS Applications-5 © 2007 BEA Systems. Inc. 375 .Publish-Subscribe Topics  Publishing and subscribing to a topic decouples producers from consumers.

WebLogic Server JMS Features  WebLogic Server JMS supports: – PTP and pub/sub domains – – – – Guaranteed and transactional message delivery Durable subscribers Distributed destinations Recovery from failed servers Setting Up JMS Applications-6 © 2007 BEA Systems. 376 . Inc.

JMS Architecture: Connecting Client ConnectionFactory WLS lookup ConnectionFactory 1 2 Create a Connection 3 Connection JMS Server Destination: Topic JNDI Destination: Queue Create a Session 4 Session Destination Look up a Destination 3 Destination Returned 4 To send messages.Destination 377 Setting Up JMS Applications-7 © 2007 BEA Systems.Session . these are required: . Inc. .Connection .

JMS Architecture: Sending Messages Connection. Session and Destination are used to send a message Destination: Queue Connection 5 Session Message Destination Producer Destination: Topic JMS Server WLS Client Database Setting Up JMS Applications-8 © 2007 BEA Systems. 378 . Inc.

Commit 379 . Begin Transaction 1 Begin Transaction 2 Producer All messages arrive at destination Consumer Messages are removed from destination Commit Setting Up JMS Applications-9 © 2007 BEA Systems. a JMS client can demarcate transactions local to the JMS Session.  Participation in a transaction is optional. through a transacted session.Transacted Messaging  A JMS client can use JTA to participate in a distributed transaction.  Alternatively. Inc.

Administrative Tasks  Administrative tasks include these: – Creating and monitoring JMS servers – – – – – – Creating connection factories Creating and monitoring destinations Creating JMS stores Configuring thresholds and quotas Configuring durable subscriptions Managing JMS service failover Setting Up JMS Applications-10 © 2007 BEA Systems. Inc. 380 .

WLS JMS Server  In WLS. 381 .  A JMS server receives and distributes messages. Queues Queues Queues JMS Client JMS Client JMS Server A JMS Client Topics Topics Topics Queues Queues Queues Topics Topics Topics … JMS Client JMS Client … JMS Client WebLogic Server JMS Server B Persistence Setting Up JMS Applications-11 © 2007 BEA Systems. the messaging service is implemented through a JMS server. Inc.

Create a JMS Server 2 1 4 3 Setting Up JMS Applications-12 © 2007 BEA Systems. 382 . Inc.

383 .Target a JMS Server 2 1 Setting Up JMS Applications-13 © 2007 BEA Systems. Inc.

384 .Configure a JMS Server 1 2 3 Setting Up JMS Applications-14 © 2007 BEA Systems. Inc.

xml DD» «demo-jms. «domain» config. System Module 385 .xml» «MyJMSDescriptorjms.xml «deploy» «EAR» «weblogicapplication.JMS Resources  JMS resources are managed as either system modules or application modules. Inc.xml» Application Module Setting Up JMS Applications-15 © 2007 BEA Systems.

Modular JMS Resource Configuration and Deployment.  JMS configurations in WebLogic Server are stored as JMS modules. 386 . – Defined by an XML file that conforms to the weblogicjmsmd.. Inc..xsd schema – Similar to standard J2EE modules  An administrator can create and manage JMS modules as: – Global system resources – Global standalone modules – Modules packaged with an enterprise application Setting Up JMS Applications-16 © 2007 BEA Systems.

such as: – From development to integration – From system test to production  You can migrate your application and the required JMS configuration: – Without opening an EAR file – Without extensive manual JMS reconfiguration Setting Up JMS Applications-17 © 2007 BEA Systems. Inc....Modular JMS Resource Configuration and Deployment  An advantage of modular deployment is simplified migration between environments. 387 .

a new connection factory can be created. Inc.  When a new configuration is required. Setting Up JMS Applications-18 © 2007 BEA Systems.ConnectionFactory. 388 .jms.Connection Factory  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.

Create a Connection Factory… 1 2 3 Setting Up JMS Applications-19 © 2007 BEA Systems. Inc. 389 .

…Create a Connection Factory… 5 4 Setting Up JMS Applications-20 © 2007 BEA Systems. Inc. 390 .

Inc.…Create a Connection Factory… 6 7 8 Setting Up JMS Applications-21 © 2007 BEA Systems. 391 .

392 . Inc.…Create a Connection Factory… 9 Setting Up JMS Applications-22 © 2007 BEA Systems.

Inc.…Create a Connection Factory 11 10 Setting Up JMS Applications-23 © 2007 BEA Systems. 393 .

Inc. 394 .Configure Connection Factory: Default Delivery Setting Up JMS Applications-24 © 2007 BEA Systems.

Inc. 395 .Configure Connection Factory: Client Setting Up JMS Applications-25 © 2007 BEA Systems.

Configure Connection Factory: Transactions Setting Up JMS Applications-26 © 2007 BEA Systems. Inc. 396 .

Configure Connection Factory: Flow Control Setting Up JMS Applications-27 © 2007 BEA Systems. 397 . Inc.

398 .  The JMS destination types are: – Queue – Topic Setting Up JMS Applications-28 © 2007 BEA Systems.Destination  A destination is a lightweight object stored in JNDI.  It is the target on a JMS server for sending or receiving messages. Inc.

Inc. 399 .Create a Queue Destination… Setting Up JMS Applications-29 © 2007 BEA Systems.

Inc. 400 .…Create a Queue Destination… Setting Up JMS Applications-30 © 2007 BEA Systems.

Inc.…Create a Queue Destination Setting Up JMS Applications-31 © 2007 BEA Systems. 401 .

Threshold and Quota  A threshold and a quota can be set for Server and Destination objects. and logged warnings. Inc. flow control. using: – Upper and lower values for the number of bytes – Upper and lower values for the number of messages Setting Up JMS Applications-32 © 2007 BEA Systems. it includes these values: – The maximum number of bytes that can be stored – The maximum number of messages that can be stored  A threshold is a limit that triggers message paging.  A quota is a limit defined for JMS administered objects. 402 .

Configuring Thresholds and Quotas 1 2` Setting Up JMS Applications-33 © 2007 BEA Systems. Inc. 403 .

Inc. we learned how to:  Identify message-oriented middleware domains (PTP. 404 .Section Review In this section. publish and subscribe)  Understand WLS JMS messaging for the PTP and publish and subscribe domains  Administer JMS from the console  Fine-tune WLS JMS with thresholds and quotas Setting Up JMS Applications-34 © 2007 BEA Systems.

WebLogic Server JMS Administration Configuring Persistent Messaging – – – – Persistent and Non-Persistent Messages Persistent Backing Stores Using the Console Durable Subscriptions Durable Subscriptions Using the Console 3. Monitoring JMS in WLS Setting Up JMS Applications-35 © 2007 BEA Systems. 405 .Road Map 1. Inc. 2.

 By default.  Administrators configure: – Where messages are persisted – Persistent connection factories and destinations Setting Up JMS Applications-36 © 2007 BEA Systems. Inc.  A subscriber is considered active if the Java object that represents it exists.Durable Subscribers and Subscriptions  Durable subscribers register durable subscriptions to guarantee message delivery even if subscribers are inactive. subscribers are non-durable. 406 .

407 .  Configure persistent messaging if: – Development requires durable subscriptions (use durable subscribers in the application) – You require that in-progress messages persist across server restarts Setting Up JMS Applications-37 © 2007 BEA Systems. Inc.When to Use Persistent Messaging  Persistent messaging permits messages in memory to be written out to a persistent store.

messages are delivered normally: Publisher Client Topic A (A Durable Subscription) Associated with JMS Server Client Registers ID Active Client (A Durable Subscriber) Persistent Store Database or File When client is active. messages are delivered.  When the client becomes active again. © 2007 BEA Systems.How a Durable Subscription Works  If a subscriber client is active. its ID is used to retrieve and redeliver messages. Setting Up JMS Applications-38 408 . Inc.

409 . an administrator must: – Create and configure a JMS store – Configure connection factories or destinations as persistent – Associate the JMS store with the JMS server  The JMS store can be configured to use either: – A file store – A JDBC store (a connection pool) Setting Up JMS Applications-39 © 2007 BEA Systems. Inc.Configure a Durable Subscription  To configure durable subscriptions.

Create a JMS File Store… 2 1 Setting Up JMS Applications-40 © 2007 BEA Systems. 410 . Inc.

411 .…Create a JMS File Store Setting Up JMS Applications-41 © 2007 BEA Systems. Inc.

– Refer to the JMS store from the JMS server configuration.  The required infrastructure (tables. – Create a JMS store and refer to the JDBC DataSource. Setting Up JMS Applications-42 © 2007 BEA Systems. and so on) is created automatically.Create a JMS JDBC Store…  To configure JMS JDBC persistence: – Create a JDBC DataSource. Inc. 412 .

…Create a JMS JDBC Store Setting Up JMS Applications-43 © 2007 BEA Systems. 413 . Inc.

Inc. 414 .Assign a Store to a JMS Server Setting Up JMS Applications-44 © 2007 BEA Systems.

Inc.Persistent Connection Factory Setting Up JMS Applications-45 © 2007 BEA Systems. 415 .

416 .Configure a Persistent Destination Setting Up JMS Applications-46 © 2007 BEA Systems. Inc.

we learned how to:  Distinguish between persistent and non-persistent messages  Configure persistent backing stores using the console  Manage durable subscriptions Setting Up JMS Applications-47 © 2007 BEA Systems.Section Review In this section. Inc. 417 .

2. WebLogic Server JMS Administration Configuring Persistent Messaging 3.Road Map 1. Monitoring JMS in WLS – Using the Administration Console to Track JMS Statistics Setting Up JMS Applications-48 © 2007 BEA Systems. Inc. 418 .

Inc.Statistics for JMS Objects  Statistics are provided for the following JMS objects: – JMS servers – Connections – Destinations Setting Up JMS Applications-49 © 2007 BEA Systems. 419 .

Inc. 420 .Monitor JMS Servers… 1 2 Setting Up JMS Applications-50 © 2007 BEA Systems.

421 .…Monitor JMS Servers Setting Up JMS Applications-51 © 2007 BEA Systems. Inc.

Monitor Destinations Setting Up JMS Applications-52 © 2007 BEA Systems. 422 . Inc.

423 . Inc.Section Review In this section. we learned how to:  Use the administration console to display JMS statistics Setting Up JMS Applications-53 © 2007 BEA Systems.

424 . refer to the Lab Guide.  If questions arise. Setting Up JMS Applications-54 © 2007 BEA Systems.  The instructor will determine the stop time. Inc.Exercise Configuring JMS Servers and Destinations  For details on the exercise. ask the instructor.

Module Review In this section. we learned how to:  Understand messaging concepts  Understand WebLogic Server’s JMS support  Configure JMS servers. and topics  Monitor JMS servers. and topics Setting Up JMS Applications-55 © 2007 BEA Systems. Inc. 425 . queues. queues.

427 . Inc.Module 9 Managing Transactions At the end of this module you will be able to:  Configure transactions using the console  Monitor transactions using the console Managing Transactions-1 © 2007 BEA Systems.

428 . Inc.Road Map 1. Configuring and Monitoring Transactions – Configuring Transactions – Monitoring Transactions – The Transaction Log Managing Transactions-2 © 2007 BEA Systems.

 Either all operations in a transaction occur or none at all. Inc. 429 .What Is a Transaction?  A transaction is a mechanism to handle groups of operations as though they were one. Managing Transactions-3 © 2007 BEA Systems.  Operations involved in a transaction might rely on multiple servers and databases.

In the event of a failure. Isolation: Each transaction occurs independently of other transactions occurring at the same time. Managing Transactions-4 © 2007 BEA Systems. 430 .ACID Properties of a Transaction  A transaction is formally defined by the set of properties     known by the acronym ACID. all operations and procedures are undone. Durability: Completed transactions remain permanent. and all data rolls back to its previous state. Atomicity: A transaction is done or undone completely. Inc. even during system failure. Consistency: A transaction transforms a system from one consistent state to another consistent state.

Inc.Transaction Management SQL server Database (Resource) PointBase Database (Resource) Messaging Server Resource Manager Resource Manager Resource Manager WebLogic Server Transaction Manager JTA Manages Transactions End-to-End Application 1 Managing Transactions-5 © 2007 BEA Systems. 431 .

Inc.Transferring Without Transactions  Successful transfer (A)  Unsuccessful transfer (accounts are left in an inconsistent state) (B) 1) Withdraw: $100 $500 Account 1 -$100 $400 Account 2 A ATM Bank Transfer: $100 From: Acct 1 To: Acct 2 2) Deposit: $100 $1000 +$100 $1100 1) Withdraw: $100 B ATM Bank $500 Account 1 -$100 $400 Account 2 Transfer: $100 From: Acct 1 To: Acct 2 Failed Deposit $1000 Managing Transactions-6 © 2007 BEA Systems. 432 .

433 . (B) $500 Transaction Started by Bank -$100 1) Withdraw: $100 Account 1 $400 A ATM Transfer: $100 From: Acct 1 To: Acct 2 Bank 2) Deposit: $100 $1000 Account 2 +$100 $1100 Transaction Started by Bank Commit Account 1 $400 Account 2 $1100 B ATM Transfer Successful Bank Commit Managing Transactions-7 © 2007 BEA Systems. Inc. (A)  If a transfer is successful.Successful Transfer with Transactions  Changes within a transaction are buffered. changes are committed (made permanent).

(A)  If a problem occurs. (B) Transaction Started by Bank 1) Withdraw: $100 Account 1 Account 2 $500 -$100 $400 $1000 A ATM Transfer: $100 From: Acct 1 To: Acct 2 Bank Failed Deposit Transaction Started by Bank Rollback Account 1 Account 2 $500 $1000 B ATM Error message Bank Rollback Managing Transactions-8 © 2007 BEA Systems. Inc.Unsuccessful Transfer with Transactions  Changes within a transaction are buffered. 434 . the transaction is rolled back to the previous consistent state.

They use the non-Extended Architecture (non-XA) interface between WebLogic Server and resource managers. They use the Extended Architecture (XA) interface between WebLogic Server and resource managers. Inc. – You need to create non-XA or XA resources for local transactions.Types of Transactions  A local transaction deals with a single resource manager. Managing Transactions-9 © 2007 BEA Systems. you only need to create XA resources. for global transactions.  Global transactions can deal with multiple resource managers. However.  A distributed transaction coordinates or spans multiple resource managers. 435 .

Inc.The Two-Phase Commit Protocol  The Two-Phase Commit (2PC) protocol uses two steps to commit changes within a distributed transaction. or to roll back the entire transaction  A global transaction ID (XID) is used to track all changes associated with a distributed transaction. – Phase 1 asks RMs to prepare to make the changes – Phase 2 asks RMs to commit and make the changes permanent. 436 . Managing Transactions-10 © 2007 BEA Systems.

437 . Inc.Extended Architecture Protocol  The Extended Architecture (XA) protocol: – Is the interface used between WLS and RMs – Implements the 2PC protocol – Allows programs to control RMs that are involved in distributed transactions XA Client Transaction Manager RM1 RM2 XA Managing Transactions-11 © 2007 BEA Systems.

 The XA protocol implements 2PC. 438 .  The 2PC protocol is used to coordinate the transaction. Application Transaction Manager XA XA XA Resource Manager Database Printer Resource Manager Resource Manager Another App Transaction Context started by Transaction Manager Managing Transactions-12 © 2007 BEA Systems.Transaction and Resource Managers  A transaction manager coordinates multiple resource managers. Inc.

439 .Successful Two-Phase Commit pre-commit Application Transaction Manager TLOG Phase 1 Phase 2 commit Application Transaction Manager TLOG Resource Manager Resource Manager Database Printer Another App Resource Manager Resource Manager Database Printer Another App ready Resource Manager committed Resource Manager Managing Transactions-13 © 2007 BEA Systems. Inc.

not ready .Unsuccessful Two-Phase Commit pre-commit Application Transaction Manager TLOG Phase 1 Phase 2 abort Application Transaction Manager TLOG prepare/ abort Managing Transactions-14 Resource Manager Resource Manager Resource Manager Database Printer Another App ready not ready Resource Manager Resource Manager Resource Manager Database Printer Another App rolled back 440 ready/ committed © 2007 BEA Systems. Inc.

Inc. It orchestrates 2PC using XA. It executes rollbacks.  WLS JTA provides the following support: – It creates a unique transaction identifier (XID). It notifies databases of transactions. It manages time-outs. It executes automatic recovery procedures when failure. – – – – – – – It supports an optional transaction name.Java Transaction API (JTA)  WLS uses JTA to implement and manage transactions. It tracks objects involved in transactions. © 2007 BEA Systems. 441 Managing Transactions-15 .

442 .Configuring Transactions 2 1 Managing Transactions-16 © 2007 BEA Systems. Inc.

Managing Transactions-17 © 2007 BEA Systems.  T-log files must be migrated if migrating to a new machine.  You cannot directly view the transaction log as the records are in a binary format. Inc.Configuring the Transaction Log…  Each server has a transaction log that stores information about committed transactions coordinated by the server that may not have been completed. – WebLogic Server uses the transaction log when recovering from system crashes or network failures. 443 .

Inc.…Configuring the Transaction Log  .  Directory represents the path name to the file system directory where the file store maintains its data files.tlog files are stored in the default persistent store for the server. Managing Transactions-18 © 2007 BEA Systems. 444 .

if uncommitted Specifies the maximum time that a transaction manager will persist in attempting to complete a transaction during the second phase of the transaction Specifies the maximum number of cycles that the transaction manager will perform the beforeCompletion() synchronization callback for this WebLogic Server domain Specifies the maximum number of simultaneous in-progress transactions allowed on a server in the domain Specifies the maximum number of unique transaction names for which statistics will be maintained Before Completion Iteration Limit Max Transactions Max Unique Name Statistics Managing Transactions-19 © 2007 BEA Systems. 445 . Inc.JTA Configuration Options… Field Timeout Seconds Abandon Timeout Seconds Description Specifies the time in which a transaction will timeout.

446 .…JTA Configuration Options Field Checkpoint Interval Seconds Description Specifies the interval at which the transaction manager creates a new transaction log file and checks all old transaction log files to see if they are ready to be deleted Specifies whether the transaction manager will automatically perform an XAResource forget() operation for heuristic transaction completions Forget Heuristics Unregister Resource Grace Period Specifies the grace period. in seconds. Inc. that the transaction manager waits for transactions involving the resource to complete before unregistering a resource Specifies the security mode to use for XA calls in inter-domain transactions Security Interoperability Mode Managing Transactions-20 © 2007 BEA Systems.

Inc. 447 .Creating XA Resources Managing Transactions-21 © 2007 BEA Systems.

448 . Inc.Creating Non-XA Resources… Managing Transactions-22 © 2007 BEA Systems.

…Creating Non-XA Resources Managing Transactions-23 © 2007 BEA Systems. 449 . Inc.

which also reduces network traffic and I/O – Removing the need for XA processing at the database level (if the database is the one non-XA resource) Managing Transactions-24 © 2007 BEA Systems. XA JDBC drivers are typically inefficient compared to non-XA JDBC drivers – Reducing the number of processing steps to complete the transaction. which: – Enables one non-XA resource to participate in a global transaction – Has improved performance and the same ACID guarantee as XA  The LLR optimization improves performance by: – Removing the need for an XA JDBC driver to connect to the database. 450 .Logging Last Resource  You can configure a JDBC data source to enable the Logging Last Resource (LLR) transaction optimization. Inc.

Commit 451 .Transacted Messaging  A JMS client can use JTA to participate in a distributed transaction. Inc. Begin Transaction 1 Begin Transaction 2 Producer All messages arrive at destination Consumer Messages are removed from destination Commit Managing Transactions-25 © 2007 BEA Systems.  Alternatively. a JMS client can demarcate transactions local to the JMS Session through a transacted session.  Participation in a transaction is optional.

Inc. 454 .Monitoring Transactions Managing Transactions-28 © 2007 BEA Systems.

455 . Inc.Monitoring Transactions by Resource  For a particular resource. the console provides monitoring of transactional outcomes: – Number of transactions attempted – Number of commits/rollbacks – Number of heuristic outcomes Managing Transactions-29 © 2007 BEA Systems.

Monitoring Transactions Managing Transactions-30 © 2007 BEA Systems. 456 . Inc.

457 .Section Review In this section we discussed:  Configuring transactions  Monitoring transactions  Logging transactions Managing Transactions-31 © 2007 BEA Systems. Inc.

 Ask the instructor for any clarification.Exercise Data Sources and Transactions  In these labs you will work with monitoring Data Sources. Lab Exercise Managing Transactions-32 © 2007 BEA Systems. 458 .  The instructor will determine the stop time. Inc.

Module Review In this module we discussed:  Configuring transactions using the console  Monitoring transactions in WebLogic Server Managing Transactions-33 © 2007 BEA Systems. 459 . Inc.

and roles  Configure security realms  Secure Web applications with declarative security  Configure policies and SSL  Create and manage certificates  Protect WLS against several types of attacks Securing WLS Resources and Applications-1 © 2007 BEA Systems. groups. Inc.Module 10 Securing WLS Resources and Applications At the end of this module you will be able to:  Describe WLS security architecture  Configure users. 461 .

WLS Security Architecture Overview – Security Architecture – Security Terminology – Compatibility with Previous WLS Versions 4. Protecting Communications Protecting Against Attacks Securing WLS Resources and Applications-2 © 2007 BEA Systems. 5.Road Map 1. Inc. 462 .

 Provide a security framework that allows integration of 3rd party security products with minimum restrictions on functionality.  Provide consistent and unified protection for all resources hosted on WebLogic Server: – EJBs – Web applications (Servlets. Inc. 463 . JNDI. JSP) Securing WLS Resources and Applications-3 – Web services – Miscellaneous J2EE Resources • RMI objects JDBC.Architecture Goals  Using Java standards (where applicable) create an architecture that unifies security enforcement and present it as a service to other components. MBeans © 2007 BEA Systems.

Inc.Security Architecture Client Client EJBs Web Apps WLS Security API Java 2 Security Application Developer WebLogic Security Service Provider Interfaces (SSPIs) Authentication Authorization Auditing Adjudication SSPI SSPI SSPI SSPI Role Mapping CertPath Credential Mapping SSPI SSPI SSPI Security Vendor or Sophisticated Application Developer WebLogic Security Providers Authorization Auditing Certificate Registry Administrator Authentication Adjudication Role Mapping Credential Mapper Securing WLS Resources and Applications-4 © 2007 BEA Systems. 464 .

465 .Process Architecture Directory Service Agent (LDAP) Web Server Proxy Plug-in HTTP(s) HTTP(s) MBeans JNDI Connection Filter Web Client Security Service Client EJB WebApp App WebLogic Server Securing WLS Resources and Applications-5 © 2007 BEA Systems. Inc.

What Is Secure Socket Layer (SSL) Configuring SSL Certificates keytool Protecting Against Attacks Securing WLS Resources and Applications-49 © 2007 BEA Systems. – – – – 5. 509 .Road Map WLS Security Architecture Overview 4. Inc. Protecting Communications 1.

What Is SSL?  Secure Socket Layer (SSL) is a protocol that enables: – Connection security through encryption – A server to authenticate to a client – A client to authenticate to a server (optional) – Data integrity such that data that flows between a client and server is protected from tampering by a third party Securing WLS Resources and Applications-50 © 2007 BEA Systems. 510 . Inc.

Trust and Identity  SSL and keystore are configured independently. not necessarily as a standalone file outside the keystore)  Trust – Certificates of Trusted Certificate Authorities Securing WLS Resources and Applications-51 © 2007 BEA Systems. Inc. or in the WebLogic Keystore provider  Identity – Private Key and Digital Certificate (can now be looked up directly from the keystore. 511 . this release of WebLogic Server supports private keys and trusted CA certificates stored in files.  For the purpose of backward compatibility.

512 . clients access WLS via the https or t3s protocols.  To use SSL. – https://localhost:7002/orderStock – t3s://localhost:7002/useCreditCard HTTPS or t3s WebLogic Server Securing WLS Resources and Applications-52 © 2007 BEA Systems.Using an SSL Connection  WLS uses SSL to secure HTTP and t3 communication. Inc.

513 .  In SSL. Inc. digital certificates are used to provide a trusted public key. data is encrypted using a negotiated symmetric session key.Enabling Secure Communication  With SSL.  A public key algorithm is used to negotiate the symmetric session key. Securing WLS Resources and Applications-53 © 2007 BEA Systems.

Inc. you must: – Obtain an appropriate digital certificate – Install the certificate – Configure SSL properties – Configure two-way authentication (if desired) • SSL impacts performance Securing WLS Resources and Applications-54 © 2007 BEA Systems.WebLogic Server SSL Requirements  To enable WebLogic Server SSL. 514 .

 For documentation.html Securing WLS Resources and Applications-55 © 2007 BEA see: http://java.The keytool Utility  keytool is a standard J2SE SDK utility for managing: – The generation of private keys and corresponding digital certificates – Keystores (databases) of private keys and associated certificates  The keytool utility can display certificate and keystore contents.html windows/keytool. Inc.sun.0/docs/tooldocs/ solaris/keytool.sun. 515 .

516 .jks –storepass dwstorepass 1 011 Securing WLS Resources and Applications-56 © 2007 BEA Systems.pem -keypass dwkeypass -keystore dw_identity. Inc.jks Generate a CSR: keytool –certreq -v –alias dwkey –file dw_cert_request.jks –storepass dwstorepass Import a signed certificate reply from a CA: keytool –import –alias dwkey –file dw_cert_reply.Obtaining a Digital Certificate: keytool Examples Generate a new self-signed digital certificate: keytool –genkey –alias dwkey –keyalg RSA –keysize 512 -keystore dw_identity.pem -keypass dwkeypass -keystore dw_identity.

Configuring SSL for a WebLogic Server 1 2 Securing WLS Resources and Applications-57 © 2007 BEA Systems. Inc. 517 .

518 .Configuring Keystores Securing WLS Resources and Applications-58 © 2007 BEA Systems. Inc.

519 . Inc.Section Review In this section we discussed:  Using the Secure Socket Layer  Configuring SSL  Creating certificates  Managing certificates with keytool Securing WLS Resources and Applications-59 © 2007 BEA Systems.

Inc.  The instructor will determine the stop time.Exercise Configuring SSL  In this lab you are going to configure Secure Socket Layer.  Ask the instructor for any clarification. 520 . Lab Exercise Securing WLS Resources and Applications-60 © 2007 BEA Systems.

Inc. 2. 5. 521 Securing WLS Resources and Applications-61 . WLS Security Architecture Overview Users and Groups Protecting Application Resources Protecting Communications Protecting Against Attacks – – – – – Types of Attacks Protecting Against Man in the Middle Attacks Protecting Against Denial of Service Attacks Protecting Against Large Buffer Attacks Protecting Against Connection Starvation © 2007 BEA Systems. 3.Road Map 1. 4.

522 . Securing WLS Resources and Applications-62 © 2007 BEA Systems.Protecting Against Attacks  WLS can help protect applications against several attacks: – – – – Man in the middle attacks Denial of service (DoS) attacks Large buffer attacks Connection starvation attacks  The slides that follow detail the countermeasures WLS provides to address these attacks. Inc.

 Instead of issuing the real destination host's SSL certificate. a third party poses as a destination host intercepting messages between the client and the real host. the attacker issues his own hoping that the client accepts it as being from the real destination host.Man in the Middle Attacks  In a man in the middle attack. Inc. 523 Securing WLS Resources and Applications-63 . Man in the Middle Client Host Server © 2007 BEA Systems.

security. 524 .  A Host Name Verifier validates that the host to which an SSL connection is made is the intended or authorized party.  WLS provides a Host Name Verifier by default.Man in the Middle Countermeasures  Man in the Middle attacks can be resisted by using a host name verifier.SSL.HostnameVerifier Securing WLS Resources and Applications-64 © 2007 BEA Systems.  A custom Host Name Verifier can be created by implementing the interface weblogic. Inc.

Configuring Hostname Verifier Securing WLS Resources and Applications-65 © 2007 BEA Systems. Inc. 525 .

 There are three basic types of attack: – Consumption of scarce. 526 .Denial of Service Attacks  DoS attacks are attempts by attackers to prevent legitimate users of a service from using that service. limited. Inc. or non-renewable resources – Destruction or alteration of configuration information – Physical destruction or alteration of network components Securing WLS Resources and Applications-66 © 2007 BEA Systems.

Inc. 527 .DoS Countermeasures  Harden WLS against Denial of Service attacks by: – Filtering incoming network connections – Configuring consumable WLS resources with appropriate threshold and quotas – Limiting access to configuration information and backing up configuration files – Preventing unauthorized access by protecting passwords against password guessing attacks Securing WLS Resources and Applications-67 © 2007 BEA Systems.

that is.  This feature can be used to: – Restrict the location from which connections to WLS are made – Restrict the type of connection made. Securing WLS Resources and Applications-68 © 2007 BEA Systems. 528 . only allow SSL connections and reject all others  To filter network connections. Inc. create a class that implements the ConnectionFilter interface and install it using the administration console.Filtering Network Connections  WLS can be configured to accept or deny network connections based on the origin of the client.

529 .Connection Filter Securing WLS Resources and Applications-69 © 2007 BEA Systems. Inc.

or delaying delivery of messages in an effort to cripple JMS – Disrupting network connectivity by "connection starvation" – Consuming system memory through "large buffer attacks"  The effect of these attacks can be reduced by setting appropriate quotas and threshold values.Consuming WLS Resources  Denial of Service can come from consuming server- side resources used by Web applications: – Intentionally generating errors that will be logged consuming disk space – Sending large messages. 530 . Securing WLS Resources and Applications-70 © 2007 BEA Systems. Inc. many messages.

 Administrators can combat this attack by setting a threshold for incoming data. Inc. which starves the system of memory. 531 .Large Buffer Attacks…  Individuals can try and take down a Web site by sending a large buffer of data. Securing WLS Resources and Applications-71 © 2007 BEA Systems.

…Large Buffer Attacks Securing WLS Resources and Applications-72 © 2007 BEA Systems. Inc. 532 .

incomplete messages that cause the server to wait.Connection Starvation…  Individuals can try and take down a Web site by sending small. Securing WLS Resources and Applications-73 © 2007 BEA Systems.  Connections time out while waiting for the remainder of the data if they have reached the threshold set by the administrator. Inc. 533 .  Administrators can combat this attack by setting a threshold.

…Connection Starvation Securing WLS Resources and Applications-74 © 2007 BEA Systems. 534 . Inc.

Inc. 535 .  Administrators can protect against this security attack by setting the lockout attributes.User Lockout  Individuals attempt to hack into a computer using various combinations of usernames and passwords.  The administrator has an option to unlock a locked user through the console. Securing WLS Resources and Applications-75 © 2007 BEA Systems.

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. 537 . Inc.

 You can change the Context Path of the console. Inc.Protecting the Admin Console…  You can configure a separate administration port for all admin traffic. Securing WLS Resources and Applications-78 © 2007 BEA Systems.  You can disable the Console (application). 538 .

Inc. 539 .…Protecting the Admin Console Securing WLS Resources and Applications-79 © 2007 BEA Systems.

Section Review In this section we discussed:  Types of attacks  Protecting WLS against man in the middle attacks  Protecting WLS against denial of service attacks  Protecting WLS against large buffer attacks  Protecting WLS against connection starvation attacks  Protecting the admin console Securing WLS Resources and Applications-80 © 2007 BEA Systems. 540 . Inc.

Inc.Exercise Protecting Against Attacks  In this lab you are going to configure WLS features for hardening against password attacks. Lab Exercise Securing WLS Resources and Applications-81 © 2007 BEA Systems.  The instructor will determine the stop time.  Ask the instructor for any clarification. 541 .

Inc. groups. and roles Configuring security realms Securing Web applications with declarative security Configuring policies and SSL Creating and managing certificates – Protecting WLS against several types of attacks Securing WLS Resources and Applications-82 © 2007 BEA Systems. 542 .Module Review  In this module we discussed: – Using the WLS security architecture – – – – – Configuring users.

Inc.Module 12 Introduction to Clustering At the end of this module. 571 . 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 Introduction to Clustering-1 © 2007 BEA Systems.

Road Map 1. 572 . Networks and Clusters Cluster Communication Introduction to Clustering-2 © 2007 BEA Systems. Cluster Architecture – Cluster Definition – Basic Cluster Architecture – Multi-tier Cluster Architecture – Proxy Servers 2. 3. Inc.

 Clustering provides: – High availability domain machine server DNS Round Robin cluster server machine – Load balancing – Scalability Admin server client client client Internet Proxy Server server server Load Balancer © 2007 BEA Systems.Definition: Clustering  A cluster is a group of WebLogic Server instances. Inc. working in coordination. 573 Introduction to Clustering-3 .

Benefits of Clustering  There are two main benefits of clustering together WebLogic servers: – Scalability – High Availability  Scalability is the ability to provide more capacity for an application. Inc. Introduction to Clustering-4 © 2007 BEA Systems. 574 .  High Availability ensures that when a server (in a cluster) fails. by adding additional servers without having to make major architectural changes. there are other servers to take over the work so the client is not affected. in this case.

– Site failover When all the services and applications in a single site fail. they can switch to a separate site and continue processing. Inc. 575 . – Load balancing The even distribution of tasks and communications across multiple servers. – Server migration When a server fails.Key Capabilities  The key capabilities of a WebLogic cluster are: – Application failover When an object in an application performing a task becomes unavailable. Introduction to Clustering-5 © 2007 BEA Systems. another object will take over and finish the job. pinned services can be migrated to another server in a cluster.

each representing their distinct functionality: – Web tier – Presentation tier – Business or object tier  WebLogic provides clustering support for all three tiers. such as JMS and JDBC.  Other services. 576 . can take advantage of clusters but load-balancing and failover is a little different.Cluster Architecture  Applications are generally broken into multiple tiers. Inc. Introduction to Clustering-6 © 2007 BEA Systems.

Inc. 577 .Deciding on a Cluster Architecture  Good architecture is somewhat subjective but there are a few global considerations: – – – – – Performance Efficient state persistence Optimal load balancing Effective failover Reliable communication  There are two primary cluster architectures to choose from: – Basic cluster architecture – Multi-tier architecture Introduction to Clustering-7 © 2007 BEA Systems.

business logic and objects into one cluster.Basic Cluster Architecture  A basic cluster architecture combines static HTTP. Inc. presentation logic. 578 . domain server 1 web container Load Balancer ejb container server 2 web container ejb container Firewall Cluster Introduction to Clustering-8 © 2007 BEA Systems.

Multi-Tier Cluster Architecture  The web tier and the business logic with services can be separated into two clusters. 579 . domain server 1 web container Load Balancer server 3 EJB container server 2 web container server 4 EJB container Firewall Cluster A Cluster B Introduction to Clustering-9 © 2007 BEA Systems. Inc.

Inc. 580 .When to Use Multi-tier Architecture  The multi-tier cluster is recommended for Web Applications that require: – Load balancing for method calls to clustered EJBs – Flexibility for load balancing between servers that provide HTTP content and servers that provide clustered objects – Higher availability (fewer single points of failure) – More flexible security Introduction to Clustering-10 © 2007 BEA Systems.

Basic Cluster Architecture Advantages and Disadvantages  The basic cluster architecture has these advantages: – Easy administration – Flexible load balancing – Robust security  The basic cluster architecture has these disadvantages: – It cannot load balance EJB method calls. 581 . Inc. Introduction to Clustering-11 © 2007 BEA Systems. – Load balancing across the tiers may become unbalanced.

582 .Multi-tier Advantages and Disadvantages  The multi-tier architecture has these advantages: – Improved load balancing – Load balancing of EJB methods – Higher availability – Improved security options  The multi-tier architecture has these disadvantages: – Can create a bottleneck when presentation tier makes frequent calls to the business logic – Increased licensing cost – Added firewall configuration complexity Introduction to Clustering-12 © 2007 BEA Systems. Inc.

Introduction to Clustering-13 © 2007 BEA Systems. 583 .Proxy Servers  Proxy servers are used to provide load balancing and failover for a cluster.  A hardware-based proxy server is typically a physical load balancer. They also – Are the client’s first level of interaction with the cluster – Give the cluster its single server appearance  A proxy server can be either software-based or hardware-based.  A software-based proxy server may be an internal WebLogic servlet or a third-party application. Inc.

Inc. except static content is hosted on non-clustered HTTP servers. domain server 1 Servlet/ ejb container JSP HTTP Server Load Balancer Plug-in server 2 HTTP Servlet/ JSP Server Firewall Plug-in ejb container Cluster © 2007 BEA Systems.Basic Cluster Proxy Architecture  It is similar to the basic cluster architecture. 584 Introduction to Clustering-14 .

Multi-Tier Cluster Proxy Architecture  It is similar to the multi-tier cluster architecture. 585 . except static content is hosted on non-clustered HTTP servers. domain HTTP server 1 web container server 3 ejb container Server Load Balancer Plug-in HTTP server 2 web container server 4 ejb container Server Firewall Plug-in Cluster A Cluster B Introduction to Clustering-15 © 2007 BEA Systems. Inc.

Inc.WLS HttpClusterServlet  HttpClusterServlet: – Is deployed in the default Web application of the proxy server domain – Delivers client requests in round-robin style to servers in the cluster machine server cluster machine Admin server client client client server Internet WLS Proxy Server HttpClusterServlet server server Introduction to Clustering-16 © 2007 BEA Systems. 586 .

Inc. 587 .WLS Plug-Ins…  WLS is compatible with major Web servers using the following plug-ins: – Sun Java System Web Server plug-in (formerly Netscape iPlanet or Sun One Web Server) – IIS plug-in (Microsoft IIS) – Apache plug-in Introduction to Clustering-17 © 2007 BEA Systems.

588 .…WLS Plug-Ins  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 Introduction to Clustering-18 © 2007 BEA Systems. Inc.

– Eliminating the proxy layer reduces the number of connections. Load Balancer  There are many advantages to using a physical load balancer instead of the proxy plug-in: – There is no need to configure client plug-ins. – There are more sophisticated load balancing algorithms. 589 . Inc.Proxy Plug-in vs.  There are a number of disadvantages as well: – Additional administration – Explicit configuration of “sticky” sessions for stateful Web applications Introduction to Clustering-19 © 2007 BEA Systems.

Architecture Recommendations  If possible. Introduction to Clustering-20 © 2007 BEA Systems.  Use a combined tier architecture if your presentation and control tier makes multiple invocations of the business tier. place static web content on separate web servers in the DMZ. Inc.  Make sure that your architecture choice supports passing active and passive cookies between the cluster and client application. 590 .

Inc. 591 . we learned how to:  Describe the uses of a cluster  Describe a basic cluster architecture  Understand the use of a proxy server  Use a multi-tier architecture  Decide on the best cluster architecture to use Introduction to Clustering-21 © 2007 BEA Systems.Section Review In this section.

Road Map 1. Cluster Communication Introduction to Clustering-22 © 2007 BEA Systems. Inc. 592 . Cluster Architecture Networks and Clusters – Local Area Networks – Metropolitan Area Networks – Wide Area Networks 3. 2.

Introduction to Clustering-23 © 2007 BEA Systems. 593 .Cluster in Networks  WebLogic Server clusters can be created in three different kinds of networks: – Local Area Networks (LAN) – Metropolitan Area Networks (MAN) – Wide Area Networks (WAN)  When you are configuring your cluster. you will need to keep in mind the type of network you are using. Inc.

Local Area Networks  A local area network serves a local set of computers. Introduction to Clustering-24 © 2007 BEA Systems. high-speed communication links.  Most clusters exist within a single LAN. Inc. – Typical data transmission speeds are 100 megabits/second. – They usually use high quality. 594 .

Metropolitan Area Networks  A MAN is a network that usually spans a campus or a city.  You can have different clusters located reasonably close to each other within a MAN. 595 . Introduction to Clustering-25 © 2007 BEA Systems. Inc.

– A cluster can be located in different LANs within a MAN or within a WAN. Introduction to Clustering-26 © 2007 BEA Systems.Wide Area Networks  A WAN usually spans a wider geographical area and can be made up of smaller MANs and LANs. 596 . Inc.  You can have different clusters located in different regions within a WAN.

Inc. 597 . we learned how to:  Describe different types of networks that a cluster can operate in Introduction to Clustering-27 © 2007 BEA Systems.Section Review In this section.

Road Map 1. Cluster Architecture Networks and Clusters 3. 2. Cluster Communication – One-to-many communications – Peer-to-peer communications Introduction to Clustering-28 © 2007 BEA Systems. Inc. 598 .

599 .  IP sockets are used for peer-to-peer communications between servers.Server Communication in a Cluster  WebLogic Server instances in a cluster communicate with one another using two different techniques: – Multicast (UDP) – Sockets (peer-to-peer TCP)  IP multicast broadcasts one-to-many communications among clustered instances. Inc. Introduction to Clustering-29 © 2007 BEA Systems.

Detecting a Failure  WebLogic clusters detect a failure of a server instance in the following ways: – Through the use of IP sockets – Through the WebLogic Server heartbeat  If a server in the cluster unexpectedly closes its socket. 600 . it will be marked as "failed" and its services will not be used. Introduction to Clustering-30 © 2007 BEA Systems. – If three heartbeats are missed from a peer server. Inc. the server is marked as "failed" and its services will not be used.  Server instances use multicast to broadcast heartbeats every 10 seconds to other server instances in the cluster.

consider these factors: – If your cluster spans multiple subnets. Introduction to Clustering-31 © 2007 BEA Systems. you network must be configured to reliably transmit messages. Inc. – A firewall can break IP multicast transmissions.One-to-Many Communications  WebLogic Server uses one-to-many communication for: – Cluster-wide JNDI updates – Cluster “heartbeats”  Because all one-to-many communications occur over IP multicast. – Multicast storms may occur.when designing a cluster. – The multicast address should not be shared with other applications. 601 .

in a multi-tier cluster architecture) Introduction to Clustering-32 © 2007 BEA Systems.Peer-to-Peer Communications  WebLogic Server uses peer-to-peer communications for: – Accessing non-clustered objects that reside on a remote server instance in the cluster – Replicating HTTP session states and stateful session EJB states between a primary and a secondary server – Accessing clustered objects that reside on a remote server instance (typically. 602 . Inc.

Inc.Multi-Tier Communications  Multi-tier clusters will require more IP sockets than a combined-tier cluster: – One socket for replicating session states – One socket for each WebLogic Server in the EJB cluster. 603 . the worst- case scenario would be five open sockets per server: – One primary and secondary replicated session – Each server simultaneously invokes a remote EJB method on each node in the cluster Introduction to Clustering-33 © 2007 BEA Systems. using a three-node cluster. for accessing remote objects  As an example.

 In order for multicast messages to reliably transmit across the WAN.Communication in a WAN  In a WAN. 604 . the servers in your cluster may span multiple subnets. your network must meet the following requirements: – Full support of IP multicast packet propagation – A network latency that allows for multicast messages to reach their destination in 200 to 300 milliseconds – A multicast time-to-live value high enough to ensure that routers do not discard multicast packets Introduction to Clustering-34 © 2007 BEA Systems. Inc.

Section Review In this section, we learned how to:
 Describe how servers communicate in a cluster  Understand how multi-tier clusters communicate

Introduction to Clustering-35

© 2007 BEA Systems, Inc.


Module Review In this module, we learned how to:
 Describe the differences between a basic cluster

architecture and a multi-tier cluster architecture
 Use a proxy server to load balance requests to a cluster
 Describe how servers in a cluster communicate

Introduction to Clustering-36

© 2007 BEA Systems, Inc.


Module 13

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

Configuring a Cluster-1

© 2007 BEA Systems, Inc.


Road Map

Preparing for a Cluster
– Cluster License

– – – –
2. 3.

Cluster Architecture Network and Security Topology Machines Names and Addresses

Configuring a Cluster Configuring a Proxy Server

Configuring a Cluster-2

© 2007 BEA Systems, Inc.


Preparing Your Environment
 Before you can configure a cluster, there are steps you

need to take to prepare your environment.
– – – – – Obtain a cluster license. Determine your cluster architecture. Understand your network and security topologies. Choose the machines for the cluster installation. Identify IP Addresses or DNS names, and port numbers for the server instances in the cluster.

Configuring a Cluster-3

© 2007 BEA Systems, Inc.


Cluster License
 Clustered WebLogic server instances must have a valid

cluster license.
 To update your current license, use the

UpdateLicense.cmd in the main BEA directory.
– UpdateLicense <new_license_file>
<license component="Cluster" cpus="unvalued" expiration="never" ip="any" licensee="BEA Internal Development" serial="616351266349-1844896394531" type="SDK" units="5" signature="MC0CFQCQrk+Kbddfz3RHVH6uGfj" />
Configuring a Cluster-4 © 2007 BEA Systems, Inc. 610

Cluster Architecture
 Will you be using a single tier or a multi-tier

 How are you going to do your load balancing? – Are you going to use basic WebLogic server load balancing?

– Will you use a third-party load balancer?
 Are you going to use demilitarized zones with firewalls?

Configuring a Cluster-5

© 2007 BEA Systems, Inc.


Network and Security Topology
 Will your cluster exist in a single LAN?  Will your cluster span a MAN or a WAN?

 Depending on the network topology you choose, your

security requirements will change.
– Some network topologies can interfere with multicast communications. – Avoid deploying server instances in a cluster across a firewall.

Configuring a Cluster-6

© 2007 BEA Systems, Inc.


Security Options for Cluster Architectures
 For proxy architectures you could have: – A single firewall between untrusted clients and the Web server layer

– A firewall between the proxy layer and the cluster
 When using a load balancer, in addition to the security

features provided with the load balancer, you may want to place a firewall between it and untrusted clients.
 When you use a single database supporting both

internal and external data:
– Place an additional firewall in front of the database server

Configuring a Cluster-7

© 2007 BEA Systems, Inc.


 You may set up a cluster on a single, non-multihomed

computer for demonstration or development.
– This is not practical for production environments.
 The machine cannot have a dynamically assigned IP

 There is no built-in limit for the number of server

instances in a cluster.
– The only limitation is your license.

– Large, multi-processor servers can host large clusters. – The recommendation is one WebLogic Server instance for every two CPUs.
Configuring a Cluster-8 © 2007 BEA Systems, Inc. 614

Clustering on One Piece of Hardware
 To set up a cluster on one machine, the server is not

required to be multi-homed; the servers in a cluster can use one IP address.
 All servers in a cluster can use a dedicated multicast

port number for inter-server communication:
– Required, if servers are using a single IP address – Useful for segmenting multicast traffic among specific NICs

Configuring a Cluster-9

© 2007 BEA Systems, Inc.


Names and Addresses
 Location information will be needed for: – The administration server – Managed servers – Multicast location

 For a production environment, use DNS names, as

opposed to IP addresses.

– Firewalls can cause IP address translation errors.
 Each WebLogic server resource should have a unique

name.  The multicast address should not be used for anything other than cluster communications.
Configuring a Cluster-10 © 2007 BEA Systems, Inc. 616

Cluster Address
 The cluster address is used in entity and session beans to

construct the host name portion of request URLs.
 You can explicitly define the address of a cluster. – The cluster address should be a DNS name that maps to the IP addresses or DNS names of each WebLogic server instance in the cluster.  You can also have WebLogic Server dynamically generate an

address for each new request.
– Minimizes configuration

– Ensures accurate cluster address

 The dynamic cluster address is created in the form of:
listenaddress1:listenport1,listenaddress2:listenport2,listen address3:listenport3

Configuring a Cluster-11

© 2007 BEA Systems, Inc.


618 . Inc. we learned how to:  Prepare the environment for a cluster Configuring a Cluster-12 © 2007 BEA Systems.Section Review In this section.

Road Map 1. Preparing for a Cluster Configuring a Cluster – – – – Administration Console Configuration Wizard WLST Ant 3. 619 . Configuring a Proxy Server Configuring a Cluster-13 © 2007 BEA Systems. 2. Inc.

Configuration Options  There are multiple ways to create and configure a WebLogic Server cluster: – – – – Configuration Wizard Administration Console Ant WLST Configuring a Cluster-14 © 2007 BEA Systems. 620 . Inc.

Inc. 621 .Creating a Cluster Using the Administration Console… 1 2 3 Configuring a Cluster-15 © 2007 BEA Systems.

Inc. 622 .…Creating a Cluster Using the Administration Console Configuring a Cluster-16 © 2007 BEA Systems.

623 . Inc.Configuring Multicast Configuring a Cluster-17 © 2007 BEA Systems.

624 .Adding Servers… Configuring a Cluster-18 © 2007 BEA Systems. Inc.

Inc. 625 .…Adding Servers Configuring a Cluster-19 © 2007 BEA Systems.

Creating a Cluster with the Configuration Wizard Configuring a Cluster-20 © 2007 BEA Systems. Inc. 626 .

management.Using the Cluster MBean  The Cluster MBean is used to create a cluster using Ant or command-line tools.  Configuring the cluster from the command line requires the combined use of Cluster and Server MBeans. Inc.ClusterMBean Configuring a Cluster-21 © 2007 BEA Systems.configuration. use: weblogic.  To create new clusters within a domain. 627 .

'7050') cd('/') cd('/Servers/dizzy1') cmo.'false') cd('/') cmo. 't3://localhost:7001') edit() startEdit(-1.0') set('MulticastPort'.'239. Inc.Creating a Cluster with WLST connect('system'.192.'weblogic'.0.setCluster(getMBean('/Clusters/dizzyworldCluster')) activate() disconnect() exit() 1 011 Configuring a Cluster-22 © 2007 BEA Systems. 628 .createCluster('dizzyworldCluster') cd('/Clusters/dizzyworldCluster') set('MulticastAddress'.-1.setCluster(getMBean('/Clusters/dizzyworldCluster')) cd('/Servers/dizzy3') cmo.setCluster(getMBean('/Clusters/dizzyworldCluster')) cd('/Servers/dizzy2') cmo.

1 011 629 .1.1"/> <set attribute="MulticastPort" value="7070"/> <set attribute="ClusterAddress“ value="127.0.Type=Server"/> <set attribute="Cluster" value="dizzyworld:Name=dizzyCluster.Type=Cluster" mbean=" dizzyworld:Name=dizzy1.1"/> <set attribute="DefaultLoadAlgorithm" value="round-robin"/> </create> <set attribute="Cluster" value=“dizzyworld:Name=dizzyCluster.127.0.Type=Server"/> Configuring a Cluster-23 © 2007 BEA Systems.Creating a Cluster with Ant <wlconfig url="t3://localhost:7001" username="system" password="weblogic"> <create type="Cluster" name="dizzyCluster"> <set attribute="MulticastAddress" value=""/> <set attribute="Cluster" value="dizzyworld :Name=dizzyCluster.0. Inc.Type=Cluster" mbean="development:Name=dizzy3.0.Type=Cluster" mbean="development:Name=dizzy2.0.0.

Servers boot and join the cluster. Configuring a Cluster-24 © 2007 BEA Systems. Inc. 630 .Starting Servers in a Cluster Servers in a cluster start just like managed servers.

Inc. we learned how to:  Configure a cluster in the administration console  Create a cluster using the configuration wizard  Configure a cluster using WLST  Configure a cluster using Ant Configuring a Cluster-25 © 2007 BEA Systems. 631 .Section Review In this section.

Configuring a Proxy Server – Configuration Wizard – HTTPClusterServlet – Apache Configuring a Cluster-26 © 2007 BEA Systems. 632 . Preparing for a Cluster Configuring a Cluster 3.Road Map 1. Inc. 2.

Configuring a Cluster-27 © 2007 BEA Systems. Inc.  A WebLogic proxy server can be created initially using the Configuration Wizard.WebLogic Proxy Servers  The WebLogic HTTPClusterServlet runs within a Web application deployed on a WebLogic server. – It should run on a separate. – The servlet proxies requests to other servers in a cluster. 633 . – You can also manually set up the Web application with the HTTPClusterServlet and deploy it on the managed server. non-clustered managed server.

Create the WebLogic Proxy Server with the Configuration Wizard Configuring a Cluster-28 © 2007 BEA Systems. 634 . Inc.

635 .  This file must reside in the \WEB-INF directory of the web application directory.Creating the WebLogic Proxy Server Manually  The HttpClusterServlet is specified in the web. – This is defined in the weblogic. Inc. Configuring a Cluster-29 © 2007 BEA Systems.xml file of the default Web application on the proxy server.xml deployment descriptor located in the \WEB-INF directory of the Web application.  The proxy servlet needs to be defined as the default Web application for the managed server.

HttpClusterServlet </servlet-class> … … </servlet> <web.Configuring the HttpClusterServlet  The HttpClusterServlet is specified in the web.xml file of the default Web application on the proxy server.xml> 10 0101 1110 Configuring a Cluster-30 © 2007 BEA Systems. HttpClusterServlet Declaration: <servlet> <servlet-name>HttpClusterServlet</servlet-name> <servlet-class> weblogic. 636 .proxy.servlet. Inc.

xml> Configuring a Cluster-31 © 2007 BEA Systems. 10 0101 1110 637 .Specifying Initial Parameters Declaring initial parameters: <servlet> <servlet-name>HttpClusterServlet</servlet-name> <servlet-class> weblogic. Inc.HttpClusterServlet </servlet-class> <init-param> <param-name>WebLogicCluster</param-name> <param-value> serverA:7001:7002|serverB:7001:7002|serverC:7001:7002 </param-value> </init-param> <init-param> <param-name>DebugConfigInfo</param-name> <param-value>ON</param-value> </init-param> </servlet> <web.proxy.servlet.

jsp</url-pattern> </servlet-mapping> 10 0101 1110 <web. 638 .xml> Configuring a Cluster-32 © 2007 BEA Systems. Inc.Servlet Mapping Configuring servlet mapping: <servlet> <servlet-name>HttpClusterServlet</servlet-name> … </servlet> <servlet-mapping> <servlet-name>HttpClusterServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>HttpClusterServlet</servlet-name> <url-pattern>*.

Maximum time in seconds that the servlet ConnectTimeoutSecs should attempt to connect to the WebLogic Server host. ON/OFF ON enables SSL between secureProxy HttpClusterServlet and the server it proxies to. ON/OFF ON lets you query the DebugConfigInfo HttpClusterServlet for debugging information. (none) OFF OFF 0 (infinite timeout) 5 Configuring a Cluster-33 © 2007 BEA Systems. Interval in seconds that the servlet will sleep ConnectRetrySecs between attempts to connect to a server instance. Inc. 639 .HttpClusterServlet Initialization Parameters… Parameter Usage Default Value (Required) A list of host names and port WebLogicCluster numbers of the servers to which requests are proxied.

The string to prefix to the original URL after pathTrim is trimmed. The file extension to trim from the end of the URL. trimExt pathPrepend none none Configuring a Cluster-34 © 2007 BEA Systems.…HttpClusterServlet Initialization Parameters Parameter pathTrim Usage Default Value none The string to trim from the beginning of the original URL. 640 . Inc.

you will need to set up a proxy plug-in.  The following are the supported third-party web servers: – Netscape Enterprise Server – Apache – Microsoft Internet Information Server Configuring a Cluster-35 © 2007 BEA Systems. 641 . instead of a WebLogic web server.Third-Party Proxy Servers  If you are using a supported third-party web server. Inc.

Configure Apache Plug-in…  Install the Apache HTTP Server plug-in as a module in your Apache HTTP Server installation. select shared object type – mod_wl_20.x) – (Standard Apache Version 2. 642 .x and higher)  To configure the Dynamic Shared (Apache with SSL/EAPI) Configuring a Cluster-36 © 2007 BEA Systems.  The module can be configured in two different ways: – As a dynamic shared object – As a statically linked module (1. Inc.

1:7003. – LoadModule weblogic_module modules/mod_wl_20.127.0. <IfModule  Add an IfModule block to define the WebLogic Cluster Instance. Inc. 007 </IfModule> Configuring a Cluster-37 © 2007 BEA Systems. 643 .…Configure Apache Plug-in…  Edit the httpd.c> WebLogicCluster 127.0.conf file and include WebLogic Server Modules.

Inc.1:7003. <Location /weblogic> SetHandler weblogic-handler WebLogicCluster…Configure Apache Plug-in  Add the proxy path.1:7007 DebugConfigInfo ON PathTrim /weblogic </Location> Configuring a Cluster-38 © 2007 BEA Systems.0.1:7005.127.0. 644 .0.

Configuring a Cluster-39 © 2007 BEA Systems.Apache Plug-in and SSL  You can use the Apache Plug-in with SSL to guarantee the confidentiality and integrity of data.  The Apache HTTP Server Plug-In does not use the transport protocol (http or https) specified in the HTTP request.  Even though you can use two-way SSL authentication between the client and Apache. one-way authentication will be used between Apache and WebLogic. 645 . Inc.

conf to the WebLogic SSL listen port. You can use the DemoTrust.Configure Apache Plug-in SSL  To enable SSL between Apache and WebLogic – Configure WebLogic for SSL.jks that comes with WebLogic.conf to ON. – Set the SecureProxy parameter in httpd. Configuring a Cluster-40 © 2007 BEA Systems. – Install a trusted certificate authority file on Apache. Inc. – Configure WebLogic Server’s SSL listen port. 646 . – Set the WebLogicPort in httpd.

Section Review In this section. Inc. we learned how to:  Set up the HTTPClusterServlet for proxying  Set up Apache for proxying Configuring a Cluster-41 © 2007 BEA Systems. 647 .

648 . refer to the Lab Guide. ask the instructor. Inc.  The instructor will determine the stop time.  If questions arise.Exercise Create a Cluster  For details on the exercise. Configuring a Cluster-42 © 2007 BEA Systems.

ask the instructor. refer to the Lab Guide. Configuring a Cluster-43 © 2007 BEA Systems.  The instructor will determine the stop time.Exercise Configure Proxy Servers  For details on the exercise. 649 .  If questions arise. Inc.

we learned how to:  Prepare your environment for clusters  Configure a cluster using different tools  Configure WebLogic Server and third-party proxy servers Configuring a Cluster-44 © 2007 BEA Systems. 650 .Module Review In this module. Inc.

651 . Inc. you will be able to:  Deploy applications to a cluster  Manage session state in a cluster  Troubleshoot a cluster Managing Clusters-1 © 2007 BEA Systems.Module 14 Managing Clusters At the end of this module.

Deploying Applications to Clusters – Packaging Applications – Two-Phase and Side-by-Side Deployment – Deployment Best Practices 2. 652 .Road Map 1. Session Management 3. Troubleshooting a Cluster Managing Clusters-2 © 2007 BEA Systems. Inc.

.  When deploying applications to a cluster of managed servers. they can be deployed in an exploded format. Managing Clusters-3 © 2007 BEA Systems.ear or . they must be packaged into a . Inc.jar. 653 .Packaging Applications  When deploying applications to a single managed server.war.

Managing Clusters-4 © 2007 BEA Systems. 654 . Inc.  Applications are copied to the cluster and activated in two phases: – Phase 1: distributes application components and modules to the server – Phase 2: deploys the application if phase 1 is successful and permits client access  This ensures that an application is available and active on each node before clients can access it.Two-Phase Deployment  Applications are deployed using two-phase deployment (TPD).

 Session replication for deployed applications may fail if a node was partitioned at the time of deployment. Managing Clusters-5 © 2007 BEA Systems. the application will still be deployed to other nodes in the cluster.Deployer – Or check the Enable Cluster Constraints box in the console  Do not change cluster membership while deploying applications to the cluster. 655 . Inc.Deploying Applications to a Cluster  All nodes must be running before an application can be deployed to a cluster.  WebLogic allows partial deployment of applications to a partitioned server. – Avoid this by using the enforceClusterConstraints tag with weblogic.  If phase 2 of two-phase deployment fails.

656 . – Therefore. Inc.Side-by-Side Redeployment in a Cluster  When using production redeployment of an application in a cluster. each server instance in the cluster will retire the old version when work is complete on that server. different servers may be running different versions for a period of time. Application (Version 1) Application (Version 2) Application (Version 2) Deployed Server A Application (Version 1) Application (Version 2) Server B Cluster Managing Clusters-6 © 2007 BEA Systems.

Deploying Applications to a Cluster.. 1 2 Managing Clusters-7 © 2007 BEA Systems. Inc. 657 ..

. 658 . Inc.Deploying Applications to a Cluster 3 4 Managing Clusters-8 © 2007 BEA Systems...

Inc. 659 .Section Review In this section. we learned how to:  Package applications for deployment in a cluster  Deploy applications in a cluster Managing Clusters-9 © 2007 BEA Systems.

Road Map 1. Inc. Troubleshooting a Cluster Managing Clusters-10 © 2007 BEA Systems. 660 . Deploying Applications to Clusters Session Management – – – – – HTTP Session Clustering Replication Groups In-Memory Replication Persistent Replication Replication Within a MAN or WAN 3. 2.

661 .  To benefit from HTTP session state clustering. – Each persistence method has its own set of configurable parameters.HTTP Session State Replication  WebLogic Server provides clustering support for JSPs and Servlets by replicating HTTP session state. by configuring: – In-memory replication – JDBC replication – File system replication  You must also access the cluster via a collection of Web servers with identically configured proxy plug-ins or load balancing hardware.xml deployment descriptor file. Managing Clusters-11 © 2007 BEA Systems. Inc.  Session persistence is configured using the <sessiondescriptor> element in the weblogic. you must ensure that the session state is persistent.

Managing Clusters-12 © 2007 BEA Systems. machines names are used to indicate that a managed server runs on a particular piece of hardware. Inc.  Machine definitions are one of the factors WebLogic takes into account when it chooses another server as its backup for session information. 662 .Machines  In WebLogic Server.

using replication groups. Managing Clusters-13 © 2007 BEA Systems. 663 .Replication Groups  A replication group is a logical grouping of related servers in a cluster.  WLS attempts to: – Send backup objects to a preferred secondary replication group. – Avoid sending backup objects to servers in the same replication group.  WLS lets you determine where to put backup objects. Inc. – Send backup objects to a different machine. if it is configured.

Configuring Replication Groups  Select each server in a cluster. and assign each a pair of replication groups. 664 . Inc. Managing Clusters-14 © 2007 BEA Systems.

Is the Server a Does the Server Reside Member of a Preferred on a Different Secondary Group? Machine? Yes No Yes No Yes Yes No No Server Rank 1 2 3 4 Managing Clusters-15 © 2007 BEA Systems.Ranking Servers  WebLogic Server ranks the servers in a cluster to determine which server to use as the backup. 665 . Inc.

Managing Clusters-16 © 2007 BEA Systems.In-Memory Replication…  WLS can replicate: – HttpSession objects – Stateful session EJBs  Session objects exist on only two Server 1 Primary Server 2 servers. Inc. 666 .  Secondary: – The server is determined by the replication group and machine definition. – The object is created immediately after the primary object is created.  Primary failure makes the backup Secondary Primary Server 3 Secondary Cluster object the primary object.

…In-Memory Replication Server 1 Primary Server 2 Primary Server 1 Primary Server 2 Secondary Server 3 Server 3 Secondary Cluster Before Managing Clusters-17 © 2007 BEA Systems. Inc. Cluster After 667 .

668 . Inc.Failover with Replication Groups domain Load Balancer X X servlet primary state servlet primary state machine 1 server A machine 2 server B server C servlet secondary state client Firewall Cookie Primary: server A Secondary: server B Cluster Managing Clusters-18 © 2007 BEA Systems.

clients must access the cluster using either: – Load-balancing hardware (WLS aware) – A collection of Web servers. with WebLogic proxy plug-ins (configured identically) – WebLogic server configured with HTTPClusterServlet Managing Clusters-19 © 2007 BEA Systems. 669 .Requirements for In-Memory Replication  Subsequent requests from the same client must have access to the same primary object.  To use in-memory replication for HTTP session state. Inc. or a single Web server.

Configuring In-Memory Replication  To configure in-memory replication: 1. Specify the persistence type in the weblogic. Configure a proxy server (if applicable). 3. 670 . Configure replication groups and/or machines (optional). 2.xml> Managing Clusters-20 © 2007 BEA Systems.xml deployment descriptor: Configuring in-memory replication session persistence: <session-descriptor> <persistent-store-type>replicated</persistent-store-type> </session-descriptor> 10 0101 1110 <weblogic. Inc.

Inc. Database Server 3 Servlet1 Servlet2 HttpSession objects stored in database Managing Clusters-21 © 2007 BEA Systems.Persistent JDBC Replication – ALL server instances have access to ALL sessions. 671 . • Great failover capability • Significant performance reduction Cluster Server 1 Servlet1 Servlet2 Server 2 Servlet1 Servlet2 Common access obtained via identical connection pools – Changing session objects causes (slow) DB synchronization. – Subsequent requests from same client can be handled by ANY server.

2. Create a connection pool that has read/write privileges for your database. 672 . 3. Create a table in the database. Inc. Configure your session persistence in the weblogic. Example of configuring session persistence: <session-descriptor> <persistent-store-type>jdbc</persistent-store-type> <persistent-store-pool>SessionDS</persistent-store-pool> <persistent-store-table>WL_SERVLET_SESSIONS</persistentstore-table> </session-descriptor> 10 0101 1110 <weblogic.xml> Managing Clusters-22 © 2007 BEA Systems.Configuring JDBC Replication  To configure JDBC replication: 1.xml deployment descriptor.

100 variable width char Prim. 1 character BLOB. very large numeric. Inc. 20 digits numeric. 20 digits WL_IS_VALID WL_SESSION_VALUES WL_ACCESS_TIME WL_IS_NEW Managing Clusters-23 char. 20 digits © 2007 BEA Systems. 673 . Key WL_ID WL_CONTEXT_PATH WL_CREATE_TIME numeric.JDBC Persistent Table Configuration  A database table named WL_SERVLET_SESSIONS must exist with read/write access: Column Head Column Data Type char.

– The file must have the appropriate access privileges.File Persistence  Session state may also be stored in a file.  For file-base persistence: – You must create the directory in which to store the file. Inc. Managing Clusters-24 © 2007 BEA Systems. 674 .

Specify the file persistence type in the weblogic. 675 .Configuring File Persistence  To configure file-based session persistence for a Web application: 1. Create a folder shared by all servers on the cluster.xml> Managing Clusters-25 © 2007 BEA Systems.xml deployment descriptor: Example of configuring session persistence: <session-descriptor> <persistent-store-type>file</persistent-store-type> <persistent-store-dir>shared folder location</persistentstore-dir> </session-descriptor> 10 0101 1110 <weblogic. 2. Inc.

 Cross-cluster replication is achieved using global and local hardware load balancers. Global Load Balancer Local Load Balancer Local Load Balancer Replication Channel Cluster A Cluster B Domain A Managing Clusters-26 © 2007 BEA Systems.Session State Replication Across Clusters  HTTP session state across clusters improves high- availability and fault tolerance. Inc. Domain B 676 .

if you want session replication between two cluster instances because they are relatively close together. you can replicate session states synchronously. low-latency connection between the two clusters – Uses in-memory replication  MAN replication relies on a global load balancer to maintain cluster affinity and a local load balancer to maintain server affinity. 677 . – Assumes there is a high-speed. Inc.Session Replication in a MAN  In the case of a MAN. Managing Clusters-27 © 2007 BEA Systems.

Session Replication in a WAN  If you want to failover requests from one cluster to another across a WAN in the event that one of the clusters completely dies. you can use the WAN session state replication. Inc.  WAN session state replication entails: – In-memory replication of the session state to a local server instance – Asynchronous JDBC persistence to a remote cluster instance Managing Clusters-28 © 2007 BEA Systems. 678 .

 In a WAN environment. – Each domain must be configured identically. Inc. – The domains need to trust each other. – They must be able to maintain session IDs. – Application deployment must be identical. 679 . there must be a data source setup to maintain session state. Managing Clusters-29 © 2007 BEA Systems.  The cluster must be configured for cross-cluster replication. – The cluster failover timeout should not be set too high.Configuration Requirements for CrossCluster Replication  Load balancers must be installed.  Domains must be configured. – They must know which backup cluster to use when a primary cluster or server fails.

Inc. 680 .Configuring a Cluster for CrossCluster Replication Managing Clusters-30 © 2007 BEA Systems.

 Ensure that objects placed in replicated sessions are serializable.  Choose the most apropos replication strategy depending upon application needs and architecture. Managing Clusters-31 © 2007 BEA Systems.  Use Replication Groups to define failover strategy. Inc.  Use the ServerDebugConfig MBean to track session replication problems. 681 .State Management Best Practices  Create WLS machines if you are replicating state across servers on different physical machines.

Section Review In this section, we learned how to:
 Configure HTTP session clustering  Configure replication groups

 Configure in-memory replication  Configure JDBC and file persistent replication
 Replicate session state within a MAN or WAN

Managing Clusters-32

© 2007 BEA Systems, Inc.


Road Map
1. 2.

Deploying Applications to Clusters
Session Management


Troubleshooting a Cluster
– – – – – – Invalid License Server Versions Multicast CLASSPATH Thread Count Garbage Collection

Managing Clusters-33

© 2007 BEA Systems, Inc.


Invalid License
 If a valid cluster-enabled license is not found in

license.bea when WebLogic Server starts, it will not join a cluster.
– You will see the error message "Unable to find a license for clustering."

Managing Clusters-34

© 2007 BEA Systems, Inc.


Server Version
 All servers in a cluster must have the same major

version number.
– Servers can have different minor version numbers and service packs
 The administration server should also have the same

major version number.

Managing Clusters-35

© 2007 BEA Systems, Inc.


 If there is an IP multicast problem, WLS starts but does

not join a cluster.
 To verify that multicast is working, run the utility


Valid IP Multicast Addresses: to

IP Multicast Test Utility:
java utils.MulticastTest -N <name> -A <multicastAddress>
-N name (REQUIRED) -P port number -S send pause
Managing Clusters-36

-A address (REQUIRED) -T timeout in seconds -L time to live
© 2007 BEA Systems, Inc.

10 0101 1110


Example: Test Multicast

Managing Clusters-37

© 2007 BEA Systems, Inc.


 The CLASSPATH value must be the same on all

managed servers in the cluster.
 The CLASSPATH is set by the setEnv script when

the startManagedWebLogic file is run.

Managing Clusters-38

© 2007 BEA Systems, Inc.


Garbage Collection
 The frequency and length of the garbage collection can

affect a cluster.
 If garbage collection is taking too long, the servers will

not be able to make the heartbeat signals.
 Heap allocation can be tuned to adjust the length of

garbage collection.
– This can be changed using the –Xms and –Xmx parameters in the server startup script.

Managing Clusters-39

© 2007 BEA Systems, Inc.


Section Review In this section, we learned how to:
 Troubleshoot common issues with starting a cluster of


Managing Clusters-40

© 2007 BEA Systems, Inc.


Exercise Manage HTTP Session States
 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-41

© 2007 BEA Systems, Inc.


Module Review In this module, we learned how to:
 Deploy applications to a cluster
 Manage and configure session state in a cluster  Troubleshoot common issues in a cluster

Managing Clusters-42

© 2007 BEA Systems, Inc.


Module 16

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

Clustering Services-1

© 2007 BEA Systems, Inc.


Road Map

Clustering Services
– Clusterable Services

– Service Level Migration – Server Level Migration


3. 4.

JDBC Transactions JMS

Clustering Services-2

© 2007 BEA Systems, Inc.


 WebLogic Server provides clustering services for: – Web applications – EJB and RMI objects – JNDI tree  WebLogic Server provides limited clustering services for: – JDBC connections – JMS destinations Clustering Services-3 © 2007 BEA Systems. 723 . Inc.Which Services Can Be Clustered?  A clustered service is an API or interface that is available on multiple servers in a cluster.

Inc. 724 .Service Failover  Services that are deployed to all servers in a cluster automatically have transparent failover.  There are two ways to handle JMS and JTA failover: – Service Level Migration – Server Level Migration Clustering Services-4 © 2007 BEA Systems.  JMS and JTA cannot be deployed to all servers in a cluster – They are pinned services.

 Pinned services are moved from the failed server to a new server. 725 . – The new server then takes over and processes any data left over when the server failed. Clustering Services-5 © 2007 BEA Systems. Inc.  A migratable service is accessed by clients using a migration-aware RMI stub.Service-Level Migration  Service-level migration is performed manually. and then takes over any future processing.

in its entirety. – It is an alternative to service-level migration. Clustering Services-6 © 2007 BEA Systems.  Server-level migration is: – Only supported using the Secure Shell (SSH) version of Node Manager – Not supported on Windows  Server-level migration can happen both manually and automatically. it moves to another machine. – If it cannot be started on the same machine. 726 . – They should not be used together.  When a migratable server fails: – The server is automatically restarted on the same machine.Server-Level Migration  Server-level migration moves the whole clustered server instance. Inc.

727 .Server Level Migration Services and Resources  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 Clustering Services-7 © 2007 BEA Systems. Inc.

Server Migration Environment  Before configuring server migration. Inc. your environment must be set up properly. – Interface names for each server should be the same. – Each server hosting migratable services should be time synched. – Each managed server must use the same subnet mask for multicast communications. Clustering Services-8 © 2007 BEA Systems. – All operating system versions must support identical functionality for ifconfig. 728 . – The database you are using to support migration must be supported. are included in your machine's PATH. Clustering Services-9 © 2007 BEA Systems. 729 . – Ensure that wlsifconfig. – Configure a data source to point to the server migration database. Inc. – Grant superuser privileges to the wlsifconfig.Server Migration Configuration…  To configure server migration: – Configure each machine using server migration with a floating IP address. – Configure the SSH version of Node Manager on each managed server (it must be running as well).sh and nodemanager. – Configure the database by creating the leasing tables used to store machine-server

– Set the candidate machines for server migration.…Server Migration Configuration…  To configure server migration (continued): – Ensure that the machines hosting migratable services trust each other. – Edit wlscontrol. 730 . Clustering Services-10 © 2007 BEA Systems. and set the Interface variable to the name of your network interface. – Configure the server properties to enable server migration.

Inc.…Server Migration Configuration Clustering Services-11 © 2007 BEA Systems. 731 .

 Node Manager security files must be copied to each machine.Server Migration Restrictions  Each managed server must be configured to use the same subnet mask. – You should store files on a different disk that is accessible by all the machines. 732 .  There is no built-in mechanism for transferring files. Inc. Clustering Services-12 © 2007 BEA Systems.  Channels/Network Access Points must not have different Listen Addresses on a migratable server. – You can use the nmEnroll() WLST command.

733 . Inc.Migratable Server Startup Process Machine A Admin Server Start cluster Machine B Machine C Database Lease Table Managed Server 1 Managed Server 2 Node Manager Config Node Manager Config 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) Clustering Services-13 © 2007 BEA Systems.

734 . Inc.Automatic Server Migration Machine C Machine B Managed Server 2 (migratable) Database Managed Server 1 Cluster Master Lease Table Machine A Admin Server Machine D Managed Server 2 (migratable) Node Manager Node Manager Node Manager Config Machine C fails Cluster Master detects that Mged Server 2's lease is expired Cluster Master tries to contact NM Cluster Master contacts NM Start Mged Server 2 Obtain configuration Obtain lease Cache config Clustering Services-14 © 2007 BEA Systems.

Manual Server Migration Machine A Admin Server Initiate manual migration Contact NM Stop Managed Server 2 Give up lease Contact NM Machine C Database Managed Server 2 (migratable) Lease Table Machine D Managed Server 2 (migratable) Node Manager Node Manager Config Start Managed Server 2 Obtain configuration Cache config Clustering Services-15 © 2007 BEA Systems. 735 . Inc.

Section Review In this section. Inc. we learned how to:  Understand what services are clusterable  Understand the difference between service-level migration and server-level migration  Set up server-level migration Clustering Services-16 © 2007 BEA Systems. 736 .

Clustering Services JNDI – Cluster-Wide JNDI Server – JNDI Naming Conflicts 3. JDBC Transactions 5. 4.Road Map 1. Inc. 2. 737 . JMS Clustering Services-17 © 2007 BEA Systems.

Inc. 738 . transparently. Clustering Services-18 © 2007 BEA Systems. RMI objects – JMS connection factories  WebLogic Server replicates clusterable objects to all servers on a cluster.JNDI Clustering Support  The JNDI tree contains factory objects for accessing these items: – JDBC DataSources – EJBs.

739 . Inc.Cluster-Wide JNDI Service  Each WLS server issues messages that announce these events: – A new object bound into the naming tree – An object removed from the naming tree – An object rebound (updated) into the naming tree JNDI server A JNDI server B Cluster Clustering Services-19 © 2007 BEA Systems.

a naming conflict can occur when the server tries to bind a clustered object with the same name as a non-clustered object. – The services are non-clustered. 740 . – The object will be bound to the JNDI locally. Inc. Clustering Services-20 © 2007 BEA Systems. not the individual servers.JNDI Naming Conflicts  A naming conflict generally occurs when a server instance attempts to bind a service to the JNDI when that name already exists. – Deploy to the cluster itself.  To avoid naming conflicts: – Deploy all clusterable objects to all servers in the cluster. – Other servers will not bind the replica-aware stub.  In a cluster.

we learned how to:  Understand how JNDI clustering works  Deal with JNDI naming conflicts Clustering Services-21 © 2007 BEA Systems.Section Review In this section. Inc. 741 .

2.Road Map 1. 5. 742 . Transactions JMS Clustering Services-22 © 2007 BEA Systems. Multi-Data Sources – Targeting a Data Source to a Cluster 4. Inc. Clustering Services JNDI 3. JDBC – JDBC Clustering – Clustering vs.

Clustering Services-23 © 2007 BEA Systems. 743 . – Cluster target—a data source instance is created on all member servers in the cluster. – Single server target—a data source instance is created on the server.JDBC Clustering  These JDBC objects are clusterable: – Data Sources – Multi Data Sources  When you target a JDBC data source.  Clustering your JDBC objects does not enable failover of connections but it can ease the process of reconnection when a connection fails. Inc. a new instance of the data source is created on the target.

Multi Data Sources Feature Local Clients Cluster Access via JNDI Multi Data Source Access via JNDI Remote Clients Failover Access via JNDI None Access via JNDI On the same server (HighAvailability Algorithm only) On the same server (LoadBalance Algorithm only) Load balance None Clustering Services-24 © 2007 BEA Systems. Inc. 744 .Clustering vs.

Inc.Targeting a DataSource to a Cluster. 1 2 Clustering Services-25 © 2007 BEA Systems.. 745 ..

.Targeting a DataSource to a Cluster 3 4 Clustering Services-26 © 2007 BEA Systems.. 746 .. Inc.

747 .Section Review In this section. Inc. we learned how to:  Understand JDBC clustering capabilities  Understand the difference between JDBC clustering and multi data sources  Deploy a JDBC data source to a cluster Clustering Services-27 © 2007 BEA Systems.

748 .  The instructor will determine the stop time. ask the instructor.Exercise Cluster JDBC Data Sources  For details on the exercise. refer to the Lab Guide. Inc. Clustering Services-28 © 2007 BEA Systems.  If questions arise.

Inc. 749 . 2.Road Map 1. JDBC Transactions – Transaction Recovery Service – Migrating JTA 5. Clustering Services JNDI 3. JMS Clustering Services-29 © 2007 BEA Systems. 4.

Transaction Recovering After Failure  The Transaction Manager (TM) makes every effort to resolve prepared transactions even after multiple crashes.  The TM uses the Transaction Recovery Service (TRS) which: – Automatically attempts to recover transactions on system startup – Owns the transaction log for a server – Parses all log files on startup for incomplete transactions and completes them Clustering Services-30 © 2007 BEA Systems. 750 . Inc.

Transaction Recovery Service  When a server restarts after a crash or if the JTA is migrated. Inc. the TRS attempts to: – Resolve prepared transactions in T-Logs – Maintain consistency across resources – Persist in achieving transaction resolution – Report heuristic completions Domain Server A App Shared Disk TRSa Admin Server TRS TRSa TMa App TMa Persistent Store Server B Clustering Services-31 © 2007 BEA Systems. TMb 751 .

Inc.Recovering JTA Without a Cluster  To recover transactions from a non-clustered server: – Make the persistent store for the failed server available to the new server. – Set the path for the default persistent store to the path to the data file. 752 .  The TRS searches all transaction log files for incomplete transactions. – Start the new server. Clustering Services-32 © 2007 BEA Systems.

• If TRS on the backup server successfully completes all incomplete transactions. the server releases ownership of the TRS.Recovering Transactions in a Cluster  When recovering transactions in a clustered server you have two options: – Transaction Recovery Service migration • The TRS on the backup server takes ownership of the transaction log from the crashed server. • The TRS searches all transaction log files from the failed server and attempts to complete in-flight transactions. Inc. 753 . along with all the services it hosts Clustering Services-33 © 2007 BEA Systems. – Whole Server Migration • Migrates the server in its entirety.

it releases ownership of the TRS (including transaction log files) for the failed server. 3. Clustering Services-34 © 2007 BEA Systems.Recovering Transactions for a Failed Clustered Server (Manually)  Manually migrate the TRS from the crashed server to another server in the cluster using the admin console or the command-line interface: 1. The TRS searches transaction log files from the failed server for incomplete transactions and completes them. 754 . The TRS on the backup server takes ownership of the transaction log from the failed server. Inc. If the TRS on the backup server successfully completes all incomplete transactions from the failed server. 2. so the failed server can reclaim it upon restart.

Configuring JTA Service Migration  Before you can manually migrate JTA. you can define which servers are available for migration.  To set up the candidate servers. Inc. 755 . use: Environment  Servers  Configuration  Migration Clustering Services-35 © 2007 BEA Systems.

Manually Migrating the JTA to Another Server in a Cluster  When you need to migrate transactions from a failed server to a working server. use: Environment  Servers  Control  Migration Clustering Services-36 © 2007 BEA Systems. Inc. 756 .

JTA Migration Limitations  Migrating the JTA has the following limitations: – The JTA cannot be migrated to a backup server from a running server. • • The server must be stopped before migrating the JTA. The backup server does not accept new transaction work for the failed server. Clustering Services-37 © 2007 BEA Systems. – The backup server does not process heuristic log files. – The backup server only processes incomplete transactions. 757 . Inc.

we learned how to:  Understand how the transaction recovery service recovers transactions after a failure  Manually migrate transactions to another server in the cluster Clustering Services-38 © 2007 BEA Systems. 758 .Section Review In this section. Inc.

Road Map 1. 2. 5. 4. 759 . JDBC Transactions JMS – Clustering JMS – Distributed Destinations – JMS Failover Clustering Services-39 © 2007 BEA Systems. Inc. Clustering Services JNDI 3.

 WebLogic Server provides failover for JMS messages through: – Distributed destinations – Server-level automatic migration Clustering Services-40 © 2007 BEA Systems.  WebLogic Server supports distributing JMS destinations throughout a cluster (distributed destinations) – JMS queues and topics are still managed by a single server instance in the cluster. 760 . Inc.JMS Clustering Support  WebLogic Server supports targeting JMS connection factories to a cluster.

JMS Connection Factory Clustering.. Inc. 2 1 Clustering Services-41 © 2007 BEA Systems. 761 ..

. Inc.. 762 ..JMS Connection Factory Clustering 3 4 Clustering Services-42 © 2007 BEA Systems.

Inc.  WebLogic JMS distributes the load across the available physical destinations within the distributed destination. Clustering Services-43 © 2007 BEA Systems. – Its member availability is dynamically updated. via JNDI.Distributed Destination  A distributed destination has these properties: – It defines multiple destinations as part of one distributed destination. 763 . – It is looked up as a regular destination.  Producers and consumers can send to and receive from a distributed destination.

Inc. s1 s3 m9 m8 m3 queue Q Receivers s2 JMS ServerB Dest3 . m6 m2 m1 queue Q 764 © 2007 BEA Systems...Distributed Queues WebLogic Server 1 Senders JMS ServerA ... . m7 m5 m4 queue Q WebLogic Server 2 r1 r2 r3 r4 JNDI Tree Dest1 Dest2 Dest3 Dest4 Clustering Services-44 JMS ServerC ...

.. s1 Dest3 m3 m2 m1 topicT s2 s3 WebLogic Server 2 JNDI Tree Dest1 Dest2 Dest3 Dest4 Clustering Services-45 JMS ServerC . 765 .. Persistent Storage p1 p2 p3 m3 m2 m1 topicT Subscribers JMS ServerB .. Inc.. m3 m2 m1 topicT s4 © 2007 BEA Systems..Distributed Topics WebLogic Server 1 Publishers JMS ServerA .

766 . Inc.Create a Distributed Topic… Clustering Services-46 © 2007 BEA Systems.

767 .…Create a Distributed Topic… Clustering Services-47 © 2007 BEA Systems. Inc.

Inc. 768 .…Create a Distributed Topic Clustering Services-48 © 2007 BEA Systems.

Distributed Destination Threshold and Quota Clustering Services-49 © 2007 BEA Systems. 769 . Inc.

Attempts to create a connection to a server with which the client already has a connection.Server Affinity  WebLogic will try to establish new connections to the same servers as existing connections. the original client connection server instance 2. This may be JTA or JMS transaction dependent. 770 . Clustering Services-50 © 2007 BEA Systems. Attempts to create a connection on the same server as the JNDI initial context.  Applies to distributed destinations only. For a new JMS connection distributed destination: 1. 3. Inc. JMS or non-JMS. Creates the connection on any server.

it is used as follows: – A producer avoids a zero consumer. 771 . Clustering Services-51 © 2007 BEA Systems. Inc.  Persistent messages are put in a backing store.  Transaction affinity favors members that are already involved in a transaction.Zero Consumers…  Server affinity favors members on the same server as the client.  A zero consumer is a member that has no consumers. – A consumer searches for zero consumer.

m6 m3 m2 queue Q JMS ServerB Dest3 r1 X WebLogic Server 2 queueQ r3 JNDI Tree Dest1 Dest2 Dest3 Dest4 Clustering Services-52 JMS ServerC r4 . m5 m4 m1 queue Q 772 © 2007 BEA Systems.…Zero Consumers WebLogic Server 1 JMS ServerA s1 s2 s3 . Inc. .....

Clustering Services-53 © 2007 BEA Systems.Load Balancing  If the destination is not distributed: – All production is directed at one destination. – Load balancing is either round-robin or random. – The consumer uses that destination. Inc. which is selected at creation time.  If the destination is distributed: – Production is replicated across member topics and queues. – The consumer is pinned to one member destination. 773 . – Load balancing does not occur.

Inc.  Clients look up a destination on any server and receive Clustering Services-54 © 2007 BEA Systems. 774 . a connection on the actual server.  Use the isJNDINameReplicated() method in the JMSQueueMBean or JMSTopicMBean.Location Transparency  Standard destinations can be replicated in the cluster- wide JNDI service.  Select Replicate JNDI Name in Cluster in the admin console.

Failover  Failover is both automatic and manual.  A manual failover includes migrating these elements: – An entire JMS Server – A persistent store – A transaction log  WLS provides a migratable JMS service that attempts to deliver outstanding JMS messages. Clustering Services-55 © 2007 BEA Systems. Inc. 775 .

 Migration may be a part of scheduled maintenance.  When a WebLogic server fails. Migration must be configured ahead of time.  A JMS server can migrate to a WebLogic server that already hosts distributed destination members.JMS Server Migration  JMS is an exactly-once service. Clustering Services-56 © 2007 BEA Systems. migratable targets must have access to the same JMS store as the original server.  For persistent messaging. each JMS server exists on exactly one WebLogic server. Inc. 776 . its JMS servers can be migrated.

777 . Inc.  Migration can be manually initiated or automatically initiated.Performing Migration  Services migrated to a non-running server will be started when the server starts. – Automatic migration happens through whole server migration only.  It is possible to use third-party products to perform migration: – JMX – Veritas HA Clustering Services-57 © 2007 BEA Systems.

an administrator can limit which servers will receive the migrated JMS server by specifying a defined set of migratable targets within a cluster. – Optionally. 778 . Clustering Services-58 © 2007 BEA Systems. Inc.JMS Migratable Targets  The JMS server can be manually migrated to any other server in a cluster.

no changes are required. also migrate the transaction logs.  For transactions. 779 .Migrate JMS Data  For the JDBC store: – If it is on the failed server. Inc.  For the file store: – Migrate to a new server. – Ensure that the pathname is the same on the new server as the original one. – If it is not on the failed server. migrate the database to the new server and change the JDBC URL for the JDBC store’s DataSource. Clustering Services-59 © 2007 BEA Systems.

2.Migration Configuration  To configure a JMS migration: 1. 780 . Create physical member destinations (use the auto-deploy option for distributed destinations). Clustering Services-60 © 2007 BEA Systems. Define migratable target servers in the cluster. Create JMS Servers and assign to the migratable targets. Inc. 3.

Inc.Configure a Migratable Target Clustering Services-61 © 2007 BEA Systems. 781 .

Inc. 782 .Target JMS Server to a Migratable Target Clustering Services-62 © 2007 BEA Systems.

783 .Migrate Services Clustering Services-63 © 2007 BEA Systems. Inc.

we learned how to:  Handle failover and load balancing of JMS connections  Cluster a JMS connection factory Clustering Services-64 © 2007 BEA Systems. 784 .Section Review In this section. Inc.

ask the instructor.Exercise Load Balance JMS Messages  For details on the exercise. Clustering Services-65 © 2007 BEA Systems. refer to the Lab Guide.  If questions arise.  The instructor will determine the stop time. Inc. 785 .

Module Review In this module. 786 . Inc. we learned how to:  Migrate a whole server  Cluster JNDI objects  Cluster JDBC data sources  Cluster transactions  Cluster JMS connection factories Clustering Services-66 © 2007 BEA Systems.

Lab-1 © 2007 BEA Systems.Lab  Execute commands against Ed.Lab Introduction to BEA Ed.Lab At the end of this module. you will be able to:  Install a new course using Ed. Inc.Module 18 Introduction to BEA Ed. 819 .Lab  Explain the components that implement Ed.

Lab-2 © 2007 BEA Systems.Lab – Install a Course – Set Up a Lab Exercise – Continue a Previous Lab Exercise – Continue Your Current Work 2.Road Map 1.Lab Internals Introduction to BEA Ed. Getting Started with Ed. Ed. Inc. 820 .

What Is 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. 821 .Lab consists of the following components: – Course Installer – Lab Framework Introduction to BEA Ed. Inc.Lab?  Ed. 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-3 © 2007 BEA Systems.

such as a CD.Install a Course  Execute the native script install. 822 .sh on the student media provided with the course. Supply a path to which the course will be installed.Lab-4 © 2007 BEA Systems.cmd or install. 3. Provide the path of an existing Java 5 JDK.0 4.0 HOME. such as c:\bea. Provide the path of your BEA HOME. such as c:\bea\jdk150_06 Introduction to BEA Ed. 2.  Complete the following steps: 1. Provide the path of your WEBLOGIC 10. Inc. such as c:\bea\wlserver_10.

Extract the course contents to the supplied edlab/edlab.  A log file is also generated for debugging. and JDK paths within the following files:     bin/prompt. 823 . WEBLOGIC 10. 2. Inc. Update variables for BEA.Installation Steps  The Course Installer performs the following steps: 1. Introduction to BEA Ed.Lab-5 © 2007 BEA Systems.ini */pointbase.cmd bin/prompt. Send the command setup_course to the Lab Framework for any custom installation steps.

Description BEA root installation directory Examples C:\bea D:\bea100 Variable BEA_HOME WEBLOGIC_HOME JAVA_HOME STUDENT CURRENT_LAB WebLogic product installation directory Java 5 JDK installation directory Course installation directory Resource directory associated with the lab you are currently working on © 2007 BEA Systems. C:\bea\wlserver_10.Lab-6 824 .0 C:\bea\jdk150_06 D:\java\jdk150_06 C:\student\mycourse D:\mycourse <STUDENT>\labs\lab01 <STUDENT>\labs\lab11 Introduction to BEA Ed. Inc.0 D:\bea100\wlserver_10.Reference Variables  The following variables are used throughout the course to refer to common files or directories.

Introduction to BEA Ed.Lab Lab Framework automates the initialization of resources and infrastructure for a specific lab: – Create and update WebLogic Server domains – – – – – Launch domain administration servers Launch database servers Update databases Update application source Deploy J2EE applications  The Lab Framework maintains a backup copy of each lab to allow students to restore previous work. 825 .Lab Framework  The Ed.Lab-7 © 2007 BEA Systems. Inc.

Lab-8 © 2007 BEA Systems.cmd (or . Execute bin/prompt. will be placed under the work directory. such as application source.  Any work from a prior lab will be backed up. perform the following steps: 1. Introduction to BEA Ed. Inc.  Lab resources. 2. Change directories to the location associated with the lab: cd lab01. a New Lab  To begin work on an exercise. 826 . Type the following command: ant setup_exercise.

Type the following command: ant continue_exercise. Introduction to BEA Ed. Change directories to the location associated with the lab: cd lab01.Continue an Existing Lab  To continue working on a previously started exercise.cmd (or . 2. Inc. 3. Execute bin/prompt.Lab-9 © 2007 BEA Systems. perform the following steps:  Backup resources will be restored to the work directory. 827 .

828 . Inc. 2. Execute bin/prompt. 3. perform the following steps: 1. Change directories to the location associated with the lab: cd lab01. Type the following command: ant setup_solution. Introduction to BEA Ed.Lab-10 © 2007 BEA Systems.cmd (or .Start a Lab Solution  To begin working on the complete solution for a given

/work. perform the following steps: 1.Continue Your Current Work  While working on a lab. 2. Introduction to BEA Ed. Type the following command: ant continue_work. 3. Execute bin/prompt. Inc.. such as a machine restart.Lab-11 © 2007 BEA Systems. 829 . some situation may result in the shut down of your servers or  To continue working on the current exercise.cmd (or . Change directories to work: cd .

Inc. Introduction to BEA Ed. Type the following command: ant setup_demo.Start a New Demo  To initialize and begin presenting a course demonstration.. 2. 3. perform the following steps: 1./demos/demo01. 830 . Change directories to the location associated with the demo: cd .cmd (or .Lab-12 © 2007 BEA Systems. Execute bin/

831 . Introduction to BEA Ed.Lab documentation at the location <STUDENT>/edlab/docs. Inc.Lab-13 © 2007 BEA Systems.Additional Documentation  You can find additional Ed.

832 . Inc. we learned how to:  Explain the capabilities of Ed.Lab-14 © 2007 BEA Systems.Section Review In this section.Lab  Install a course  Start a new lab  Continue an existing lab Introduction to BEA Ed.

833 .properties Introduction to BEA Ed.Road Map 1. 2. Getting Started with Ed. Inc.Lab Ed.Lab-15 © 2007 BEA Systems.Lab Internals (Optional) – Course Layout – Dispatcher – edlab.

834 .Lab-16 © 2007 BEA Systems.cmd Resources for any course demonstrations Lab Framework scripts and configuration files Resources to initialize during course installation Resources for any course labs Workspace containing files for the current lab or demo Introduction to BEA Ed.Course Layout  The layout of a typical Ed. Inc. such as prompt. selected during installation Native scripts.Lab course is shown below: Directory Tree Description Course root location.

xml 1 3 «Ant» dispatcher. Inc.Lab Framework Implementation «Ant» «Ant» :Event Handlers :Tasks Introduction to BEA Ed.xml 2 «Ant» «Ant» :Task «Ant» :Task :Task edlab. 835 .xml build.Lab-17 © 2007 BEA Systems.

836 .Lab Framework Layout Directory Tree Description Lab Framework root directory Resources (apps. Inc.Lab documentation Lab Framework log files Application init and deployment scripts Database start and update scripts Domain initialization and update scripts Miscellaneous scripts Server start script Server update script Lists the current lab Dispatcher Ant script Default Lab Framework configuration Introduction to BEA Ed. etc.Lab-18 © 2007 BEA Systems.) common to all labs Ed.

Lab-19 © 2007 BEA Systems. this file. or event. using the file edlab. Inc. Introduction to BEA Ed.Lab Framework Configuration…  The Dispatcher determines how to process a  You can also configure individual task scripts using  A default edlab. 837 .properties is under the edlab course directory.

838 .Lab-20 © 2007 BEA Systems. configuration Inc.…Lab Framework Configuration  An individual lab or demo may have its own copy of edlab.  Properties in this file will be merged with the default Introduction to BEA Ed.

Sample Configuration jdkhome=d\:\\bea100\\jdk150_06 beahome=d\:\\bea100 wlhome=d\:\\bea100\\wlserver_10.appbackupwork=tasks/app/backup_work.xml task.db1.setcurrentlab=tasks/misc/set_current_lab.handler2=domainbackupwork.Lab-21 © 2007 BEA Systems..0 event.continue_exercise=handler3 event.setup_exercise.url=jdbc:pointbase:server://localhost:9093/demo .setcurrentlab.startdb. 1 011 839 .properties> Introduction to BEA Ed. Inc..startdb.xml task.xml Register task task.appbackupwork.initdomain=tasks/domain/init_domain.startdb=tasks/db/start_db. <edlab. initdomain.path=exercise handler.domainbackupwork=tasks/domain/backup_work.setup_exercise=handler2 event.startserver Assign tasks task.xml Ant scripts Initialized by Installer Assign handlers to events task.xml to handlers task.

properties Introduction to BEA Ed. 840 .Lab-22 © 2007 BEA Systems.Section Review In this section. we learned how to:  Describe the components that make up the Lab Framework  Understand the purpose and contents of edlab. Inc.

we learned how to:  Explain the features of BEA Ed.Module Review In this module. 841 .Lab-23 © 2007 BEA Systems. Inc.Lab  Use the Course Installer  Use the Lab Framework Introduction to BEA Ed.

Module 19 Virtual Host At the end of this module you will be able to:  Explain what virtual hosting is  Create virtual hosts  Configure virtual hosts  Monitor virtual hosts Virtual Host-1 © 2007 BEA Systems. 843 . Inc.

Virtual Host-2 © 2007 BEA Systems. Inc.  It is often convenient to have the same Web server respond to requests for more than one domain name. 844 .Understanding Virtual Hosts  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.

com Web App 1 VirtualHost1 Web App 2 Web App 3 VirtualHost2 Web App 4 Requests for www.demo. Inc.The Big Picture of Virtual Hosting Requests for www. Web App 5 WebLogic Server 845 Virtual Host-3 © 2007 BEA Systems.

Create the virtual host in the administration console. Target the virtual host to a server. WLS 2 1 Virtual Host Virtual Host-4 3 Application © 2007 BEA Systems.Configuring Virtual Hosts Steps to configuring a virtual host: 1. 3. 2. Resolve DNS names in a system host file. 4. 846 . Target applications to the virtual host. Inc.

Inc.Creating Virtual Hosts Virtual Host-5 © 2007 BEA Systems. 847 .

Targeting Virtual Hosts to Servers Virtual Host-6 © 2007 BEA Systems. Inc. 848 .

849 . Inc.Targeting Applications to a Virtual Host Virtual Host-7 © 2007 BEA Systems.

Inc.Configuring Virtual Host Logging Virtual Host-8 © 2007 BEA Systems. 850 .

Review In this section we discussed:  Creating virtual hosts  Deploying Web applications to virtual hosts  Targeting virtual hosts to servers  Targeting virtual hosts to clusters  Monitoring virtual hosts Virtual Host-9 © 2007 BEA Systems. 851 . Inc.