Sei sulla pagina 1di 222

Welcome

WebSphere Application Server 5.0


Administration
Sponsored by JVR Systems, Inc

Course Summary:
The WAS 5 Administration course will start with an introduction to
WebSphere Application Server (WAS), and the installation and configuration
of WAS 5.0. It includes coverage of WAS administration, application
deployment, workload and security management, topics in troubleshooting,
and performance monitoring and tuning
Lab Environment
„ Softwares on student machines
„ OS : Windows XP professional
„ Log-in: user=student, password=student
„ Software Location : C:\softwares
„ WAS 5 BASE ( ibmwas5_base_nt.zip)
„ WAS 5 ND ( ibmwas5_nd_nt.zip)
„ WAS 5 FixPack2 BASE (was50_fp2_win.zip)
„ WAS 5 FixPack2 ND ( was50_nd_fp2_win.zip)
„ WAS 5 Cumulative Fix 13 BASE( was502_cf13_win.zip)
„ WAS 5 Cumulative Fix 13 ND(was502_nd_cf13_win.zip)
„ Oracle : Installed on server ( name :fhorcl1)
„ Oracle driver file ( classes12.zip) located on C:\oracle\lib
„ JACL scripts located in C:\softwares\scripts
„ Sample application EAR files located in C:\software\apps
Lab NetWork Deployment setup

Base Base + Base


Base +
Node ND Mgr Node
ND Mgr

Base + Base + Base


Base
ND Mgr ND Mgr Node
Node

Base Base +
Node ND Mgr
Application Server vs. Web Server
„ Web server: serves pages for viewing in the browser via
HTTP protocol.

„ Application server: an application server exposes business logic to client


applications through various protocols, possibly including HTTP
Typical communication scenario
Application Server Role & Architecture

„ An application server is a core technology that provides


key infrastructure and services to applications hosted on
a system.
„ Services
„ Resource pooling (for example, db connection pooling and object pooling)
„ Distributed transaction management
„ Asynchronous program communication, typically through message
queuing
„ Integrated security

„ Failover and application health detection services


J2EE Application Server Architecture
Application Servers Available In Market

„ IBM WebSphere
„ BEA Weblogic
„ SUN One
„ Oracle Application Server
„ Macromedia JRUN etc….

„ Open source products


„ JOnAS
„ JBOSS
„ Apache Geronimo
Introduction to IBM WebSphere Application Server

„ IBM WebSphere Application Servers allow you to quickly, reliably and


flexibly Web-enable your business.
„ Supports J2EE 1.3
„ Available in multiple editions/packages
„ Advanced Security Support
„ Sophisticated load balance and clustering capabilities
„ Browser based administration based on JMX (JAVA Management eXtension)
„ WebServices support
„ Rich tools set for administration
„ Easy migration to higher packages
WebSphere 5 Packaging

„ WebSphere Application Server V5 comes in several configurations, each offering


a combination of features geared toward different customer needs.
WebSphere 5.0 Express
„ Express V5.0 provides a combination of development tool and application
server in a single integrated package geared toward developing Web-centric
applications. It provides a simplified programming model that allows you to
create new Web applications and to convert existing static applications to
dynamic applications.

WebSphere 5.0 Base


„ The IBM WebSphere Application Server base configuration provides a robust
application deployment environment for single-server, light-production
situations. It contains a base application server that supports the full J2EE
environment. It allows a full range of enterprise integration and offers
enhanced security, performance, availability, connectivity, and scalability
options. Administration is done through a Web-based interface or through a
scripting tool.
WebSphere 5 Packaging

WebSphere 5.0 Network Deployment


„ IBM WebSphere Application Server Network Deployment is designed to add non-
programming enhancements to the features provided in the base configuration. These
enhancements add scalability features, allowing you to run applications on multiple servers
and on multiple physical nodes.
„ In addition to the base with ND also provides

„ Deployment Manager: Allowing you to manage multiple instances of base and


clustering for workload management and failover.
„ The Edge Components, including Load Balancer, Caching Proxy, and IBM HTTP
Server. These features provide the edge-of-network functions required to set up a
classic DMZ in front of the application server.
„ A private UDDI Registry for easier deployment of internal Web services
applications
WebSphere 5 Packaging
„ WebSphere 5 Enterprise
„ IBM WebSphere Application Server Enterprise provides the features in Network
Deployment plus programming model extensions for sophisticated application designs.
„ In addition to the ND features it also provides
„ Service - oriented Architecture

„ J2EE based workflow

„ Advanced transactional connectivity

„ Optimized performance

„ Programming extensions

„ Extended messaging
„ Start Beans
„ Schedule Service
„ Object pools
„ Work areas
„ Application flexibility
Components in WebSphere 5 Base and Network Deployment
„ IBM HTTP Server 1.3.26
„ IHS is an Apache based web server.
„ Webserver plug-ins
„ Web server plug-ins are used by web servers to identify requests for the WebSphere
Application Server and to forward them.
„ plug-ins are provided for IBM HTTP Server, Apache Web Server, Microsoft Internet
Information Services, iPlanet and Sun ONE Web Servers, and Lotus® Domino Web
Server.
„ Application clients
„ An application client is the interface which is used by client-application to
communicate with services provided by applications running on WebSphere
„ Application clients are ActiveX, Applet, J2EE client.

„ Application Server Toolkit (This will installed separately)


„ Tool kit includes number of eclipse based tooling products

„ Debugger

„ Profiler

„ Log analyzer
Components in WebSphere 5 Base and Network Deployment
„ Data Direct JDBC providers
„ JDBC drivers provided by a supported database vendors.
„ DataDirect type 3 (SequeLink)
„ DataDirect type 4 (ConnectJDBC)
„ Deployment Manager
„ Deployment manager is the process that communicates with independent node agents in a Network
Deployment environment. Node agents are installed with the base WebSphere Application Server
but not required until the node is added to a cell in a Network Deployment environment. Each node
agent runs in the node as lightweight (partial J2EE environment) JVM process. Node agents
coordinate such events as configuration synchronization. The Deployment Manager manages all the
nodes in a distributed topology.
„ DB2 UDB7.2
„ Not to store the configuration like the earlier versions
„ To support Database session persistence
„ IBM Directory Version 4.1
„ LDAP compatible Directory Service
Components in WebSphere 5 Base and Network Deployment

„ Edge components ( provides Workload management for WebSphere)


„ Workload management controller

„ Switch consultants

„ The Load Balancer provides switch consultants for Cisco and Nortel switches and a Site
Selector that provides a scaling load balancer.
„ Edge of network caching technology
„ Caching is used to reduce network congestion by storing frequently accessed content so
information only has to be retrieved once
What’s New in WAS 5.0
„ J2EE 1.3 Support
„ J2EE 1.3 provides enhancements in APIs - Servlets, JSP, EJB
„ Administration model using JMX
„ JMX allows to exposes java methods in distributed environment
„ Workload management enhancements
„ Enhancements in scalability, Load balancing, availability
„ Web services support
„ Improved SOAP support
„ Private UDDI registry
„ Performance Enhancements
„ JMX for admin components
„ PMI (Performance Monitor Interface)
„ Tivoli Performance Viewer
„ Security Enhancements
„ CSIv2 (common security interoperability)
„ JAAS
„ Messaging
„ Support for Message driven beans
WebSphere 4 Vs WebSphere 5
„ WAS 4.0 „ WAS 5.0
„ Security Association Service „ CSIv2
(sas)
„ Security.xml
„ Sas.server.properties
„ Resource Analyzer „ Tivoli Performance
Viewer
„ Java Admin Console
„ Wscp „ Web based console
„ Tcl „ Wsadmin
„ DB repository for config „ jacl
„ Domain „ Xml files for config
„ Administration Server „ Cell
„ Deployment Manager
(similar to Admin
server in 4.0)
WAS 5.0 Architecture - Multitier Application Environments

„ Client-tier components run on the


client machine.
„ Web-tier components run on the
J2EE server.
„ Business-tier components run on
the J2EE server.
„ Enterprise information system (EIS)-
tier software runs on the EIS server
WAS 5.0 Architecture - J2EE Application Components
WAS 5.0 Architecture - J2EE Application Installation

AAT or WSAD can be used to assemble the necessary files into an .ear
file. WebSphere provides admin tools to install the application into
WebSphere Application Server.
WAS 5.0 Architecture - Base Install Runtime Architecture
WAS 5.0 Architecture: Base Install Components
„ A base WebSphere Application Server V5 configuration includes only the
application server process. There is no node agent or Deployment
Manager involved in this configuration. No coordination between
application server processes is supported in the base configuration, with
each application server instance having to be separately administered
„ Node
„ A node is a logical grouping of WebSphere managed server
processes that share common configuration and operational
control. In the base configuration, each application server is
responsible for its own configuration in the configuration repository
„ Unlike earlier versions of WebSphere, all the configuration information
will be stored in xml files on file system not in relational db
„ Application Server
„ Primary component of WebSphere, runs in JVM and provides run time for
applications
„ Provides containers (Web container, EJB container etc..)
„ Provides Services for applications (Object Request Broker (ORB), Name
service (JNDI), Security,service (JAAS and Java 2 security), Admin service
(JMX), Trace service, Performance Monitoring Interface (PMI), Transaction
management, Messaging interfaces (JMS), E-mail interfaces (JavaMail)
Database connection (JDBC) and connection pooling)
WAS 5.0 Architecture: Base Install Components
„ Web server and Web server plug-in
„ The WebSphere Application Server works with a Web server to handle
requests for dynamic content from Web applications. The Web server and
application server communicate using the Web server plug-in.
„ The Web server plug-in uses an easy-to-read XML configuration file to
determine whether a request should be handled by the Web server or the
application server. It uses the standard HTTP protocol to communicate with
the application server, but can also be configured to use secure HTTPS
„ Embedded HTTP Server
„ WebSphere provides inbuilt http server for testing, not to be used for
production environment, and default port is 9080.
„ Virtual hosts
„ A virtual host is a configuration, enabling a single host machine to resemble
multiple host machines. It allows a single physical machine to support several
independently configured and administered applications. Each virtual host
has a logical name and a list of one or more DNS aliases by which it is
known.
„ WebSphere provides two default virtual hosts
„ Admin_host (listens on 9090 , 9043)

„ Default_host (listens 9080, 80,9443 etc)


WAS 5.0 Architecture: Base Install Components
„ Web container
„ Processes Servlets, JSPs and other server-side include files. Each web container
contains one session manager
„ Administrator specifies web container properties including
„ Default host, session manager
„ Number and type of connection between web server and web container,
listening ports
„ EJB container
„ Provides run time services needed to deploy and manage EJB’s
„ Single container can handle more than one EJB jar file
„ Provides low level services for EJB’s including JNDI,JDBC,Security, Transaction etc.
„ JCA container
„ Allow us to plug-in custom JCA resource adaptors (.rar)
„ Web administrative console and Web application
„ Web based administrative interface is installed as J2EE 1.3 app called
“adminconsole”
„ Listens on 9090, In base, it runs on the application server machine and can only
manage that server
„ In network deployment, it is installed and run on Deployment Manager machine
„ Admin Service
„ Provides necessary service to manipulate configure information for the server and
its components
„ In base, it runs in application server
„ In ND, it runs on Deployment manager, Node Agent, App server, JMS server
„ Provides security with roles (Administrator, Monitor, Configurator, Operator)
WAS 5.0 Architecture: Base Install Components
„ Scripting Client (wsadmin)
„ Provides additional flexibility over web based administration application
„ Allows administrators to automate the administration
„ Built on BSF , currently supports only JACL
„ JMS Server
„ To process messaging functions for JMS provider , supports point-to-point, publish-
subscribe
„ In base, it runs with application server JVM, in ND, it runs as separate JVM
„ Application
„ Applications are designed and developed by custom parties that are hosted and run
by application server
„ Application is packaged as EAR (enterprise archive) and it can be deployed on
multiple application servers
„ Application modules includes Web module (war), ejb module (jar), client (jar),
resource adaptor (rar)
„ Application Database
„ Database supports Applications, and runs on database server
„ Session Database
„ Used in multi server environment for session persistence
„ Name Service
„ Each JVM hosts a service to provide Java Naming and Directory Interface name
space
„ Used to register EJB’s and J2EE resources ( JDBC, JMS, J2C, URL, java mail)
„ WebSphere 5 uses Corba Naming Service(cos naming)
WAS 5.0 Architecture: Base Install Components
„ Security Service
„ Each application server JVM hosts security service to provide authorization and
authentication services by using security information specified in configuration
repository
„ Web services engine
„ Bases on apache AXIS
„ Implements SOAP, WSDL, UDDI, WSIF)
WAS 5.0 Architecture Network Deployment Runtime
Architecture
WAS 5.0 Architecture Network Deployment

„ Support for multiple nodes, each with a node agent


process and application servers
„ Clusters of Load Balanced applications servers can be
configured in Network Deployment
„ Configuration and application binaries of all components
in the cell are managed by Deployment Manager
„ Deployment Manager synchronize the configuration to
local copies of nodes( called federate)
WAS 5.0 Architecture Network Deployment Components
„ Cell
„ A cell is grouping of nodes into a single administrative domain, each node is
identified by logical name for configuration purpose. The configuration and
application binaries of all nodes in the cell are centralized into cell master
configuration repository.
„ The centralized repository is managed by Deployment Manager process
„ Deployment Manager
„ Provides single, central point of administrative control for all elements in the
cells.
„ Responsible for the content of the repositories (configuration and application
binaries) on each of the nodes. It manages this through communication with
the node agent process resident on each node of the cell
„ Using the Deployment Manager, horizontal scaling, vertical scaling and
distributed applications are all easy to administer and manage, since
application servers are managed by nodes, and one or more nodes is
managed by a cell.
„ Master configuration repository
„ The master configuration repository contains all of the cell’s configuration
data. All updates to this repository are performed by the Deployment
Manager.
„ The node repositories are read-only for application server access, since only
the Deployment Manager can initiate their update, pushing configuration
changes out from the cell master configuration repository
WAS 5.0 Architecture Network Deployment Components
„ Node Agent
„ The node agent is an administrative process and is not involved in
application serving functions.
„ Its functions includes, File transfer, configuration synchronization and
performance monitoring
„ Node agent acts as broker between Deployment manager and
application server
„ Node agent is defined each node

„ UDDI Registry & Web services Gateway


„ Provides private UDDI registry

„ Web services gateway component to support web services functions

„ Edge Components ( Caching Proxy & Load Balance)


„ Caching components to provide response time

„ Load Balance to reduce congestion , bottle necks and balance the load
over multiple servers
„ Cluster
„ Cluster is logical collection of application server processes, to provide
workload balancing
„ Application servers that belong to a cluster are "members" of that
cluster and must all have identical application components deployed on
them
WAS 5.0 Architecture Network Deployment Components
„ Managed Process
„ All operating system processes that are components of the
WebSphere product are called managed servers or managed
processes. All managed process are enabled with JMX .
„ WebSphere Managed Processes/servers
„ Deployment Manager (Network Deployment only)

„ Node agent (Network Deployment only)

„ Application server (base and Network Deployment)

„ JMS server (Network Deployment only)


WAS 5.0 Installation: Supported Platforms
„ AIX
„ OS/400
„ Red Hat Linux Advanced Server for Intel
„ Red Hat Linux for s/390
„ Solaris 8
„ SuSE Linux for Intel
„ SuSE SLES
„ Windows NT Server V4.0
„ Windows 2000 Advanced Server 2000
„ Windows 2000 Server 2000
WAS 5.0 Installation: Installation modes
„ The WebSphere Application Server installation program provides two
modes of operation:
„ GUI installation
„ Via GUI interface

„ For Testing purpose

„ For First Time Users

„ For exploring the installation procedures

„ Silent installation
„ Non interactive

„ Installation of identical configurations on multiple machines.

„ Backup of the installation settings for later reuse.

„ Scripted or unattended installations.

„ Duplication of development or testing installation in production


WAS 5.0 Installation: Supported Web Servers
„ Apache Server
„ IBM HTTP Server
„ Internet Information Server
„ Sun ONE Web Server (formerly iPlanet), Enterprise
Edition
„ Lotus Domino Enterprise Server
„ Corresponding Plug-in also need to be installed
WAS 5.0 Installation: IBM HTTP Server PORT Conflicts
„ Checking for IP port conflicts
„ The IBM HTTP Server will use three IP ports on the server. Check
that there are no existing services on the server that use these ports:
„ Port Use
„ 80 Standard HTTP port
„ 443 Standard HTTPS port
„ 8008 Administrative console
„ The following commands can be used to see a list of ports in use
„ Windows: netstat –an
„ AIX, Linux, and Solaris: netstat -an | grep LISTEN
„ If your operating system has a pre-installed Web server, you will
need to remove the existing Web server or prevent it from starting to
avoid port conflicts with HTTP server
WAS 5.0 Installation: Feature Options
Feature Testing Env Production Env

Application Server X X
Application Server Samples X

Admin scripting tool X X


Admin console X X
(will get removed after
added to cell)

AAT X
Messaging Features X X
Web server (IBM HTTP) X
Plug-ins X
Log analyzer X X
Tivoli X
Note: For production environment web server and web server plug-ins
will get installed on separate web server machine. JDK will get installed,
no need of external JDK.
WAS 5.0 Installation: PORTS and Pre-Installation Tasks

PORT USE
9080 http transport
9443 https transport
9090 Admin console
9043 Admin console secure port
2809 Boot strap
8880 Soap connector
9101 ORB listener

„ Pre-installation tasks on Linux


„ Create embedded JMS server user and groups.

„ Check IP ports are unused.


„ Stop Web server processes.
WAS 5.0 Installation: Creating JMS Users and Groups
„ You need to create the mqm user and two groups, mqm
and mqbrkrs. The user you run WebSphere as (root in our
case) and the mqm user must be members of both groups.
„ To create the embedded JMS server user and groups:

„ 1. Log in as root and start a terminal session.


„ 2. Create two new groups:
„ groupadd mqm

„ groupadd mqbrkrs

„ 3. Create a user mqm and add it to the mqm and mqbrkrs


groups.
„ useradd -g mqm -G mqbrkrs -m mqm

„ 4. Add the root user to the mqm and mqbrkrs groups.

„ 5. Log off and then on again to get the new permissions.


WAS 5.0 Base Installation: Begin Installation

„ 1. Log in as root and start a terminal session.


„ 2. Insert and mount the WebSphere
Application Server V5.0 CD-ROM:
„ mount /mnt/cdrom
„ 3. Start the WebSphere Application Server
LaunchPad. For example:
„ cd /mnt/cdrom
„ ./LaunchPad.sh
„ 4. In the language selection window, select
English and click OK.
„ 5. In the WebSphere Application Server
LaunchPad window, click Install the
product, as shown .
WAS 5.0 Base Installation: Begin Installation

„ 1. Log in as root and start a terminal session.


„ 2. Insert and mount the WebSphere Application
Server V5.0 CD-
CD-ROM:
„ mount /mnt/cdrom Launchpad
„ 3. Start the WebSphere Application Server LaunchPad.
For example:
„ cd /mnt/cdrom
„ ./LaunchPad.sh
„ 4. In the language selection window, select English
and click OK.
OK.
„ 5. In the WebSphere Application Server LaunchPad
window, click Install the product,
product, as shown .

„ 1. Please go to C:\
C:\sofwares\
sofwares\ folder and extract the
websphere base file “ibmwas5_bast_nt.zip”
„ To extract , select the file and right click on the
file and choose “Extract All” option
„ This will create a folder “ibmwas5_base_nt”
folder.
„ 2. To install the software, double click on the
“install.exe”
install.exe” file or “launchpad.bat”
„ 3. This will start the Installation wizard
„ 4. In the language selection window, select English
and click OK.
OK.
„ 5. In the WebSphere Application Server LaunchPad
window, click Install the product,
product, as shown .
WAS 5.0 Installation: Installation

Note: If you are running X-windows with either the Gnome or KDE window managers,
the CD-ROM may automatically be mounted for you. To verify this, simply run mount |
grep /mnt/cdrom. If you get any output, then the CD-ROM has already been mounted.
6. In the wizard language selection window, select English and click OK.
7. In the Welcome to WebSphere Application Server window, click Next to continue, as
shown
WAS 5.0 Base Installation: Finishing Installation

8. In the software license agreement window,


select I accept the terms in the license
agreement and click Next to agree to the
terms of the agreement, as shown

9. In the setup type window, select the Full


setup type option and click Next, as
shown
WAS 5.0 Base Installation: Choose the feature options
10. We need to choose the feature options to install on our machine,
check all the options as shown in the following screen
WAS 5.0 Base Installation: Finishing Installation

11. In the setting the installation directories window, you


can change the installation path for the WebSphere
Application Server and IBM HTTP Server. We
recommend that the default
directories(c:\
directories(c:\IBM\
IBM\WebSphere5\
WebSphere5\AppServer) be used.

12. In the node name and host name window, enter the
node name and host name for your installation. In our
case we set the node name and host name to machine
name
WAS 5.0 Base Installation: Finishing Installation
13. On windows platform, the install adds services for Websphere and HIS, please give the
username and password that have privileges to stat/stop the services
services and click
Next to start the installation

14. In the next window, verify your installation


settings, and click Next to start the
installation
WAS 5.0 Base Installation: Finishing Installation
15. Wait to finish the installation, might take few minutes depend on on the hardware.
16. Once the installation is complete, click Finish in the installation wizard finished window, as
shown
17. Uncheck the “Register Product” option and click “Next”
WAS 5.0 Base Installation: Finishing Installation
18. After a successful installation of IBM WebSphere Application Server V5.0,
the First Steps window. You can also invoke firststeps from
/AppServer/Bin/firststeps.sh.
19. Verify WebSphere Application Server
„ To confirm that WebSphere Application Server V5.0 was installed
correctly, click Verify Installation in the First Steps window
„ From command line
„ cd /opt/WebSphere/AppServer/bin
„ ./ivt.sh
20. You should see success message at the end of Installation Verification
Test.

18. After a successful installation of IBM WebSphere Application Server V5.0,


the First Steps window. You can also invoke firststeps by double clicking
on launchpad.bat
19. Verify WebSphere Application Server
„ To confirm that WebSphere Application Server V5.0 was installed
correctly, click Verify Installation in the First Steps window
or
„ From command line
„ C:\>IBM\WebSphere5\AppServer\bin\ivt.bat
20. You should see success message at the end of Installation Verification
Test.
WebSphere 5.0: Admin Console
„ The Administrative Console is graphical web based tool that will allow
to configure and administer WebSphere application server
„ The admin console is J2EE web application runs within an application
server node
„ Admin application get installed as part of installation on default server1
„ Application file is adminconsole.ear
„ To open the Admin console type following URL in the Mozilla browser
„ http://localhost:9090/admin

„ You should see the Administrative login console window

„ WebSphere application Security is not enabled yet, so we could


give any user name to login.
„ Check the application server access by typing following url, the
applications will be accessed via embedded web server.
„ http://localhost:9080/snoop
„ The browser should show the following screen
„ In admin console, until you save the configuration changes you make
during the session the changes do not become effective
„ WebSphere scripting is alternative to admin console.
WebSphere 5.0: Admin Console
„ Admin console has following main areas
„ Task bar
„ Navigation Tree
„ Workspace
„ Status Area
WebSphere 5.0: Admin Console
„ Task bar
„ Home: displays admin console home page
„ Save: allows us to save pending configuration changes
„ Preferences: allows to select admin console preferences
„ Log out: ends the current session and logs you out
„ Help: Online help, not Infocenter
„ Navigation Tree
„ Offers links to view, select and manage components in administrative cell
„ Click + to expand , click – to collapse Tree
„ Servers: Enables configuration of administrative servers, application
servers, and clusters.
„ Applications: Enables installation and management of applications.
„ Resources: Enables configuration of resources and viewing of information
on resources existing in the administrative cell.
„ Security: Enables configuration and management of WebSphere security
and SSL.
„ Environment: Enables configuration of hosts, Web servers, variables and
other components.
„ System Administration: Enables configuration and management of
nodes, cells, console security.
„ Troubleshooting: Enables you to check for and track configuration errors
and problems. Also used to set PMI metrics.
WebSphere 5.0: Admin console

„ Workspace
„ The workspace, allows you to work with your administrative configuration
after selecting an item from the console navigation tree. When you click a
folder in the tree view, the workspace lists information on instances of that
folder type. For example, selecting Servers -> Application Servers shows
all the application servers configured in this cell. Selecting an item, an
application server in this example, will display the Properties page for that
item. The Properties page can then be used to view and edit property values.
„ Status and Messages areas
„ The Status area displays along the bottom of the console and remains visible
as you navigate through the administrative console. The area displays two
frames: WebSphere Configuration Problems WebSphere Runtime Messages
Click Previous or Next to toggle between the frames. Click the number to
view details. The interval between automatic refreshes can be adjusted by
expanding Preferences below the messages. In addition, the information
displayed can be refreshed at any time by clicking the icon in the upper-right
of the area. The Messages area displays messages relevant to your
configuration.
WebSphere 5.0: Using the Admin Console
„ Select Task:The navigation tree on the left side of the console contains links to console pages that
you use to create and manage components in a WebSphere administrative
administrative cell. For example, to
create a JDBC provider you would expand Resources and then select the JDBC Providers
action.
WebSphere 5.0: Using the Admin Console
„ Start and Stop: Most items can be started and stopped using the administrative console. To start or
stop an item using the console: 1. Select the item type in the navigation
navigation tree. 2. Select the item in
the collection table by checking the box next to it. 3. Click Start or Stop. For example, to start an
existing application server, select Servers ->Application Servers. Place a check mark in the
check box beside the application server you want started and click
click Start
WebSphere 5.0: Using the Admin Console
„ Saving Configuration:
„ As you work with the configuration, your changes are saved to temporary
workspace storage. For the configuration changes to take effect, they must
be saved to the master configuration and then synchronized (sent) to the
nodes.Consider the following:
„ 1. If you work on a page, and click Apply or OK, the changes will be saved
in the workspace under your user ID. This will allow you to recover changes
under the same user ID if you exit the session without saving.
„ 2. You need to click Save to save changes to the master repository. This can
be done from the taskbar, from the Messages area, or when you log in if you
logged out without saving the changes.
„ 3. If you don’t save changes to the master repository, the changes won’t be
pushed to your node’s configuration repository. Effectively the new settings
are lost. They are just available as configuration settings in your temporary
workspace.
„ 4. The Save window presents you with the following options:
„ Save

„ Discard: Discard reverses any changes made during the working


session and reverts to the master configuration.
„ Cancel: Cancel doesn’t reverse changes made during the working
session. It just cancels the action of saving to the master repository for
now.
„ Synchronize changes with nodes: This distributes the new
configuration to the nodes.
WebSphere 5: Command Line Tools
„ A set of command line tools are provided with WebSphere to
control application server components. These tools are available
as shell scripts ad batch files.
„ These tools are available in /<WAS Home>/WebSphere/AppServer/bin
folder
„ Important Tools
„ startServer : starts a Server
„ stopServer: stops a Server
„ serverStatus: displays server status
„ addNode : add a node to cell
„ removeNode : remove a node from a cell
„ startNode : start the node agent
„ stopNode: stops the node agent
„ startManager : start deployment manager
„ stopManager : stops deployment manager
„ versionInfo : displays versions of installed products
„ syncNode: to synchronize local configuration with master
configuration
WebSphere 5: Command Line Tools
„ Important Tools
„ cleanupNode: cleans up a node configuration from a partially created
network deployment distributed administration cell
„ backupConfig: backs up the node configuration into zip file
„ restoreConfig: restored node configuration from back up file
„ wsinstance : allows to create new WebSphere application server instance
(base).
„ GenPluginCfg: to generate web server plug-in file
Introduction to J2EE
„ Java 2 Platform, Enterprise Edition (J2EE) defines a standard
that applies to all aspects of architecting and developing multi-
tier server-based applications.
„ It defines a standard architecture composed of an application
model, a platform for hosting applications, a compatibility test
suite (CTS), and a reference implementation.
„ The primary concern of J2EE is the platform specification. It
describes the runtime environment for a J2EE application. This
environment includes application components, containers,
resource manager drivers, and databases. The elements of this
environment communicate with a set of standard services that
are also specified.
„ J2EE makes all Java enterprise APIs and functionality available
and accessible in an integrated manner.
„ WebSphere Application Server Version 5.0 is fully J2EE 1.3
compliant.
J2EE: Multitiered Distributed Applications
„ The J2EE platform uses a multi-tiered distributed application model
„ Client-tier components run on the client machine.
„ Web-tier components run on the J2EE server.
„ Business-tier components run on the J2EE server.
„ Enterprise information system (EIS)-tier software runs on the EIS
server
J2EE: J2EE Object Model & Components

„ APIs
„ EJB 2.0
„ JDBC 2.0
„ Servlet 2.3
„ JSP 1.2
„ JMS 1.0.2
„ JNDI 1.2
„ JTA 1.0
„ Java Mail 1.2
„ J2C 1.0
„ JAAS 1.0
J2EE: Components

„ J2EE applications are made up of components. A J2EE component is a


self-contained functional software unit that is assembled into a J2EE
application with its related classes and files and that communicates
with other components.
„ The J2EE specification defines the following J2EE components:
„ Application clients and applets are components that run on the
client.
„ Java Servlet and Java Server Pages (JSP ) technology
components are Web components that run on the server.
„ Enterprise JavaBeans (EJB ) components (enterprise beans) are
business components that run on the server.

„ J2EE components are written in the Java programming language and


are compiled in the same way as any program in the language. The
difference between J2EE components and "standard" Java classes is
that J2EE components are assembled into a J2EE application, verified
to be well formed and in compliance with the J2EE specification, and
deployed to production, where they are run and managed by the J2EE
server.
J2EE: Server Side Components
„ Servlets: server side, run in a Web container
„ Enterprise JavaBeans (EJBs): reusable components, used for
distributed applications, run in an EJB container
„ Java Server Pages (JSPs): Web pages with server side scripting
using Java, run in a Web container
„ JDBC:The JDBC API lets you invoke SQL commands from Java
programming language methods
„ JNDI:Naming and directory interface to bind objects with names
„ JMS: The JMS is a messaging standard that allows J2EE
application components to create, send, receive, and read
messages
„ JTA: The Java Transaction API ("JTA") provides a standard
interface for demarcating transactions.
„ J2C: The J2EE Connector architecture is used by J2EE tools
vendors and system integrators to create resource adapters that
support access to enterprise information systems that can be
plugged into any J2EE product.
„ JAAS: The Java Authentication and Authorization Service ("JAAS")
provides a way for a J2EE application to authenticate and
authorize a specific user or group of users to run it.
J2EE: Client Side Components
„ Java Programs: Java classes
„ Applets: Java GUI programs , that can run in browser

„ Other Clients
„ C++ programs
„ VB Programs
J2EE: J2EE Containers
„ The J2EE server provides underlying services in the form of a container
for every component type. Because you do not have to develop these
services yourself, you are free to concentrate on solving the business
problem at hand.
„ Container Services
„ Containers are the interface between a component and the low-
level platform-specific functionality that supports the component
„ Security

„ Transaction Management

„ JNDI

„ Remote Connectivity

„ Deployment Descriptor
„ Deployment descriptors are used to communicate the needs of
application components to the deployer. The deployment descriptor
is a contract between the application component provider or
assembler and the deployer.
„ DD is XML based file

„ Each Module will have XML deployment descriptor

„ Mainly EAR Deployment Descriptor and WAR Deployment Descriptor


J2EE Enterprise Java Beans

„ The EJB component model defines the infrastructure for creating an environment
that separates system services from application business logic. The EJB server and
EJB container deal with all the system service infrastructure included in the
following list: Transactions, Persistence, Resources, Security
„ Client finds EJB using JNDI
„ Client uses EJB stubs to invoke
methods on the remote EJB object
„ Communication via RMI/IIOP
J2EE: Services: JDBC
„ Provides database connectivity for java programs
„ A JDBC Driver helps to
„ Establish connection to database from java
„ Invoke SQL queries on DB
„ Handles the results from DB and process them
J2EE: Services: JNDI
„ JNDI allows components to store and retrieve named java objects
„ Binding will occur during the startup of application server
„ Each of the following components will be identified by JNDI name
„ JDBC DataSource
„ EJB home
„ JMS component
„ Mail Source
J2EE: Services: Transactions
„ JTA is API from SUN , that allows application to access transactions
„ JTA specifies java interfaces between transaction manager and
distributed transaction system
„ JTS is implementation of transaction manager
„ Enables demarcation (Commit Entire transaction or rollback)
J2EE: Services: J2C
„ The J2EE Connector architecture is used by J2EE tools vendors and
system integrators to create resource adapters that support access to
enterprise information systems that can be plugged into any J2EE
product
Java run time
J2EE: Services: JMS
„ The JMS is a messaging standard that allows J2EE application
components to create, send, receive, and read messages. It enables
distributed communication that is loosely coupled, reliable, and
asynchronous.
J2EE: Services: Security
„ The Java Authentication and Authorization Service ("JAAS") provides a
way for a J2EE application to authenticate and authorize a specific user
or group of users to run it
„ Role based
„ Defines Security constraints mostly for web resources
„ Accessed rules for J2EE components
„ Constraints and mappings will be defined by development teams in
deployment descriptors of J2EE modules
J2EE: Development Roles
„ J2EE Product Provider
„ Implements J2EE API’s IBM WebSphere, BEA Weblogic etc..

„ Tool Provider
„ Custom tools to help J2EE application environment

„ Application component provider


„ EJB developer

„ Web component developer

„ Application assembler
„ Who assembles pieces together

„ Application Deployer
„ Who deploys application into application server

„ Application Administrator
„ Who administer and manage the application
Application Assembly: J2EE Application Assembly
DDs
EJB
jar

.war
Servlet
Any application
JSP
assembly process EAR App Server
Tools: AAT, WSAD

Resource files
HTML, GIF, pdf

Client
files

„ Application assembly is process of packaging and configuring an


enterprise application archive to deploy on application server
Application Assembly: J2EE Packaging
„ A J2EE application is packaged as Enterprise Archive (.EAR) file
„ An enterprise archive can contain one or more modules
„ Each module will have its own Deployment Descriptor
„ Deployment Descriptors will contain component configuration , that will
help container to understand the runtime behavior of component
„ An .EAR file can contain
„ .WAR ( web module)
„ .JAR ( either EJB or client JAR)
„ .RAR( J2C resource adaptors)

.EAR DD

EJB(.jar) Web(.war) .rar


One or more EJBs JSPs,Servlet,html and Client (.jar) Resource
others adaptor

DD DD DD
Application Assembly: Application Contents
„ In addition to the J2EE standard DD, vendor specific configuration files (extensions)
„ These extensions help the generic J2EE apps to fit into the custom environment
„ IBM implemented these extensions with two files
„ IBM bindings
„ Helps to bind application names to platform specific resources

„ Stored in .ear,.jar,.war files

„ Example ibm-application-bnd.xml, ibm-ejb-jar-bnd.xml,ibm-web-bnd.xml

„ IBM extensions
„ Configuration for additional services those are not part of J2EE spec.

„ Application Reloading attributes, caching , Access, Isolation etc.

„ FileServing, Servlet Invoker (to serve Servlets by classname), reload


interval, directory browsing, transaction isolation etc..
„ Example ibm-application-ext.xml, ibm-ejb-jar-ext.xml,ibm-web-ext.xml

„ Database related files


„ To help Entity Enterprise beans

„ Maps EJB fields to schema fields

„ DDL to for table creation


AAT: Application Assembly Tool
„ AAT delivers with WebSphere application
server that helps to build/package
applications according to J2EE specification
„ Buildable/editable modules including
„ EJB modules
„ Web modules
„ EAR (Application) modules
„ Client Modules
„ RAR (Resource adaptor) modules
„ AAT 5.0 supports J2EE 1.3
„ To start the tool, run the command
/WebSphere/AppServer/bin/assembly.sh
„ AAT is wizard based, runs independent
from application server
„ AAT can be used to modify Deployment
Descriptors, Binding and Extensions
AAT: Using AAT

Toolbar

EJB
Module Workspace

Web
Module

Security
Roles

DD
AAT: Deployment Descriptor
„ application.xml defines all modules in
EAR file

EJB Module

Web
Module

ejb-jar.xml Web.xml
AAT: Exploring Interface-EJB module

„ General Tab
„ Classpath and client jar
„ IBM Extensions
„ EJB generalizations,
inheritance
„ Bindings
„ Default Datasoruce JNDI for
CMP

„ General Tab
„ Specify EJB classes
„ IBM Extensions
„ Cache, timeout and transactions
„ Bindings
„ JNDI name for EJB
AAT: Exploring Interface-Web Modules
„ General Tab
„ Class for the web application
„ Advanced
„ Session time out, authorization
„ Extensions
„ Reloading, directory browsing
„ Binding
„ To locate external resources
AAT: Exploring Interface-RAR, Client Modules

„ Resource Adaptor module


can be used to create/edit
J2C resource adaptors

„ Client module can be


used to create/edit
client jar file
AAT: Exploring Interface- Verification
„ AAT can run verification on Archives
„ Verification check will determine problems in deployment descriptors
„ EAR, WAR , JAR and EJB jars will get verified

Verify
AAT: Exploring Interface- Global EJB JNDI

„ Within module EJB


lookup using EJB
reference
„ We can bind this to
global JNDI name
AAT: Exploring Interface- EJB transactions
„ Transactions can set to EJB
methods
„ To set transactions properties, right
click on “Container Transactions”
and click new.
Methods

Transaction
Attributes

„ Transactions isolation
levels can set to EJB
methods
„ Isolation specifies the
transaction behavior in
side the EJB method
Employee Application: Introduction to Employee
Application

„ Employee application is sample application that connects to oracle’s


default database and pulls the employee details
„ Functionality
„ List All employees

„ Add employee

„ Edit employee Details

„ Delete Employee

„ There are two modules


„ EmpDemoWeb.war( front-end JSP pages)

„ To list employees

„ To delete employee

„ To edit employee

„ EmpDemoEjb.jar

„ Session EJB , EmpService , that provides following functionality


„ DB connection
„ Methods for getting employee list, and to add and delete
employees
Employee Application: Employee Application Screens
„ Welcome page
Employee Application: Employee Application Screens

Add new Employee


Installing Enterprise Applications: Two Choices
„ Two choices to deploy the
applications
Xml Config
„ Web admin console files
„ Wsadmin command tool
„ Web admin console Admin Console
„ Easy to configure
„ Easy Access to errors logs
„ Good for entry level users
„ Wsadmin
Administrative Server User
„ Good for repetitive tasks
„ Commands can store in JACL
files
„ Better option for multi
server production
environments

Wsadmin
JACL command
file
Installing Enterprise Applications: Tasks & Locations
„ Following tasks can be achieved via admin console
„ Create Application Server
„ Install, uninstall , update, start and stop applications
„ Configure application environment (variables virtual hosts, classpaths,
security and console users)
„ Configure Resources , those will be used by applications
„ JDBC provider, Data source
„ JMS provider
„ Mail, URL and Resource Adaptor
„ Locations
„ The location of the EAR file before the installation could be
„ /WebSphere/AppServer/installbleApps
/WebSphere/AppServer/installbleApps
„ The location of the EAR file after the installation will be
„ /WebSphere/AppServer/installedApps
/WebSphere/AppServer/installedApps
„ During the installation the EAR file will extracted to installedApps folder
„ Applications
„ Common application file is .EAR file ( Enterprise Archive)
„ Ear composed of one or multiple modules of
„ Jar, Ejb jar, .rar
.rar
„ War (JSP’s , Servlets etc)
„ Application Server is necessary before installing the application
„ Application should always link to application Server and Server
„ Server should be running before attempting to install the application
Installing Enterprise Applications: Creating Application
Server

„ By default WebSphere
providers an application server
“server1”
„ Multiple Application Servers will
provide isolation between
applications
„ Each application server runs in
its own JVM
„ To Create Application Server
select
„ Servers>Application
Servers>New
„ In WebSphere Base admin
console is attached default
server server1
„ WebSphere base is single
server compatible, multiple
servers can be added but can
not administer via admin
console
Installing Enterprise Applications: Creating Application
Server

1. Select Node
1. In Network Deployment
environment , we can
choose which node we
want to create the 1
server on 2
2. Enter Name 3
3. Choose to Generate
Unique HTTP transport
ports 4
1. WebSphere will manage
to create unique ports
5
for transports
4. Select Template
1. Template to get high
level properties from
existing servers
5. Click Next
Installing Enterprise Applications: Creating Application
Server

„ Read for the listed issues


or problems
„ Click on Finish to confirm
the creation
„ Save the configuration by
clicking on the “save” link
„ Click on Application
Servers link to see the
new server in the servers
list
Installing Enterprise Applications: Creating JDBC Provider

„ JDBC driver is vendor


specific implementation
of JDBC API to connect
from java to DB
„ JDBC provider should be
created before creating
Data Source
„ One JDBC provider
needed for each unique
Database driver
„ JDBC providers can be
defined at cell, node or
server level
„ To create JDBC provider
click on Resources-
>JDBC provider->New
Installing Enterprise Applications: Creating JDBC Provider
„ Select the appropriate
provider from the list and
click on apply
„ The classpath variable
needs to be properly
defined to point the physical
location of driver
implementation
„ Classpath can be set by
directly specifying location
or via environment variable
„ Click apply to save
information , now it will
show the data source links
at the bottom of the screen
„ To add Data source Click on
the “Data Sources”
„ “Data Source Version 4” is
used old connection
manager and compatible
with WebSphere 4.x
Installing Enterprise Applications: Creating Data Source

„ Data Source is
connection manager
implementation , that
helps for connection
pooling
„ Click on Data Sources
to get the existing list
of Data Sources for the
JDBC provider Sources
„ Click on “New” to add
new Data Source
Installing Enterprise Applications: Creating Data Source
„ Provide Name, JNDI
name etc. and click on
Apply( for
example:jdbc/EMPDEM
O_DS)
„ JNDI name is name
used by developers in
the code
„ J2C authentication need
to be defined before
using the data source
„ Configure the Custom
Properties before using 1
data source with data
base name and server 3
address
„ Connection pools sizes 2
can be defined in the
Connection Pool
configuration
Installing Enterprise Applications: J2C authentication for
Data Source
„ Click on “J2C Authentication Application Data Entries” as shown in the
previous screen
„ Specify the alias name
„ Specify the user id and password
„ User id and password must be valid authentication entries in the
authentication mechanism used
Installing Enterprise Applications: Data Source Custom
Properties

„ Specify databaseName, url, serverName etc.. Others are optional


Installing Enterprise Applications: Data Source Connection
Pool

„ We can set Connection timeout, max, min , reap, other time outs..
„ The values will be defined as per application’s transaction requirements
„ Un appropriate values may impact the application performance
Installing Enterprise Applications: Install new Application
(EmpDemo)

„ To Install new
application select
Applications->Install
New Application
„ Click on browse
button to locate the
EAR file.
„ Click Next
„ To get the list
installed applications
select Applications-
>Enterprise
Applications
Installing Enterprise Applications:Install new Application
(EmpDemo)

„ Configure JNDI
bindings for EJB’s
„ WebSphere will assign
default JNDI for any
EJBs, those are left by
developer
„ Option to allow
WebSphere to override
the developer specified
JNDI names.
„ Virtual Host for Web
modules
„ Click Next
„ Note: In most cases
default values on this
page will work without
any changes.
Installing Enterprise Applications: Install new Application
(EmpDemo)

„ Pre-compile JSP’s will


helps to find the errors
before access, also
avoids delay in first
time access
„ Directory to install,
default
/AppServer/installableA
pps
„ Check the DeployEJBs
option , if the EJB’s are
not deployed in EAR.
„ Enable class reloading
and reload interval to
automatically update
the EJB’s
Installing Enterprise Applications: Install new Application
(EmpDemo)

„ Specify JNDI names


for EJB’s (keep the
default values)
„ Click Next
Installing Enterprise Applications: Install New Application
(EmpDemo)

„ Specify virtual host


where you want to
install web
modules(keep the
default values)
„ Virtual hosts enable
you to isolate, and
independently
manage, multiple
sets of resources on
the same physical
machine
„ Click Next
Installing Enterprise Applications: Install New Application
(EmpDemo)

„ Map modules to
application servers (keep
default values)
„ One application can be
distributed on to multiple
servers
„ Check the module
checkbox , then choose
the server from the list
and then click Apply
„ Click Next
„ Note: If you have only
Base install, even though
you see two server, you
should always select
”server1”
Installing Enterprise Applications: Install New Application
(EmpDemo)

„ Specify EJB
method
protection( keep
the default
values)
„ Click Next
Installing Enterprise Applications: Install New Application
(EmpDemo)

„ Read the summary


„ Click Finish
„ Click save to change the
configuration
Installing Enterprise Applications: Install New Application
(EmpDemo)

„ After the installation we


can
„ Start
„ Stop
„ Uninstall
„ Update
„ Export
„ Export DDL
Installing Enterprise Applications: Install New Application
(EmpDemo)

„ Install Application via wsadmin (command line installer)


„ Start the wsadmin from command prompt
„ /WebSphere/AppServer/bin/wsadmin.sh

„ <WAS Home>\/WebSphere\AppServer\bin\wsadmin.bat

„ Locate the application EAR and issue the command at wsadmin prompt
„ Wsadmin> AdminApp install <file path>EmpDemo.ear
WebSphere Class Loaders
„ Class loaders are part of the Java virtual machine (JVM) code and are
responsible for finding and loading class files
„ Class loaders affects packaging of applications and run time behavior of
applications
„ The run-time environment of WebSphere Application Server uses the
following class loaders to find and load new classes for an application in
the following order
„ Bootstrap classpath ( typically loads from jre/lib)
„ WebSphere specific extensions class loader
„ Application module class loader ( Web modules, EJB modules)

Application Server JVM

Jvm/bootstrap class
loader

WebSphere extensions
Class loader

Application module
Class loader
WebSphere Module Class Loaders
„ Two class-loader policies control the isolation of
applications and modules
„ Application class-loader policy
„ Application class loaders consist of EJB
modules, dependency JAR files, resource
adapters, and shared libraries
„ When set to SINGLE, applications are not
isolated. When set to MULTIPLE, applications
are isolated from each other
„ WAR class-loader policy
„ By default, Web module class loaders load the
contents of the WEB-INF/classes and WEB-
INF/lib directories.
„ If this policy is set to APPLICATION, then the
Web module contents also are loaded by the
application class loader (in addition to the EJB
files, RAR files, dependency JAR files, and
shared libraries). If the policy is set to
MODULE, then each web module receives its
own class loader whose parent is the
application class loader
WebSphere: Class Loaders Modes
„ Class-loader modes
„ There are two possible values for a class-loader mode:
„ PARENT_FIRST
„ The PARENT_FIRST class-loader mode causes the class loader to
first delegate the loading of classes to its parent class loader before
attempting to load the class from its local classpath. This is the
default for class-loader policy and for standard JVM class loaders.
„ PARENT_LAST
„ The PARENT_LAST class-loader mode causes the class loader to
first attempt to load classes from its local classpath before
delegating the class loading to its parent. This policy allows an
application class loader to override and provide its own version of a
class that exists in the parent class loader
„ Example : log4j.jar or xml parser might be provided by application
server provider, but if development team decided not to use these
libraries they can use specific versions delivered with their app.
WebSphere 5.0 Network Deployment Install

„ IBM WebSphere Application Server Network Deployment V5.0 consists


of the base WebSphere Application Server and the Network Deployment
add-on module.
„ A Network Deployment configuration includes support for multiple
nodes, each with a node agent process and several application servers,
all coordinated within an administrative cell by the Deployment Manager
process.
„ Clusters of load-balanced application servers can be configured within a
Network Deployment cell.
„ The configuration and application binaries of all components in the cell
are managed by the Deployment Manager and synchronized out to local
copies on each of the nodes.
WebSphere 5.0 Network Deployment Run-time
Architecture
WebSphere 5.0 Network Deployment Overview

„ A cell is a network of nodes in a logical administration domain.


„ A node is a machine on which you are running an application server.
„ The deployment or cell manager manages the nodes in a cell.
„ A node agent resides on each node and manages the servers running
on the node.
„ A managed process or server is an application server, JMS server, node
agent, or deployment manager. Each server runs in its own JVM.
„ A cluster is a set of servers that are managed together and participate
in workload management. Servers in a cluster can be on one node
(vertical clustering) or on multiple nodes (horizontal clustering).
WebSphere 5.0 Network Deployment Topology

cell Node

Deployment manager

Node Node
Node agent
Node agent

App server App App


server server
WebSphere 5.0 Network Deployment Installation

„ 1. Log in as root and start a terminal session.


„ 2. Insert and mount the IBM WebSphere
Application Server Network Deployment V5.0
CD-ROM:
„ mount /mnt/cdrom
„ 3. Start the WebSphere Application Server
LaunchPad. For example:
„ cd /mnt/cdrom
„ ./LaunchPad.sh

„ Extract “ibmwas5_nd_nt.zip” file from


“c:\softwares” folder and double click on
“Install.exe” or Launch.bat
„ 4. In the Language Selection window, select
English and click OK.
„ 5. In the Network Deployment LaunchPad
window, click Install the product, as shown
WebSphere 5.0 Network Deployment Installation Cont.

„ 6.In the wizard language selection window, select English and


click OK.
„ 7. In the Welcome to WebSphere Application Server Network
Deployment window, click Next to continue.
„ 8. In the software license agreement window, select I accept
the terms in the license agreement and click Next to agree
to the terms of the agreement.
„ 9. Click Next in the features selection window,
WebSphere 5.0 Network Deployment Installation
„ 10.In the setting the installation
directories window, click Next to accept
the default installation directory:
/opt/WebSphere/DeploymentManager
/opt/WebSphere/DeploymentManager..
„ On windows, please choose the path
“c:\
“c:\IBM\
IBM\websphere5\
websphere5\DeploymentManager

„ 11.In the node, host and cell name


window, enter the node name, host
name, and cell name for your installation.
„ Make a note of the following
names, because we will need them
later:
„ – Node Name
„ – Host Name or IP Address
„ – Cell Name
„ Click Next.
Next.
WebSphere 5.0 Network Deployment Installation Cont.

„ 12.In the next window, verify your installation settings, and


click Next to start the installation.
„ 13.Once the installation is complete, click Finish in Installation
Wizard finished window.
„ After a successful installation of IBM WebSphere Application
Server Network Deployment V5.0 the First Steps window will
automatically start. Click Exit to
„ close First Steps, then click Exit to close LaunchPad.
„ Tip: You can monitor the installation progress by checking the
log file. For example:
„ tail -f /tmp/log.txt
WebSphere 5.0 Cluster Configuration

„ A cluster is a set of servers that are managed together and participate


in workload management. Servers in a cluster can be on one node
(vertical clustering) or on multiple nodes (horizontal clustering).
WebSphere 5.0 Horizontal Cluster Configuration

„ Stop the WebSphere Administrative Server if both Network Deployment


and Base sharing the same box
WebSphere 5.0 Horizontal Cluster Configuration

„ 1. Log in as root and start a terminal session.


„ 2. Start the Deployment Manager, for example:
„ cd /opt/WebSphere/DeploymentManager/bin/startManager.sh
„ <WAS Home>\WebSphere\DeploymentManager\bin\startManager.bat

„ 3. To open the Administrative Console, start your Web


browser and enter the following URL:
„ http://localhost:9090/admin
„ 4. The Administrative Console Login window should
appear. Enter a user ID and click OK.
„ 5. Once we have started the Deployment Manager, we
can add a node to the cell. To add a node to the cell:
WebSphere 5.0 Horizontal Cluster Configuration Adding Node(s) to the Cell
„ a. On the machine you want to add to the cell, log in as root and start a terminal session.
„ a. On the machine you want to add to the cell, log in as root and start a terminal session.
„ b. Use the addNode command to add the node to the cell:
„ ./addNode.sh <cell_host> <cell_port> -includeapps
„ addNode.bat <cell_host> <cell_port> -includeapps

Where:
„ <cell_host> is the host name of the deployment manager. Use the
„ host name you noted during the installation.
„ <cell_port> is by default port 8879.
„ The -includeapps option will include the installed applications on this server node.
„ For example:
„ cd /opt/WebSphere/AppServer/bin
„ ./addNode.sh student6 8879 –includeapps
„ ./addNode.sh student6 8879 –includeapps

„ cd <WAS Home>\opt\WebSphere\AppServer\bin
„ addNode.bat student6 8879 –includeapps
„ addNode.bat student6 8879 -includeapps

„ Repeat for the second node, or any additional nodes


„ 6. Back in the Deployment Manager Administrative Console, select System Administration ->
Nodes in the navigation pane. In the Nodes list, you should be able to see the nodes in your
cell with the host name of your machines, as shown in following screen
WebSphere 5.0 Horizontal Cluster Configuration Adding
Node(s) to the Cell
WebSphere 5.0 Horizontal Cluster Configuration Adding Node(s)
to the Cell

„ 1. In the left navigation pane of the Administration Console, select


Servers ->Clusters,
WebSphere 5.0 Horizontal Cluster Configuration Adding Node(s)
to the Cell

„ 2. In the Server Cluster form, click New.


„ 3. In the Create New Cluster form, enter a Cluster Name, for example
ITSOCluster, leave the remaining fields at their default values, and click Next.
„ 4. In the Create New Clustered Servers form, enter a name, for example
„ ITSO_WLM_Server1, select the node, for example appsrv1l, leave the
„ remaining fields at their default values, and click Apply, as shown below
WebSphere 5.0 Horizontal Cluster Configuration, Start the
Cluster

„ Starting the cluster


„ The next step is to start the cluster:
„ 1. In the left navigation pane, select Servers -> Clusters.
„ 2. In the Server Cluster form, check ITSOCluster, then click Start, as
shown below
WebSphere 5.0 Horizontal Cluster Configuration, Start the Cluster

„ 3. To verify if the ITSOCluster has started, open a terminal


window on each of the cluster server nodes and tail the cluster
server log.
„ In our example, we opened a terminal session on appsrv1l and
entered the following command:
„ tail -f /opt/WebSphere/AppServer/logs/ITSO_WLM_Server1/SystemOut.log
„ Open the file by double clicking on it, on windows
„ We then opened a terminal session on appsrv2l and entered the
following command:
„ tail -f /opt/WebSphere/AppServer/logs/ITSO_WLM_Server2/SystemOut.log
„ Open the file by double clicking on it, on windows
„ You should see an entry similar to “Server
ITSO_WLM_Server[1|2] open for e-business” in both logs, when
each cluster server has started.
„ The Server Cluster pane in the Administrative Console should
also display the green running icon in the status column for the
ITSOCluster.
WebSphere 5.0 Deploying a Sample Clustered Application

„ 1. Copy your enterprise application archive (EAR) file to the Deployment Manager
installableApps folder, for example:
„ cp Hello.ear /opt/WebSphere/DeploymentManager/installableApps
„ Follow any windows copy procedure to copy the file
„ 2. To open the Network Deployment Administrative Console, start your Web browser
and enter the following URL:
„ http://localhost:9090/admin
„ 3. The Administrative Console Login window should appear. Enter a user ID and click
OK.
„ 4. Select Applications -> Install New Application in the navigation pane on the
left.
„ 5. In the Preparing for the application installation window, browse to the installableApps
folder, select the EAR file
„ /opt/WebSphere/DeploymentManager/installableApps/Hello.ear.
„ C:\><WAS Home>\WebSphere\DeploymentManager\installableApps\Hello.ear.
„ and click Next,
„ 6. Click Next in the following window to use the existing bindings and mappings defined
in the EAR file.
WebSphere 5.0 Deploying a Sample Clustered Application

„ 7. In the Install New Application window, click Next to accept the


defaults for Step 1: Provide options to perform the installation.
„ 8. Click Next to accept the defaults for Step 2: Map virtual hosts for
Web modules.
„ 9. In Step 3: Map modules to application servers, check HelloWeb in
the module list, select ITSOCluster from the list of clusters and
servers, and click Apply.
„ You should see the HelloWeb module mapped to the ITSOServer
cluster, as shown below
WebSphere 5.0 Horizontal Cluster Configuration, Start the Cluster

„ 10.In Step 4: Summary, review your selections and click Finish to deploy the
enterprise application.
„ 11.Don’t forget to click Save after successfully installing the application.
„ 12.By default, the newly installed applications are not started. To start the
application, select Applications -> Enterprise Applications, check Hello in
the application list, and click Start.
„ 13.Select Environment -> Update Web Server Plugin in the navigation
tree,then click OK to update the Web server plug-in configuration file.
„ 14.Copy the plug-in configuration file from the Deployment Manager node to
the Web server machine. For example:
„ scp /opt/WebSphere/DeploymentManager/config/cells/plugin-cfg.xml
\websrv1l:/opt/WebSphere/AppServer/config/cells/plugin-cfg.xml
„ Copy the file via shared folder or flash drive

„ 15.Restart the Web server to ensure the plug-in configuration is re-read:


„ /opt/IBMHTTPServer/bin/apachectl restart
„ Start from windows services
WebSphere 5.0 Horizontal Cluster Configuration, Start the Cluster

„ 16.Using a Web browser, enter the URL for the application, for
example:
„ http://websrv1l/Hello/hello.JSP Requests should be workload
managed across the available cluster servers.
„ As shown in the screens on next slide , our user requests are
workload managed across the ITSO WLM Server1 and ITSOWLM
Server2.
„ Note : WebSphere Network Deployment is not installed on our Web
server machine, so we also must edit the plugin-cfg.xml file and
replace all path references of /opt/WebSphere/DeploymentManager
with /opt/WebSphere/ApplicationServer. Also replace the node name
with IP if you don’t have DNS.
„ Replace all the occurrences of C:\><WAS
Home>\WebSphere\DeploymentManag
„ er with C:\><WAS Home>\WebSphere\ApplicationServer
WebSphere 5.0 Horizontal Cluster Configuration, Start the
Cluster
Managing WebSphere Application Server Using wsadmin

„ Two ways to administer & configure WebSphere server and


applications
„ Web based admin console
„ Wsadmin scripting interface
„ What is wsadmin ?
„ Wsadmin is new scripting interface introduced in WAS 5.0
„ Wsadmin helps to configure and manage both application server and
applications via scripting
„ wsadmin background
„ Built based on BSF (bean scripting frame work), an open source
project
„ The BSF architecture works as an interface between Java
applications and scripting languages
„ Since wsadmin uses BSF, it can make various Java objects available
through language-specific interfaces to scripts
Managing WebSphere Application Server Using wsadmin

„ There are four objects available to scripts:


1. AdminControl: Used to invoke operational commands.
2. AdminConfig: Used to invoke configurational command to
create or modify WebSphere configurational elements
3. AdminApp: Used for administering applications
4. Help: Used for general help

„ The scripts use those objects to communicate with MBeans


running in WebSphere server processes. Supported scripting
languages all have ways to invoke methods on the exposed
Java objects.
„ Currently only three scripting languages were tested and
supported: Java Command language based on Tcl (Jacl),
JavaScript, and jpython.
Managing WebSphere Application Server Using wsadmin
„ Scripting functionality in WebSphere 5.0

„ JMX is a technology that provides a simple and standard way to manage Java
objects.
„ MBeans are Java objects that represent Java Management Extensions (JMX)
resources.
„ All processes run the JMX agent.
„ All runtime administration is performed through JMX operations.
„ Connectors are used to connect a JMX agent to a remote JMX-enabled
management application. The following connectors are currently supported:
– SOAP JMX Connector
– RMI/IIOP JMX Connector
Configuring wsadmin
„ The properties that determine the scripting environment for wsadmin can
be set either by command line or in a properties file. The properties file
can be set in three places.
„ The first place is using the system default properties file called
wsadmin.properties. The file is located in
WebSphere/AppServer/properties directory.
„ If you decide not to use the system default properties file, this file can be
customized and placed in the user home directory or in $user_home.
„ Third, you can specify properties when you launch wsadmin from the
command line.
„ Sample properties
„ com.ibm.ws.scripting.connectionType: SOAP, RMI or JMX

„ com.ibm.scripting.host: host name of system

„ Com.ibm.scripting.port : port (8881 for SOAP, 2809 for RMI)

„ com.ibm.ws.scripting.defaultLang: jacl, JavaScript or Jython

„ com.ibm.ws.scripting.traceFile: File for trace information

„ com.ibm.ws.scripting.traceString: =com.ibm.*=all=enabled
Launching wsadmin
„ The wsadmin.sh (Unix) or .bat (windows) resides in the bin directory of the
WebSphere Application Server or Network Deployment installation and can be
started from a command prompt with the command:
„ /opt/WebSphere/AppServer/bin/wsadmin.sh
„ To get syntax-related help, type wsadmin.sh -?
„ Running a Single Command
„ The -c option is used to execute a single command using wsadmin
„ /opt/WebSphere/AppServer/bin/wsadmin.sh –c ‘$AdminControl getNode’
„ C:\> \<WAS Home>\AppServer\bin\wsadmin –c ‘$AdminControl getNode’

„ Running script file


„ The –f option is used to execute a script file using wsadmin
„ /opt/WebSphere/AppServer/bin/wsadmin.sh –f /opt/jacl/myfirstscript.jacl
„ C:\>/<WAS Home>\AppServer\bin\wsadmin –f C:\jacl\myfirstscript.jacl

„ The script has a .jacl extension( .jacl), letting wsadmin know it is an Jacl script.
„ If there is no extension, the com.ibm.ws.scripting.defaultLang property is used to
determine the language. If this setting is not correct, use the
-lang option to identify the scripting language.
wsadmin Scripting Options
„ Using –profile file
„ The -profile command line option can be used to specify a profile script.
The profile can be used to perform whatever standard initialization is
required.
„ Specifying a properties file (-p)
„ The -p option is used to specify a properties file other than
wsadmin.properties located in the WebSphere/AppServer/properties
directory.
„ /opt/WebSphere/AppServer/bin/wsadmin.sh –f /opt/jacl/myfirstscript.jacl
–p /opt/jacl/myproperties.properties
„ C:\>\<WAS Home>\AppServer\bin\wsadmin.sh –f C:\jacl\myfirstscript.jacl
–p C:\jacl\myproperties.properties

„ Help object
„ Help object provides information about the available methods for these
objects.
„ Example : ./wsadmin.sh –c ‘$Help AdminControl’
„ C:\> wsadmin –c ‘$Help AdminControl’
„ Getting help for specific command
„ Following syntax helps to find help on any commands
„ wsadmin> <wsadmin_object> help <method_name>
„ Example: wsadmin> $AdminApp help install
Wsadmin: Information on Running MBeans

„ MBeans represents running objects in WebSphere, each server will have one
mbean server.
„ QueryNames command can be used to find the running objects
„ Example : $AdminControl queryNames * ( lists all mbeans running mbean
server)
„ If the client is attached to a stand-alone WebSphere Application Server, the list will
contain only MBeans running on that server.
„ If the client is attached to a node agent, the list will contain MBeans running in the
node agent as well as MBeans running on all application servers on that node.
„ If the client is attached to a Deployment Manager, the list will contain MBeans
running in the Deployment Manager, in all node agents communicating with that
Deployment Manager, and all application servers on all the nodes served by those
node agents
„ Information about all configuration objects
„ wsadmin>$AdminConfig types
„ Finding operations information for a running MBean
„ set serv [$AdminControl completeObjectName type=Server,node=<your
node>,*]
„ wsadmin>$Help operations $serv
Approach for Operational Tasks Using wsadmin

„ Generally two steps to follow each operation


„ We first need to know the object name of the running object.
„ set appManager [$AdminControl queryNames
type=ApplicationManager,cell=bcsi,node=bcsi,process=server1,*]
„ Invoke an operation on a running MBean.(to stop default app)
„ $AdminControl invoke $appManager startApplication
DefaultApplication

„ You can use the queryNames and completeObjectName commands of


the AdminControl object to identify the name of a running object
Improving wsadmin Performance
„ If DeploymentManager is running on different fix-pack than node agent , better
run the wsadmin from deployment manager
„ When we launch a wsadmin , a new process is created with new JVM. So if you
run commands using –c option from batch file, the execution will be much slower
compare to using –f option , that runs all the commands using single JVM.
„ Method 1:
„ ./wsadmin.sh
./wsadmin.sh -c ‘$AdminApp install /opt/myApps/App1.ear {-
{-appname appl1}’
„ ./wsadmin.sh
./wsadmin.sh -c ‘$AdminApp install /opt/myApps/App2.ear {-
{-appname appl2}’
„ ./wsadmin.sh
./wsadmin.sh -c ‘$AdminApp install /opt/myApps/App3.ear {-
{-appname appl3}’

„ wsadmin.bat -c ‘$AdminApp
‘$AdminApp install \myapps\
myapps\App1.ear {-
{-appname appl1}’
„ wsadmin.bat -c ‘$AdminApp
‘$AdminApp install \myapps\
myapps\ App2.ear {-
{-appname appl2}’
„ wsadmin.bat -c ‘$AdminApp
‘$AdminApp install \myapps\
myapps\App3.ear {-
{-appname appl3}’

„ Method 2:
„ $AdminApp install /myapps/App1.ear {-
{-appname appl1}
„ $AdminApp install /myApps/App2.ear {-
{-appname appl2}
„ $AdminApp install /myApps/App3.ear {-
{-appname appl3}
„ Use the AdminControl queryNames and completeObjectName commands
carefully with a large installation, get the list of objects only you interested on
particular node, getting list from all nodes in large installations may be expensive
operation.
„ The WebSphere Application Server is a distributed system, and scripts perform
better if you minimize remote requests. If some action or interrogation is required
on several items, for example, servers, it is more efficient to obtain the list of
items once and iterate locally.
Running Sample wsadmin Commands
„ Starting the Deployment Manager
„ wsadmin>$AdminControl stopServer <deployment manager name>
„ Getting MBean information and stopping the Deployment Manager
„ wsadmin>$AdminControl queryNamestype=Server,node=M055245Manager,*
WebSphere:cell=linux,name=dmgr,mbeanIdentifier=server.xml#Server_1,typ
e=Server,node=M055245Manager,process=dmgr,processType=DeploymentM
anager
„ wsadmin>$AdminControl invoke [$AdminControl queryNames
type=Server,node=linux,*] stop
„ Start an application server
„ wsadmin>$AdminControl startServer server1
„ Start an application server by invoking launchProcess on node agent
MBean
„ wsadmin>$AdminControl queryNames type=NodeAgent,node=mka0kkwd,*
WebSphere:cell=NetworkDeploymentCell,name=NodeAgent,mbeanIdentifier=
NodeAgent,type=NodeAgent,node=mka0kkwd,process=mka0kkwd
„ wsadmin>$AdminControl invoke [$AdminControl queryNames
type=NodeAgent,node=mka0kkwd,*] launchProcess mka0kkwd_server1
Running Sample wsadmin Commands
„ Stop an application server
„ wsadmin>$AdminControl stopServer server1
„ Stop all application servers on a node (jacl file)
„ set servername [$AdminControl queryNames type=Server,node=linux,*]
foreach item $servername {
puts “Stopping server : $item”
$AdminControl invoke $item stop
puts “invoked stop $item”
}
„ View installed applications
„ The $AdminApp list command can be used to list applications
installed under an application server (wsadmin> $AdminApp list)
„ Display the status of Applications (jacl file)
set application [$AdminApp list]
foreach app $application {
set objName [$AdminControl queryNames type=Application,name=$app,*]
if {[ llength $objName] ==0} {
puts "The Application $app is not running"
} else {
puts "The Application $app is running"
}}
Running Sample wsadmin Commands
„ Stop a running application
„ wsadmin> set appservername [$AdminControl queryNames
type=ApplicationManager,node=linux,*]
„ wsadmin>$AdminControl invoke $appservername stopApplication
DefaultApplication
„ Start a stopped application
„ wsadmin> set appservername [$AdminControl queryNames
type=ApplicationManager,node=linux,*]
„ wsadmin>$AdminControl invoke $appservername starApplication
DefaultApplication
„ Start a cluster
„ wsadmin>$AdminControl queryNames type=Cluster,*
WebSphere:cell=mka0kkwdNetwork,name=testCluster,mbeanIdentif
ier=testCluster,type=Cluster,node=mka0kkwdManager,process=dm
gr
„ wsadmin>set clid [$AdminControl completeObjectName
type=Cluster,name=testCluster,*]
WebSphere:cell=mka0kkwdNetwork,name=testCluster,mbeanIdentif
ier=testCluster,type=Cluster,node=mka0kkwdManager,process=dm
gr
„ wsadmin>$AdminControl invoke $clid start
Running Sample wsadmin Commands
„ Stop a cluster
„ wsadmin>$AdminControl queryNames type=Cluster,*
WebSphere:cell=mka0kkwdNetwork,name=testCluster,mbeanIdentifier=testCl
uster,type=Cluster,node=mka0kkwdManager,process=dmgr
„ wsadmin>set clid [$AdminControl completeObjectName
type=Cluster,name=testCluster,*]
WebSphere:cell=mka0kkwdNetwork,name=testCluster,mbeanIdentifier=testCl
uster,type=Cluster,node=mka0kkwdManager,process=dmgr
„ wsadmin>$AdminControl invoke $clid stop
„ Generating the Web server plug-in configuration
„ wsadmin>set generator [$AdminControl queryNames
type=PluginCfgGenerator,node=linux,*]
„ wsadmin>$AdminControl invoke $generator generate
“/opt/WebSphere/AppServer /opt/WebSphere/AppServer/config linux linux null
plugin-cfg.xml””
Running Sample wsadmin Configuration Commands
„ Typical configuration tasks
„ Enterprise application(Install/uninstall an enterprise application, Change
attributes of an enterprise application)
„ Configure and modify WebSphere configuration(Configure virtual hosts,
Configure JDBC providers, Edit an application server, Create a cluster, Add
member to a cluster)
„ Create an Application server
„ wsadmin>set node [$AdminConfig getid /Node:linux/]
„ wsadmin>$AdminConfig create Server $node {{name testserver}}
„ Remove an application server
„ wsadmin>set server [$AdminConfig getid /Node:linux/Server:testserver/]
„ wsadmin>$AdminConfig remove $server
„ Installing Enterprise Application
„ wsadmin>$AdminApp install /opt/myapps/Hello.ear {-server server1 -
appname TestApp}
„ wsadmin>$AdminConfig save
„ Un-install Enterprise Application
„ wsadmin>$AdminApp uninstall TestApp.
„ wsadmin>$AdminConfig save
Running Sample wsadmin Configuration Commands
„ Creating JDBC Provider
„ For creating new JDBC providers , WebSphere provides template xml
files at /WebSphere/AppServer/config/templates folder, we can use
these templates to created new JDBC provider
„ wsadmin>set node [$AdminConfig getid /Node:linux/]
„ wsadmin>$AdminConfig listTemplates JDBCProvider “Oracle JDBC Thin
Driver"
„ ……….wsadmin provides you the list
„ (templates/system:jdbc-resource-provider-
templates.xml#JDBCProvider_1)"
„ wsadmin>set temp1 [lindex [$AdminConfig listTemplates JDBCProvider
“Oracle JDBC Thin Driver"] 1]
„ wsadmin>$AdminConfig createUsingTemplate JDBCProvider $node
{{name testorcldriver}} $temp1
„ wsadmin>$AdminConfig save
Security
„ Two main services of security
„ Authentication ( who are you ? Log-in)

„ Authentication is the process of establishing whether a client is valid in a


particular context. A client can be either an end user, a machine or an
application
„ Authorization (What are you allowed to do)
„ Authorization is the process of checking whether the authenticated user
has access to the requested resource. There are two fundamental
methods for authorization:
„ Role-based security
„ Roles are different levels of security that relate to a specific application.
In a roles based authorization model, the roles for a given application are
developed as an application is developed. As a user base for the
application is established, one of three things happens.
„ Users are mapped directly to specific security roles.
„ Groups are formed, users are defined as members of a group, and the
groups are defined to specific security roles.
„ A combination of user/group mapping to security roles is used to handle
any exceptions.
J2EE Application Security
„ The Java 2 Enterprise Edition (J2EE) specification defines the building
blocks and elements of a J2EE application that build an enterprise
application. The specification also provides details on security related to
the different elements.
„ The J2EE application consists of multiple modules and components;
these elements are in connection with each other, and they
communicate via certain protocols.
J2EE Application Security
„ J2EE security roles
„ The J2EE specification defines a security role as: “A logical groupings
of users that are defined by an Application Component Provider or
Assembler”.
J2EE Application Security
„ J2EE two-phase security administration
„ Phase1: At application assembly time, these sets of users, or
„ security roles, are not tied to any real users or groups of users. Instead, they
are placeholders.
„ Phase 2: These placeholders are later mapped to real users and groups at
application deployment time, during a process called security role mapping.
„ This two-phase security administration approach allows for a great deal
of flexibility and portability. Deployers of an application have full control
over how their local users and groups are mapped to the application’s
security roles, and over what authorization and authentication
mechanisms are used to determine
„ role membership.
„ At deployment time, security roles can be mapped to users, groups of users,
or
special subjects. There are two special subjects in WebSphere Version 5:
„ All Authenticated Users
„ Everyone
J2EE Application Security -J2EE Container-Based
Security

„ J2EE Containers are responsible for enforcing access control on component


objects and methods. Containers provide two types of security:
„ Declarative security
„ Programmatic security
„ Declarative security
„ an application’s security policies can be expressed externally to the application
code. At application assembly time, security policies are defined in an
application’s deployment descriptor. A deployment descriptor is an XML file
which includes a representation of an application’s security requirements,
including the application’s security roles, access control, and authentication
requirements.
„ When using declarative security, developers are free to write code
code that is completely
unaware of the security.
„ Programmatic security
„ Programmatic security is used when an application must be “security aware”.
„ EJB methods (isCallerInRole, getCallerPrincipal)
„ Servlet methods(isUserInrole, getCallerPrincipal)
„ When using programmatic security, developer needs to write additional
additional code that uses
security context objects.
J2EE Application Deployment Descriptor for Security
„ There are two deployment descriptor files used for security role mapping:

File Purpose Mandatory


Application.xml Security roles defined Yes
Ibm-application-bnd.xmi Security roles mapped No, security roles can be
mapped during or after
the installation

„ In the application.xml file, all security roles used in the application must be
named, with an optional description
„ Example
<security-role id="SecurityRole_1">
<description>ITSOBank manager</description>
<role-name>manager</role-name>
</security-role>
<security-role id="SecurityRole_2">
<description>ITSOBank consultant</description>
<role-name>consultant</role-name>
</security-role>
J2EE Application Deployment Descriptor for Security
„ In In the ibm-application-bnd.xmi file, security roles are mapped to users or groups in
the User Registry.
Security role Mapped to
Manager Managergrp
Consultant Consultgrp
allauthenticated All authenticated Users (special)
everyone Everyone (special)

<authorizationTable xmi:id="AuthorizationTable_1">
<authorizations xmi:id="RoleAssignment_1">
xmi:id="RoleAssignment_1">
<role href="META
href="META--INF/application.xml#SecurityRole_1"/>
<groups xmi:id="Group_1"
xmi:id="Group_1" name="managergrp
name="managergrp"/>"/>
</authorizations>
<authorizations xmi:id="RoleAssignment_5">
xmi:id="RoleAssignment_5">
<specialSubjects xmi:type="
xmi:type="applicationbnd:AllAuthenticatedUsers
applicationbnd:AllAuthenticatedUsers""
xmi:id="AllAuthenticatedUsers_1"
xmi:id="AllAuthenticatedUsers_1" name="AllAuthenticatedUsers
name="AllAuthenticatedUsers"/>
"/>
<role href="META
href="META--INF/application.xml#SecurityRole_5"/>
</authorizations>
<authorizations xmi:id="RoleAssignment_6">
xmi:id="RoleAssignment_6">
<specialSubjects xmi:type="
xmi:type="applicationbnd:Everyone
applicationbnd:Everyone"" xmi:id="Everyone_1"
xmi:id="Everyone_1"
name="Everyone"/>
<role href="META
href="META--INF/application.xml#SecurityRole_6"/>
</authorizations>
</authorizationTable>
J2EE Security : Securing Hello Application
„ We already deployed the sample Hello Application (Hello.ear) in our
previous sessions
„ As part of security exercise, now we will configure security to the Hello
application so that the resources in the Hello application will be
protected by unauthorized users
„ Resources we protect in Hello application
„ We will protected all .jsp files
„ We will NOT protect HTML pages
„ We will protect .GIF images
J2EE Application (Hello)Security Configuration Using AAT :
„ There are two aspects of
application security
administration which apply to
all secured J2EE application
components: defining security
roles (performed at
application assembly time),
and security role mapping
(performed at deployment
time)
1. Open the Hello.ear file in the
Application Assembly Tool.
2. Right-click the Security Roles
item in WebModules-
>HelloWeb.
3. Select New from the pop-up
menu.
4. A new window appears with
the role details; fill the name
and description.(role
name:student)
5. Click OK to complete the
form.
6. Create all the J2EE roles for
your application by repeating
the steps above.
7. Save the .ear file.
J2EE Application(Hello) Security Configuration Using AAT (role mappings)
„ Create a Linux user group studentgrp
and add few users.
„ Security role mappings are performed
within the Bindings tab in the
Application Security Roles view.
1. Open the application-level Security
Roles view and click the Bindings
tab.
2. The Bindings tab contains fields for
adding groups, users, and/or special
3. subjects to a security role. Click the
Add... button below the Groups
heading to bring up the Add Groups
dialog.
4. Enter the name of the real group,
studentgrp, and click OK.
5. The group mapping will now appear in
the list of groups mapped to the
student security role
6. Scroll down to the Special subjects
section and click on add
7. Select All authenticated users and
click apply
8. Save the ear file
„ Note: Generally roll-mappings will be
done by administrator during
deployment time or sometimes
development teams specify using
WebSphere studio.
Securing (Hello)Web Components : Security Constraints
„ Web components such as static
HTML pages, JSPs and Servlets
can be secured either by the
HTTP server or by WebSphere.
„ WebSphere Application Server
can only secure components
that it owns. Any static pages
that are served from the Web
server cannot be protected by
WebSphere tools. 2
„ Security constraints are mapping
of one or more web resources to 1 3
a set of roles
„ Configuration Steps:
1. Open the Web module
folder and right-click
Security Constraints. Click
New.
„ A new panel displays.
2. Type the security constraints
name as “mysc” and description.
3. Add required roles by clicking
Add under Roles. Browse and
click the student role. On the
browse window asterisk (*)
indicates all roles.
Securing (Hello)Web Components : Security Constraints
4. In the user data constraints section,
keep None for Transport Guarantee
menu.
„ A transport guarantee of NONE
indicates that the communication
between the Web client or browser
and the server or Web server is
transported over HTTP. A transport
guarantee of CONFIDENTIAL or
INTEGRAL guarantees that the
communication between the Web 8
client and the Web server is
secured and is transported over
HTTP and HTTPS.
5. Click OK when done. 7 9
6. A new Security Constraints folder is
created for the Web module.
7. Open the security constraints created
from previous steps and right-
right-click Web 10
Resources Collection. Click New.
„ A new panel displays.
8. Type a Web resource collection name
and description. 11
9. Click Add under Methods and select HTTP
methods. Click OK.
„ If no methods are selected, all methods
are selected by default.
10. Click Add under URLs and type the URL
pattern (for example: - /Hello/*.jsp
/Hello/*.jsp,,
*.jsp
*.jsp,, *.gif).
11. Click OK when done
Securing (Hello)Web Components : Security Constraints

„ Consult the Servlet specification Version 2.3 for instructions on


mapping URL patterns to Servlets. Security run time uses the exact
match first to map the incoming URL with URL patterns. If the exact
match is not present, the security run time uses the longest match.
The wild card (*.,*.jsp) URL pattern matching is used last.

12. Save the ear file by clicking on save button from the top menu
Installing FixPacks

„ IBM releases software updates in form of FixPacks and Cumulative fixes


„ FixPacks : Major updates to the product, possibly minor or major version change, for
example, FixPack to update Version 5.0 to 5.0.2 or 5.0.1 to 5.0.2
„ Cumulative Fix: A set of minor bugs fixed in the product.
„ It is very important to keep the websphere software update to date with latest
FixPacks and Cumulative fixes released by IBM

Lab: Install the FixPack2 on top of 5.0

„ Go to “C:\softwares” folder and extract the file “was50_fp2_win.zip”, to


extract, select the file right click and choose “Extract All” option, this will create
a folder “was50_fp2_win”.
„ Invoke the Installer using following commands
„ Run the command C:\
C:\>\IBM\
IBM\WebSphere5\
WebSphere5\AppServer\
AppServer\java\
java\jre\
jre\bin\
bin\java -jar installer.jar
„ $ /IBM/WebSphere5/AppServer/java/jre/bin/java -jar installer.jar
„ In the Language selection dialog box, select “English” and click OK
„ Click “Next” on product information dialog box
Installing FixPacks

„ In this dialog box, the installer finds


any installed websphere versions and
ask you to choose the one you want to
apply the FixPacks for.

„ Choose the option which is relevant,


here we choose “Install fix packs”
Installing FixPacks

„ Enter or choose the directory where


fixpacks are located, on your machines it
should be
“c:\>softwares\was50_fp2_win\fixpacks”
and click “Next”

„ Choose the “FixPack” to install and


select “Next”
Installing FixPacks

„ Choose “IHS” option and its install


location, and click “Next”

„ Click “Next” to confirm the components


Deploying Secure Hello Application

„ Open the admin console and


deploy the Hello application by
clicking on Install New
Application and browse to the
new Hello.ear file
„ Keep the default values and
continue with deployment by
clicking on Next ( Un install the
Hello app if you have one
already installed)
„ Make sure that at Step 4, your
screen should look like the one
shown on this page.
„ Enable the Global security from
Security section and configure
it to use local OS user registry
„ Restart the server with
following command
„ /opt/WebSphere/AppServer/bin/
startserver server1 –username
root –password root
Accessing the Secure Hello Application

„ Browse the application


from browser by typing
http://localhost/Hello/h
ello.jsp
„ You should be
prompted with the
Linux OS login prompt
before accessing
hello.jsp
WebSphere Coexistence & Migration
„ Coexistence in WebSphere is the ability of multiple installations of
WebSphere Application Server to run on the same machine at the same
time. Multiple installations include multiple versions and multiple
instances of one versions
„ The installation wizard looks for these existing installations to determine
if it should prompt you for coexistence information:
„ IBM WebSphere Application Server Standard Edition and Advanced Edition,
Version 3.5.5 and up
„ IBM WebSphere Application Server Advanced/Enterprise Edition, Version 4.0.2
and later
„ Migration
„ Migration from version 4.0.1(including applications) to version 5.0 without
extensive tuning
„ Migration from version 3.5 to version 5.0 needs manual effort.
Installing ND & Base on Same Machine and Vertical Clustering
1. Start the WebSphere Application Server LaunchPad. For example:
„ ./opt/linuxi386/LaunchPad.sh (assumed that you extracted the tar
file into opt folder)
„ Double click on LaunchPad.bat
2. In the Language Selection window, select English and click OK.
3. In the Network Deployment LaunchPad window, click Install the
product, as shown
Installing ND & Base on Same Machine and Vertical
Clustering

4. In the wizard language selection window, select English and


click OK.
5. In the Welcome to WebSphere Application Server Network
Deployment window, click Next to continue.
6. Accept the license agreement and click on Next
7. The installation wizard will check the system prerequisites. It
should detect the existing installation of WebSphere
application server 5.0 and you will be given the option to
reconfigure the product for coexistence.
DO NOT select check box. If you select the check box new
values will be generated for the ports used by deployment
manager.
8. Click Next
We will manually reconfigure the base version to avoid port
conflicts
Installing ND & Base on Same Machine and Vertical
Clustering
9. Select all components except embedded messaging client ( we
already installed this during base install) click Next
10. Select the installation directory and click Next
11. Keep default node name, host name and cell name and click Next
12. Wait to install and click Finish after the installation
13. Exit from the LaunchPad and First Steps , if they are already open
Changing Base Version Admin Ports
„ The recent installation of ND is configured to serve the admin
console on ports 9090 and 9043 which conflicts with the base
WAS installation.
„ We will use the Admin console of Base installation to change
these conflict ports. (Note: The Deployment manager should
not be running in order to get the base’s admin console and
Base server should be running)
„ Open the admin console using http://localhost:9090/admin and
login using user id admin and click OK
„ In the navigation tree, expand servers
„ Click Application Servers
„ Select server1
„ Select Web Container under Additional Properties
„ Select HTTP Transports under Additional Properties
„ The page will display the ports that the web container is listening
on
„ Click the * for port 9090
„ Change port from 9090 to 9190 then click OK to save the
changes
„ Click the * for port 9043
„ Change the port from 9043 to 9143 then click OK to save the
changes
Changing Base Version Admin Ports

„ In the left navigation tree, expand Environment


„ Click Virtual Hosts
„ Select admin_hosts
„ Select Host Aliases under Additional properties
„ Click the * for port 9090
„ Change Port from 9090 to 9190 then click OK to save the changes
„ Select Host Aliases under Additional properties
„ Click the * for port 9043
„ Change Port from 9043 to 9143 then click OK to save the changes
„ Click the save in the task bar frame at the top of the page
„ Click the save button to save the configuration changes
„ Restart the server and click on Update Web server plugin under
Environment node
„ Click logout to logout from the admin console
„ Stop the server
„ Start the deployment manager using
„ ./opt/WebSphere/DeploymentManager/startManager.sh
„ C:\>\WebSphere\DeploymentManager/startManager
Add Base Application Server to the Cell
„ First check the status of the base server using command like
„ ./opt/WebSphere/AppServer/bin/serverStatus.sh server1
„ If the server1 is started, stop it using
„ ./opt/WebSphere/Appserver/stopServer.sh server1
„ C:\
C:\>\WebSphere\
WebSphere\Appserver\
Appserver\stopServer.bat server1

„ Federate the node into cell


„ ./opt/WebSphere/AppServer/bin/addNode.sh localhost 8879
„ C:\>\WebSphere\AppServer\bin\addNode localhost 8879
„ The node will be federated into cell and the node agent will be started. When the
process is complete, you should see a success message like “…..has been
successfully federated”
„ To see the log for these commands
„ See the addNode.log file in the /WebSphere/AppServer/logs/ folder
„ Get the admin console of deployment manager using
„ http://localhost:9090/admin
„ At login page enter any user id (for example admin)
„ Check the Network Deployment configuration options under Servers and
System Administration, you should see the options like Clusters, Cluster
Topology under servers and Cell, Deployment Manager, Nodes, Node
Agents under system administration
Creating Clusters for Vertical Scaling

1. Expand Servers, then


click on clusters , on right
hand side you will see
Server Cluster screen
2. Click on New to create
new cluster
3. Enter value “hellocluster”
as cluster name and Click
on Next by keeping the
default settings for other
fields
Creating Clusters for Vertical Scaling
4. Enter “helloserver1” value in
the Name column as shown
in the screen.
5. Keep all other settings as
default and click on Apply,
now we should see the new
server at the bottom of the
screen and the system will
provide the screen to enter
the new server

6. Enter “helloserver2” value in


the Name column and click
Apply
7. Now you should see the two
servers in the list at the
bottom of the screen, click
on the Next
8. Click Finish on summary
page
9. Click Save to commit the
changes
10. Click Save again to confirm
the changes.
WebSphere 5.0 Deploying a Sample Clustered
Application

„ Note: If you already installed Hello Application on base server,


uninstall the Hello application first and save the changes.

1. Select Applications -> Install New Application in the navigation


pane on the left.
2. . In the Preparing for the application installation window, browse to
the Hello.ear file and click Next,
3. Click Next in the following window to use the existing bindings and
mappings defined in the EAR file.
4. In the Install New Application window, click Next to accept the
defaults for Step 1: Provide options to perform the installation.
5. Click Next to accept the defaults for Step 2: Map virtual hosts for
Web modules.
6. In Step 3: Map modules to application servers, check HelloWeb in
the module list, select hellocluster from the list of clusters and
servers, and click Apply.

„ You should see the HelloWeb module mapped to the hellocluster, as


shown below
WebSphere 5.0 Deploying a Sample Clustered Application
WebSphere 5.0 Vertical Cluster Configuration
7. In Step 4: Summary, review your selections and click Finish to deploy the
enterprise application.
8. Don’t forget to click Save after successfully installing the application.
9. By default, the newly installed applications are not started. To start the
application, select Applications -> Enterprise Applications, check Hello
in the application list, and click Start.
10. Select Environment -> Update Web Server Plugin in the navigation
tree,then click OK to update the Web server plug-in configuration file.
11. Copy the plug-in configuration file from the Deployment Manager node to the
Web server machine. For example:
„ scp /opt/WebSphere/DeploymentManager/config/cells/plugin-cfg.xml
\websrv1l:/opt/WebSphere/AppServer/config/cells/plugin-cfg.xml
„ Use shared folders or FlashDrives
„ Note : If web server machine is on separate machine than WebSphere
Network Deployment ,then we also must edit the plugin-cfg.xml file and
replace all paths to /opt/WebSphere/DeploymentManager with
/opt/WebSphere/ApplicationServer. Also replace the node name with IP if you
don’t have DNS.
12. Restart the Web server to ensure the plug-in configuration is re-read:
„ /opt/IBMHTTPServer/bin/apachectl restart
„ Start the service “IBM HTTP Server” from services
WebSphere 5.0 : Testing Vertical Cluster WLM
13. .Using a Web browser, enter
the URL for the application, for
example:
„ http://websrv1l/Hello/hello.jsp
. Requests should be workload
managed across the available
cluster servers.
„ As shown in the screens on
next slide , our user requests
are workload managed across
the helloserver1 and
helloserver2.
„ To test the WLM open two
new browser windows and
paste the URL
http://websrv1/Hello/hello.jsp,
you should see the different
server info in two browser
windows. As shown in screens.
WebSphere 5.0 : Testing Vertical Cluster WLM

„ To test the fail-over, Stop the


one of the cluster member
server “helloserver1” As
shown in the screens.
„ To stop the server select
Servers-
Servers->Application
Servers-
Servers->Check the
helloserver1 checkbox and
click on Stop

„ Open two new browser


windows and paste the url
http://websrv1/Hello/hello.jsp
, you should see that requests
will be always going to the
“helloserver2”.
WebSphere 5.0 : Asynchronous Messaging (using JMS)
„ Asynchronous messaging provides a method for communication based
on the Java Message Service (JMS) programming interface. JMS provides
a common mechanism for Java programs (clients and J2EE applications)
to create, send, receive, and read asynchronous requests, as JMS
messages.
„ JMS includes the common set of JMS interfaces that define how a JMS
client can access the facilities of a JMS provider.
„ This support enables J2EE applications, as JMS clients, to exchange
messages asynchronously with other JMS clients by using JMS
destinations (queues or topics)
„ WebSphere 5.0 fully supports J2EE 1.3 JMS
„ Supports different JMS providers
„ Embedded provider
„ WebSphere MQ
„ Custom JMS providers
„ Administrative console support for WebSphere MQ JMS provider
Message-Driven Beans
„ Application server products compliant with the J2EE 1.3 specification provide
support for automatic asynchronous messaging using message-driven
beans(MDBs),
„ A type of enterprise bean defined in the EJB 2.0 specification, and JMS listeners,
part of the JMS Application Server Facilities (ASF).
„ Messages are automatically retrieved from JMS destinations, optionally within a
transaction,then sent to the MDB in a J2EE application, without the application
having to explicitly poll JMS destinations.
„ A MDB is stateless component that is invoked by the J2EE container as result of the
arrival of the JMS message at a particular JMS message at a particular JMS
destination.
„ MDB listener fully integrated with EJB container and runs in application server not
in JMS server
„ MDB’s can fully administered from WAS 5.0 administrative clients

Mess
age listener MDB
Messaging Types
„ Application can use two styles of messaging
„ Point-to-point : Applications use queues to pass messages between
each other, One application puts the message into the Q and other
application takes the message from the Q
„ Publish/subscribe : Applications publish messages to topics. To receive
messages, applications subscribe to topics; when a message is
published to a topic, it is automatically sent to all the applications that
are subscribers of that topic.
WebSphere 5 : JMS Server Support
„ Full function JMS Server is included with WebSphere Application Server
„ Installed as part of the server installation
„ Fully integrated with the servers’ administration and runtime
„ Fully compliant with J2EE 1.3 JMS compliance tests
„ Built-in JMS Provider – Implementation
„ Based on WebSphere MQ
„ Built-in JMS provider has reduced function, smaller footprint compared to
WebSphere MQ, Limitations including
„ Not possible to exchange messages with queue managers outside of
WAS
„ Limited MQ communications capabilities

„ External MQ support
„ Although WAS 5.0 provides built-in JMS provider, due to its limitations we
might need to use external MQ providers like WebSphere MQ 5.3
„ Usage
„ Customers who not require full function WebSphere MQ can use the internal
JMS provider
„ Customer currently using full function WebSphere MQ products are expected
to remain using the full function and can ignore the internal JMS provider
„ Customers can also start using Internal JMS provider as a start and later can
migrate to external .
JMS Server Administration
„ Three types of JMS Managed Resources
„ WebSphere JMS provider (built-in provider)
„ WebSphere MQ JMS providers ( external WebSphere MQ)
„ Third party JMS servers
„ In Base configuration JMS server runts within application server process
„ In ND , each node will have one separate JMS server process (JVM)
„ JMS resources defined in a JMS server are accessible from anywhere in
the cell
„ JMS Applications use JNDI to look up
„ Connection factories ( drivers)
„ Destinations
Administering JMS Resources
„ Select Provider
„ Create Connection Factory
„ Queue or Topic Connection
factory
„ Specify JNDI name
„ User and password
„ Create a JMS Destination
„ Queue Topic
„ JNDI name
„ Create listener port
„ Select JMS server
„ Create listener port
„ To create listener ports choose
Application Servers > server1
>Message Listener Service >
„ At application install time, specify
listener port for MDBs
Web Services
„ What is a web service?
„ Web services are self-contained, self-describing, modular
applications that can be published, located, and invoked across the
Web.
„ A sample Web service might provide stock quotes or process
credit card transactions.
„ Once a Web service is deployed, other applications (and other Web
services) can discover and invoke the service.
„ Web services are independent of specific programming languages or
operating systems. Instead, Web services rely on pre-existing transport
technologies (such as HTTP) and standard data encoding techniques
(such as XML) for their implementation.
„ The Web services approach to programming is based on the idea of
building applications by discovering and invoking network-available
applications to accomplish some task.
Web Services Characteristics
„ The presented service-oriented architecture employs a loose coupling
between the participants. Such a loose coupling provides greater flexibility:
„ In this architecture, a client is not coupled to a server, but to a service.
Thus, the integration of the server to use takes place outside of the scope
of the client application programs.
„ Old and new functional blocks are encapsulated into components that work
as services.
„ Functional components and their interfaces are separated. Therefore, new
interfaces can be plugged in more easily.
„ Within complex applications, the control of business processes can be
isolated. A business rule engine can be incorporated to control the
workflow of a defined business process. Depending on the state of the
workflow, the engine calls the respective services.
„ Services can be incorporated dynamically during runtime.
„ Bindings are specified using configuration files and can thus easily be
adapted to new needs.
Core Technologies Used in Web Services
„ XML (eXtensible Markup Language) is the markup language that
underlies most of the specifications used for Web services. XML
is a generic language that can be used to describe any kind of
content in a structured way, separated from its presentation to a
specific device.
„ SOAP (formerly referred to as Simple Object Access Protocol, or
Service-Oriented Architecture Protocol—in fact, similarly to JDBC,
it is no longer an acronym) is a network, transport, and
programming language- neutral protocol that allows a client to
call a remote service. The message format is XML.
„ WSDL (Web services description language) is an XML-based
interface and implementation description language. The service
provider uses a WSDL document in order to specify the
operations a Web service provides, as well as the parameters
and data types of these operations. A WSDL document also
contains the service access information.
„ UDDI (universal description, discovery, and integration) is both
a client- side API and a SOAP-based server implementation that
can be used to store and retrieve information on service
providers and Web services.
Web Services Roles and Functions
„ The service provider creates a Web service and possibly publishes its
interface and access information to the service registry. Each provider
must decide which services to expose.
„ The service broker (also known as service registry) is responsible for
making the Web service interface and implementation access
information available to any potential service requestor.
„ The service requestor locates entries in the broker registry using
various find operations and then binds to the service provider in order
to invoke one of its Web services.
Legacy
system

Service
requester Service
internet
provider

Service
broker
WebSphere 5.0 Support for Web Services
„ Web services in WAS 5 have been enhanced with the addition of UDDI
registry and web services gateway
„ Support for SOAP based web services hosting and invocation
„ Web services support for SOAP/HTTP as service provider
„ Application server can act as both web service requester and service
provider

Web services Gateway:


„ The gateway is a middleware component that bridges the gap between
Internet and Intranet environments during Web service invocations. You
use it to manage
„ Web services.
„ channels that carry requests to and responses from the services.
„ filters that act upon the services.
„ references to UDDI registries in which services can be registered.
„ Gateway can be used to make your internal Web services available
externally, and to make external Web services available to your internal
systems.
„ Builds upon the WSDL (Web Services Description Language) and WSIF
(Web Services Invocation Framework)
„ Gateway itself is a J2EE application
Tivoli Performance Viewer
„ WebSphere provides a Performance Monitor Interface (PMI) that allows to
collect data on run-time and applications .
„ Performance data can be monitored and analyzed with a variety of tools,
Tivoli Performance Viewer is one of the tool.
„ Tivoli Performance Viewer is previously known as Resource analyzer
„ This tool provides the ability to configure smart auto-tuning parameters that
will automatically make recommendations to tune critical WebSphere
parameters for maximized performance
„ Few Performance Monitoring Tasks
„ Enable Performance Monitoring Services
„ Collect the data, choose monitoring levels that determine which data counters are
enabled
„ Monitor and analyze performance data
Administering Performing Monitoring Services
„ To monitor performance data
through PMI interfaces, we
must first enable the
performance monitoring
services through the admin
console and restart the
server
„ To enable select Servers-
>Application Servers-
>Server1
„ Click on the “Performance
Monitoring Services” from
“Additional Properties ” list
(you need to scroll the
screen to this link)
„ Check the Startup check box
then click Apply
„ Restart the server
„ Each server organized PMI
data into modules and
submodules
Performance Data Terminology
„ Performance Data Hierarchy
„ Node : A physical machine in administrative domain
„ Server: A functional unit that provides a service
„ Module: Module represents one of the resource categories for which collected
data is reported to the performance viewer
„ EJBs
„ Database Connection Pools
„ JVM run time
„ Session Manager
„ Transaction Manager
„ JDBC Timings
„ ORB
„ Web modules
„ WLM
„ Web services
„ Submodule : Represents a find granularity of resource category (example: EJB
method, Servlet, JSP etc..
„ Classification
„ Numeric: Simple counts and sizes
„ Statistical : Data on sample space (Average response time)
„ Load: Values as function of time ( Number of threads)
„ Counter: Is a data type used to hold the performance data.
„ Activating higher number of counters can slows down the application
performance.
Data Collection
„ Enterprise bean module, enterprise bean - methods in a bean Data
counters for this category report load values, response times, and life
cycle activities for enterprise beans Examples include the average
number of active beans and the number of times bean data is loaded or
written to the database. the number of times a method is called and the
average response time for the method etc..
„ JDBC connection pools - Data counters for this category contain
usage information about connection pools for a database. Examples
include the average size of the connection pool or number of
connections, the average number of threads waiting for a connection the
average wait time in milliseconds for a connection, and the average time
the connection is in use.
„ JVM - Data counters for this category contain memory used by process
as reported by JVM run time. Examples are the total memory available
and the amount of free memory for the JVM.
„ Servlet Session manager - Data counters for this category contain
usage information for HTTP sessions.Example include the total number
of accessed session, the average amount of time it takes for a session to
perform a request and average number of currently active HTTP
sessions.
Data Collection
„ Thread Pool - Data counters for this category contain information about
the thread pools for ORB threads and web container pools.Example
include number of active threads in the pool
„ ORB - Data counters for this category contain information for the ORB.
Examples include object reference lookup time etc..
„ Web Modules, Servlet - Data counters for this category contain
information for the selected server. Example include the number of
loaded Servlet, number of requests for the Servlet etc
Tivoli Performance Viewer
„ Tivoli performance viewer is a java GUI client which retrieves the
Performance Monitoring Infrastructure (PMI) data from an application
server.
„ Tivoli performance viewer is responsible
„ To provide Data in real time
„ To record data in log
„ To provide data representation as charts, tabular forms
„ To minimize the performance impact on applications, Tivoli Performance
Viewer polls the server at an interval set by the user.
„ To start Tivoli Performance Viewer use the command as following
„ ./opt/WebSphere/AppServer/bin/tperfviewer.sh localhost 8879 SOAP
„ Make sure that you already enabled the Performance Monitor Service and
restarted the server
Tivoli Performance Viewer - Console
„ The main console of
the performance
viewer looks like the
screen on this page
„ It consists Resource
Selection (left) panel
and Data monitoring
(right) panel
„ The monitoring
settings determine
which counters are
enabled, changes
made to the settings
from Tivoli affect all
applications using the
PMI data
„ Performance
monitoring level can
be changed either
from Admin console
or from Performance
Viewer as shown in
the screen.
„ Standard means-
all modules will set to
High
Tivoli Performance Viewer - Console
„ To view summary
reports, click the
application server icon in
the navigation tree
„ View can be changed
from Tabular data form
to Chart by choosing the
Tabs
„ We can observe the data
by requesting the
hello.jsp from the
browser and watch the
Web Application’s
Total Requests value in
Performance Viewer.
„ All data reported by the
performance Viewer can
be saved to a log file.
Other Tivoli Tools
„ IBM Tivoli Monitoring for Web Infrastructure (ITMfWI)
„ Identifies potential problems
„ Notifies appropriate personnel
„ Suggests solutions
„ Real-time console
„ IBM Tivoli Monitoring for Transaction Performance (ITMTP)
„ Round trip response time from between end-user and server
„ Network latency
„ Page render time
„ Note: The above mentioned tools are not included with
WebSphere Application Server packaging
„ Tuning hints
„ Tuning should be done before deployment not after
„ Create stable environment, measure and document environment
„ Tune parameter on any selected object
„ Re-measure and evaluate
„ 80-20 rule- find big performance problems first
„ 80% of performance gain with 20% effort
„ 20% of additional performance gain requires 80% effort
WebSphere 5.0 - Troubleshooting
„ Problems within an e-business environment can take many forms,
including poor performance, application unavailability, or unexpected
results. The first step in problem resolution is to isolate the problem and
understand what it is.
„ WebSphere provides the following sources of feedback to help
with problem determination.
„ Administrative console messages. These provide important
information regarding runtime events and configuration problems. They
are an important starting point to determine the cause of any
configuration problem.
„ Log files. Several general-purpose logs are provided, such as JVM
standard logs, process (native) logs, and IBM service logs.
„ Traces. Traces provide more detailed information about WebSphere
components to determine what is wrong with your WebSphere
environment.
„ Log Analyzer.The Log Analyzer is a GUI tool that permits the user to
view any logs generated with log analyzer trace format, such as the IBM
service
„ log file. This tool allows the user to get error message explanations and
information such as why the error occurred and how to recover from it.
„ Thread Analyzer. The Thread Analyzer technology preview assists
analyzing Java stack trace files and viewing the threads, both for hung or
deadlock conditions, or to simply evaluate application processing.
WebSphere 5.0 - Troubleshooting
„ Collector tool. The Collector tool gathers information about the
application server installation and packages it in an output JAR file. The
information in the file includes logs, property files, configuration files,
operating system and Java data, and prerequisite software presence and
levels. The file can be sent to IBM Customer Support to assist in problem
determination and analysis.
„ FFDC. The First Failure Data Capture (FFDC) function preserves the
information generated from a processing failure and returns control to
the affected engines. The captured data is saved automatically for use in
analyzing the problem, and could be collected by the Collector tool.
Troubleshooting- Administrative Console Messages
„ Runtime status messages are displayed at the WebSphere Status area
at the bottom of the administrative console, providing information
regarding runtime events and configuration problems.
„ The area consists of two frames:

„ Runtime messages

„ Configuration messages

„ Messages indicating configuration problems are cleared when


the problem is fixed
„ To view the messages click on the icon X or i or !
Troubleshooting- Log Files
„ WebSphere Application Server can write system messages to several
general-purpose logs. These include:
„ JVM logs are created by redirecting the System.out and System.err
streams of the JVM. By default, these files are stored as
<WAS_HOME>/logs/<server_name>/SystemOut.log and SystemErr.log.
„ Process (native) logs are created by redirecting the stdout and stderr
streams of the process’s native module (.dlls, .so, UNIX libraries, and other
JNI native modules), including the JVM native code itself. These logs can
contain information relating to problems in native code or diagnostic
information written by the JVM. By default, these files are stored as
<WAS_HOME>/logs/<server_name>/native_stderr.log and
native_stdout.log.
„ Service log is a special log named, by default, activity.log, written in a
binary format. You cannot view the log directly using a text editor. Log
Analyzer or the Showlog tool is required to view the log.
Troubleshooting- Configuring the JVM logs

„ Configuring the JVM logs


„ To view and modify the settings for the
JVM System.out and System.err logs
using the administrative consoles:
„ 1. Click Troubleshooting -> Logs
and Trace in the navigation tree.
„ 2. Select a server by clicking the server
name.
„ 3. Click JVM Logs.
„ 4. Select the Configuration tab
„ 5. Scroll through the window to display
the attributes
„ 6.Change appropriate values and save
the click apply to save the changes
„ 7.Click on Save to commit the changes
Troubleshooting - Process (native) Logs
„ Process (native) logs
„ The stdout and stderr streams written by native modules (.dlls, .so, UNIX
libraries, and other JNI modules) are redirected to the native log files at
application server startup. By default, these files are stored as
<WAS_HOME>/logs/<server_name>/native_stderr.log and
native_stdout.log.
„ To view or change the log settings or to view the log:
„ 1. Click Servers -> Application Servers
„ 2. Select the server by clicking the name.
„ 3. Select Process Definition in the Additional Properties table.
„ 4. Select Process Logs in the Additional Properties table.
„ 5. To view the settings, select the Configuration tab. To view the logs
select the Runtime tab.
Troubleshooting – IBM Service (active) Logs
„ The IBM service log is a special log
written in a binary format that
captures events that show a
history of WebSphere Application
Server activities, also known as the
activity log.
„ 1. Select Troubleshooting ->
Logs and Trace.
„ 2. Select the server by clicking the
name.
„ 3. Select IBM Service Logs.
„ 4. Make appropriate changes
„ 5. Save the configuration
„ 6. Restart the server to apply the
configuration changes
„ To view the service log, use the
showlog command in the
<WAS_HOME>/bin directory or
use Log Analyzer
Troubleshooting – Tracing
„ Tracing can be useful if you have
problems with particular
components of WebSphere
Application Server.
„ By default, the trace for all
WebSphere Application Server
components is disabled.
1. Select Troubleshooting -> Logs
and Trace.
2. Select the server by clicking the
name. You can select an
application server, node agent, JMS
server, or the Deployment
Manager.
3. Select Diagnostic Trace.
4. Select the Configuration tab.
5. Save the changed configuration.
6. Start (or restart) the server.
Troubleshooting – Enable Tracing on Running Servers
1. Select Troubleshooting -> Logs and Trace.
2. Select the server by clicking the name. You can select an application
server, node agent, JMS server, or the Deployment Manager.
3. Select Diagnostic Trace.
4. Select the Runtime tab.
„ Select the Save Trace check box if you want to write your
changes back to the server configuration.
5. Click Apply.
Troubleshooting – Web Server Logs and Traces
„ If a problem is suspected with the Web server or between the Web
server and the Web container, there are several tools you can use.
„ Web server plug-in generation
„ The Web server plug-in configuration file controls what content is transferred
from the Web server to an application server. This file must be regenerated
after certain changes to the WebSphere configuration server and then moved
to the proper location on the Web server.
„ If there is a problem with requests being routed to WebSphere Application
Server from the Web server, make sure the Web server plug-in has been
properly generated and moved to the Web server.
„ Web server plug-in log
„ The Web server plug-in creates a log file containing error and informational
messages. The level of information placed in this log is determined by a
setting in the Web server plug-in configuration file. Possible values in order of
significance are Trace, Warn and Error (default).
„ Web server plug-in configuration file log setting
<?xml version="1.0"?>
<Config>
Config>
<Log LogLevel="Trace"
LogLevel="Trace" Name="...\
Name="...\AppServer\
AppServer\logs\
logs\http_plugin.log"/>
http_plugin.log"/>
…..
</Config
</Config>>
„ These changes have to made manually to the plugin-
plugin-cfg.xml file, by default WebSphere
keep the LogLevel as Error
Troubleshooting – HTTP Server Logs
„ The IBM HTTP Server has the following log files that aid in problem
diagnosis:
„ Error log
„ Access logs
„ Error log
„ The error log records IBM HTTP Server errors. The location for the
error log is specified with the ErrorLog directive.
„ Access log
„ The access log records all Web server activity, including the following
information for each request:
„ What was requested
„ Who requested it
„ When it was requested
„ The method used
„ The type of file sent in response
„ The return code
Troubleshooting – Log Analyzer
„ The Log Analyzer is a GUI tool that permits the user to view
service and activity logs. It can take one or more logs, merge
all the data, and display the entries in sequence.
„ This tool is shipped with an XML database, the symptom
database, which contains strings for some common problems,
reasons for the errors, and recovery steps. The Log Analyzer
compares every error record in the log file to the internal set
of known problems in the symptom database and displays all
the matches. This allows the user to get error message
explanations and information such as why the error occurred
and how to recover from it.
„ The symptom database can be updated with latest IBM’s
symptom database

Using Log Analyzer


1. The Log Analyzer can be started from the <WAS_HOME>/bin
directory using the wcslogbr.sh command.
2. When the Log Analyzer GUI starts, select File -> Open from
the main menu. Navigate to the <WAS_HOME>/logs
directory, select activity.log and click Open.
Troubleshooting – Log Analyzer
3. Select an entry in the
UnitOfWorkView folder and the
details will appear in the upper-right
pane.
4. To analyze a log entry, right-click
the entry and select Analyze from
the pop-up menu, as shown . The
entry will be compared to the
symptom database. If there is a
match, the information will appear
in the lower-right pane
„ Log information can be seen as
shown in the second screen on this
page.
„ You can update the symptom
database using
„ File -> Update Database ->
WebSphere Application Server
Symptom Database (for WebSphere
Application Server) or WebSphere
Application Server Network
Deployment Symptom Database
Troubleshooting – Thread Analyzer Technology Preview
„ Application servers sometimes produce a Java stack trace, also called a
Java thread dump or javacore file, as a result of errors. Tools were
needed to assist in viewing this trace.
„ The Thread Analyzer technical preview can assist you in analyzing Java
stack trace files and in viewing the threads, both for hung or deadlock
conditions, or to simply evaluate application processing.
„ Thread Analyzer is not included in WebSphere package, we can down
load the tool from following URL
„ http://www7b.boulder.ibm.com/wsdd/downloads/ta.html.

Collector tool
„ The Collector tool gathers information about a WebSphere Application
Server installation and packages it in an output JAR file. The file can be
sent to IBM Customer Support to assist in problem determination and
analysis. The information in the file includes logs, property files,
configuration files, operating system and Java data, and prerequisite
software presence and levels.
„ To run collector toll, log on to the system as root and do the following:
„ # mkdir work
„ # cd work
„ work# /opt/WebSphre/AppServer/bin/collector.sh
„ You can not run this tool from WebSphere home directory, and files will
be created in work directory after the process finished
Troubleshooting – Others
„ First Failure Data Capture logs
„ The First Failure Data Capture (FFDC) function preserves the information
generated from a processing failure and returns control to the affected
engines.There are three property files which control the behavior of the
FFDC filter:
„ properties/ffdcStart.properties - used while the server is starting
„ properties/ffdcRun.properties - used after the server is ready
„ properties/ffdcStop.properties - used while the server is stopping
„ The captured data is saved automatically in the <WAS_HOME>/logs/ffdc
directory for use in analyzing the problem, and could be collected by the
Collector tool. The First Failure Data Capture tool is intended primarily for
use by IBM Service.
Troubleshooting – Others
HTTP session monitoring
„ In the event of session-related problems, it is helpful to collect all
session-related information. WebSphere Application Server V5 introduces
an HTTP session tracker Servlet called IBMTrackerDebug.
„ To access the Servlet from a browser, use the following URL:
„ http://localhost:9080/Hello/servlet/com.ibm.ws.webcontainer.httpse
ssion.IBMTrackerDebug
System core dump analysis
„ If possible, UNIX processes (including JVM process) will produce a
system core dump as well as Java stack trace information in a process's
working directory if it crashes. The system core dump can provide useful
information as to why the process crashed, giving you a system view of
a failing JVM process. However, the system core dump will not provide
Java class information. Everything in the dump is C library oriented. The
information provided for JVM process refers to Java's C libraries and not
the reference Java class files.
Application Debugging and Tracing

„ Debugging applications is beyond the scope of this course. However, we


want to point out two facilities provided by WebSphere Application
Server:
„ Application Server Toolkit
„ JRas extensions and logging toolkit
J2EE Best practices for better performance
# Category Best practice description Importance
1 Servlets Do not store large object graphs in HttpSession 2
2 Servlets Release HttpSessions when finished 3
3 JSP Do not create HttpSessions in JSP’s by default 4
4 Servlets Minimize synchronization in Servlets 2
5 Enterprise Application Use JDBC connection pooling 3
components
6 Servlets Do not use SingleThreadModel 5
7 Enterprise Application Reuse datasources for JDBC connections 1
components
8 Enterprise Application Release JDBC resources when done 3
components
9 Servlets Use the HttpServlet Init method to perform expensive 4
operations that need only be done once
10 Enterprise Application Minimize use of System.out.println 2
components
11 Enterprise Application Avoid String concatenation “+=” 1
components
12 EJB Access entity beans from session beans 3
13 EJB Reduce the EJB transaction isolation level where appropriate 5
14 EJB If EJBs and Clients in same JVM , Use “local” homes 2
WebSphere Tuning
Problem Tuning parameter
Overall throughput and response time are undesirable. Processor speed

AIX: Memory allocation error AIX file descriptors (ulimit) Scroll down to this parameter from
Operating Systems.
ORB: Response time and throughput indicate EJB AIX file descriptors (ulimit) Logical Pool Distribution (LPD)
requests with shorter execution times are being denied mechanism, set using ORB custom properties.
adequate access to threads in ORB thread pool.
Solaris operating environment: Too many Solaris file descriptors (ulimit) Scroll down to this parameter from
files open Operating Systems.
Solaris operating environment: The server Solaris tcp_time_wait_interval and Solaris p_fin_wait_2_flush_interval
stalls during peak periods, responses take minutes, Scroll down to this parameter from Operating Systems.
processor utilization remains high with all activity in the
system processes, and netstat shows many sockets are
open to port 80 in CLOSE_WAIT or FIN_WAIT_2 state.
Windows NT or Windows 2000: Netstat shows too Windows NT or Windows 2000 TcpTimedWaitDelay For IBM HTTP
many sockets are in TIME_WAIT. Under load, client Server on Windows NT, see ListenBackLog
requests do not arrive at the Web server because they
time out or are rejected.
Windows NT or Windows 2000: WebSphere Microsoft Internet Information Server (IIS) properties
Application Server performance decreased after an
application server from another vendor was installed.
The Percent Maxed metric from the Tivoli Performance Thread pool Maximum size
Viewer indicates that the Web container thread pool is
too large or too small.
WebSphere Tuning
Problem Tuning Parameter
Netstat shows too many TIME_WAIT state sockets for port HTTP transports MaxKeepAliveConnections and HTTP
9080. transports MaxKeepAliveRequests
Too much disk input and output occurs due to paging. Maximum heap size

The Percent Used metric for a data source connection pool Maximum connection pool and Minimum connection pool
from the Tivoli Performance Viewer indicates the pool size is
too large.
The Prepared Statement Discards metric from the Tivoli Statement cache size
Performance Viewer indicates that the data source statement
cache size is too small.
Too much disk input and output occurs due to DB2 writing log DB2 MinCommit
records.
The Percent Maxed metric from the Tivoli Performance Viewer EJB method Invocation Queuing
indicates that the Object Request Broker thread pool is too
small.
The Java Virtual Machine Profiler Interface (JVMPI) from the Detecting over-utilization of objects
Tivoli Performance Viewer indicates over-utilization of objects
when too much time is spent in garbage collection.
The Used Memory metric from the Tivoli Performance Viewer Detecting memory leaks
shows memory leaks and the Java code displays an Out of
Memory Exception
The Used Memory metric from the Tivoli Performance Viewer Detecting memory leaks
shows memory leaks and the Java code displays an Out of
Memory exception.
Startup performance is poor. Using Java virtual machine settings, set a minimum heap
size of at least 50MB (-Xms50m).
Thank You!

http://www.jvrsystems.net
JVR Systems, Inc.
Phone: (248) 471-2579
Fax: (248) 471-2509

Potrebbero piacerti anche