152
WebSphere Administration Guide – Packaging and Deploying JEE Applications -Gagandeep Singh

Web Sphere Administration guide – Packaging and Deploying Jee Applications

Embed Size (px)

Citation preview

Page 1: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WebSphere Administration Guide – Packaging and Deploying JEE

Applications-Gagandeep Singh

Page 2: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Agenda

• WebSphere Overview• JEE Overview• WebSphere Architecture• Installing WebSphere• The Admin Console• Managing Applications• JEE Technologies• Summary

Page 3: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WebSphere Product Overview

Page 4: Web Sphere Administration guide – Packaging and Deploying Jee Applications

What is WebSphere ?

• WebSphere is not a product but an IBM brand, powered by Java and JEE.

• WebSphere is infrastructure software for delivery of e-business applications.

• The WebSphere product family is divided into three categories:– Foundation and Tools– Business portals – Business Integration

Page 5: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WebSphere Product Family

Page 6: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WebSphere Product Family

• Foundation and Tools - represents the heart of the WebSphere product line; the WAS, the RAD product line, and the WebSphere tools for host integration.

• Business Portals - include WebSphere Portal Server WebSphere Commerce etc.

• Business Integration - includes the WebSphere MQ family of products for enterprise messaging, workflow, systems integration, WebSphere Business Integration.

Page 7: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Additional Product Families

• The Tivoli family of products for systems management and security provide additional capabilities for WebSphere.

• The Rational family of products for application development, such as Rational Application Developer, Rational Modeler for UML modeling, Rational Clear Case for SCM.

Page 8: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WebSphere Application Server (WAS)

• A JEE compliant application server.• Provides the core technologies used by other

WebSphere products.• Provides an environment to run web based

multi-tier e-business applications.

Page 9: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WebSphere Application Server (WAS)

Page 10: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Packaging

• WAS Express V 6.0 – A lightweight edition of WAS without an EJB container.

• WAS Base V6.1 – A fully compliant JEE server supporting the JEE 1.4 spec.

• WAS Network Deployment V6.1 – extends WAS Base to include clustering capabilities, edge components and distributed configuration management.

Page 11: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Packaging

Page 12: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Copyright © Oded Nissan 2009

Resources

• Info center for WAS 6.1 - http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp

• IBM Redbooks - http://www.redbooks.ibm.com/

Page 13: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Overview

Page 14: Web Sphere Administration guide – Packaging and Deploying Jee Applications

What is JEE ?

• A set of technologies for developing enterprise applications in Java

• Specified by Sun and the Java Community Process (JCP).

• Implemented by JEE vendors.• Implementations of JEE technologies are

provided within Application Servers.• Previously named J2EE (until version 1.4)

current version is JEE 5.

Page 15: Web Sphere Administration guide – Packaging and Deploying Jee Applications

What is JEE ?

• Relation between JEE vendors and developers.

Page 16: Web Sphere Administration guide – Packaging and Deploying Jee Applications

What is JEE ?• The Java Platform

High-EndServer

Java Technology Enabled Desktop

WorkgroupServer

Java Technology Enabled Devices

Page 17: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The Java Platform

OptionalPackages

Java Enterprise

Edition(JEE)

Java StandardEdition

(JavaSE)

JVM

Java Card APIs

CardVM

OptionalPackages

Personal Basis Profile

Personal Profile

Foundation Profile

CDC

MIDP

CLDC

KVM

Java Platform Micro Edition(JavaMETM)

* Under development in JCP

Page 18: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Why do we need JEE ?

• Standard API• Portable• Tool Support• Distribution• Transactions• Security• Scalability• Persistence

Page 19: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The JEE Architecture

• N-tier architecture• Comprised of technologies for the business

tier the presentation tier and other system services.

• Runs within the application server and within specific containers (web container, EJB container) within the Application server.

Page 20: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The JEE Architecture

• Uses the "component and container" model in which container provides system services in a well-defined and as industry standard

• JEE is a standard that also provides portability of code because it is based on Java technology and standard-based Java programming APIs

Page 21: Web Sphere Administration guide – Packaging and Deploying Jee Applications

About N-Tier Architecture

• Single Tier – a simple desktop application.• Two Tier – A thin or a fat client and a server.• Three Tier – A presentation tier a business tier

and a Data tier.

Page 22: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Three-Tier architecture

Web Tier EJB Tier

Page 23: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Tier Architecture

Page 24: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Application Servers

• JEE vendors provide their implementation of JEE technologies within an Application Server.

• Each application server has its own implementation of JEE standards as well as some proprietary features.

• Comprised of a Web Container,EJB Container and other server services.

Page 25: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The App server and JEE containers.

Page 26: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Development Roles

• Component provider– Bean provider

• Application assembler• Deployer• Platform provider

– Container provider• Tools provider• System administrator

Page 27: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The JEE Life CycleCreation Assembly Deployment

Created by Component Developer

Assembledand Augmentedby Application

Assembler

Processed by Deployer

Deploy

EnterpriseComponents

JEE Container

JEE APPJEE Modules

Page 28: Web Sphere Administration guide – Packaging and Deploying Jee Applications

System Administrator Role

• Manage servers• Install and manage applications.• Manage and maintain configurations.• Create and maintain server topologies:

network deployment, cluster etc.• Monitor and troubleshoot production and test

deployments.• Implement a security policy.

Page 29: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Development Tools

• Provided by Application Server vendors or open source projects.

• Usually provided as plugins to popular IDEs such as Eclipse or NetBeans.

• The tools help developers create JEE resources, debug and deploy them.

Page 30: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Development Tools

• IBM – provides the RAD product (based on Eclipse) for developing for WebSphere.

• RAD 7.0 is compatible with WAS 6.1• The Eclipse project provides open source

plugins for most application servers.

Page 31: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The JEE Application Structure

Page 32: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Application Structure

• A JEE application is packaged into an EAR file.• The EAR file contains Web modules, EJB modules and

utility jars.• The Web application is packaged into a WAR file, and

the WAR file is packaged into the EAR.• The EJB’s are packaged into a special jar file which is

the EJB module, which is packaged into the EAR file.

Page 33: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Application Structure

Page 34: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The EAR File Structure

Page 35: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE projects in RAD

Page 36: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Copyright © Oded Nissan 2009

Packaging JEE Applications

• In order to deploy applications to WebSphere application code must be packaged into JEE modules (EAR WAR JAR etc.)

• Packaging applications can be done using:– RAD export options.– Ant scripts.

Page 37: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WebSphere Architecture

Page 38: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The WebSphere Architecture

• Base or Single Server environment features a standalone single server.

• Network Deployment or Multi Server environment, features multi servers managed centrally by a deployment management process.

Page 39: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The WebSphere Architecture

• A server is the smallest configuration unit and represents a WAS instance.

• A Node is a configuration unit that can include several servers, usually a node represents a physical machine running WAS.

• A Cell is a configuration unit that can include several nodes.

Page 40: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The WebSphere Architecture

• In a Base environment a single node manages a single server.

• In a Network Deployment environment we have a cell managing several nodes each containing one or more servers.

Page 41: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Base Environment

Page 42: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Network Deployment Environment

Page 43: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java Management Extensions (JMX)

• The system management functionality of WebSphere Application Server is based on the use of Java Management Extensions (JMX). JMX is a framework that provides a standard way of exposing Java esources, for example application servers, to a system management infrastructure.

• The JMX framework allows a provider to implement functions, such as listing the configuration settings, and allows users to edit the settings. It also includes a notification layer that can be used by management applications to monitor events.

Page 44: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JMX Architecture

• The JMX architecture is structured into three layers:• Instrumentation layer The instrumentation layer dictates

how resources can be wrapped within special Java beans called Management Beans (MBeans).

• The agent layer consists of the MBean server and agents, which provide a management infrastructure.

• Management layer The management layer defines how external management applications can interact with the underlying layers in terms of protocols, APIs, and so on.

Page 45: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JMX Architecture

Page 46: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JMX Distributed Administration

Page 47: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Distributed Administration

• Administration in a distributed server environment is by necessity more complex than administration in a stand-alone server environment.

• In a distributed server environment, multiple WebSphere Application Server nodes are managed from a single central location.

Page 48: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Distributed Administration

• Administration is performed by three layers.

Page 49: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Distributed Administration

Page 50: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Distributed Process Discovery

• When a managed server begins its startup, it sends a discovery request message that allows other processes to discover its existence and establishcommunication channels with the process.

• Each node agent and deployment manager maintains status and configuration information by using discovery addresses, or ports. On startup, processes discover other running components, and create communication channels

Page 51: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Distributed Process Discovery

Page 52: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Configuration Management

• In a distributed server environment, the master repository of configuration and application data for the cell is managed by the deployment manager.

• Each node contains a separate copy of the repository containing only the required files.

• When an administrator makes changes to the configuration using an administration tool and saves these changes to the master repository, they are available for use. The next step is to synchronize the changes out to the nodes of the cell.

Page 53: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Configuration Synchronization

• Responsible for synchronizing the master configuration to all nodes in the cell.

• During the synchronization operation, the node agent checks with the deployment manager to see if any files that apply to the node have been updated in the master repository. New or updated files are sent to the node, while any deleted files are also deleted from the node.

Page 54: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Repository Directory Structure

Page 55: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 56: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Hardware Requirements

• For Windows (32 bit WebSphere Application Server) – Intel® Pentium processor at 500 MHz or faster – Intel EM64T or AMD Opteron – 1030 MB disk space– Minimum 512 MB physical memory; 1 GB recommended – CD-ROM drive

•For Windows (64 bit WebSphere Application Server) – AMD Opteron or Intel EM64T – 1030 MB disk space– Minimum 1 GB of physical memory recommended – CD-ROM drive

Page 57: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Software Requirements - OS

• Microsoft Windows Server 2008, • Microsoft Windows XP Professional with SP2 • Microsoft Vista Business• Microsoft Vista Enterprise• Microsoft Vista Ultimate• Microsoft Windows 2000• Microsoft Windows Server 2003

Page 58: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Software Requirements - Java

• IBM 32-bit SDK for Windows, Java 2 Technology Edition, V5.0 SR2

• IBM 64-bit SDK for Windows on AMD64/EM64T architecture, Java 2 Technology Edition, V5.0 SR2

• The Java VM supplied with WebSphere must be used to run WAS and application clients.

Page 59: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Software Requirements – Web Servers

• IBM HTTP Server V7.0 V6.1 V6.0• Apache HTTP Server V2.2 V2.0.54• Microsoft IIS V7.0 V6.0 V5.0• Lotus Domino Enterprise Server 6.5.4 or 7.0 • More specific details at: – http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg27007663

Page 60: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 61: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 62: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 63: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 64: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 65: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 66: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 67: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 68: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Installation

Page 69: Web Sphere Administration guide – Packaging and Deploying Jee Applications

First Steps

• First Steps is a post installation tool that is started automatically at the end of installation.

• Can be started from the windows menu or command line.

• Used to verify the installation. Run the installation verification utility.

Page 70: Web Sphere Administration guide – Packaging and Deploying Jee Applications

First Steps

Page 71: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing WebSphere

• Install WAS on your machine, according to the options specified in the previous slides.

• Verify the installation by running the installation verification from the FirstSteps console.

• Run the administrative console from the First Steps console.

Page 72: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing Silently

• Installing WebSphere Application Server using silent installation refers to using a file to supply installation options without user interaction.

• To configure the installation, change the options in the response file before you issue the installation command.

Page 73: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Customizing the Response file

• Locate the sample options response file. The file is named responsefile.base.txt in the WAS directory on the product CD-ROM or DVD.

• Copy the file to preserve it in its original form. For example, copy it as myoptions.txt on your disc drive.

• Edit the copy in your flat file editor of choice, on the target operating system. Read the directions within the response file to choose appropriate values.

Page 74: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing Silently

• Run the installer with the response file as a parameter:– "disc_drive_D:\WAS\install" -options

"C:\temp\WAS\myoptionsfile.txt" -silent

Page 75: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Directory Structure

Page 76: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Directory Structure

• bin – contains command line tools• _uninst – uninstaller for products.• config – XML configuration files• InstalledApps – installed applications• java – the JRE installed with WAS• logs – WAS log files• properties – property files for WAS

configuration.

Page 77: Web Sphere Administration guide – Packaging and Deploying Jee Applications

WAS Directory Structure

• profiles – contains WAS profiles. (A profile defines a WAS configuration).

• lib – WAS java libraries• derby – a lightweight relational DB.• samples – sample applications with source

and jacl scripts.

Page 78: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Command Line Tools

• startServer – starts the server• stopServer – stops the server• serverStatus – displays server status• wasProfile – manage WAS profiles.• versionInfo – displays installed product

versions.

Page 79: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Log files in the logs directory

• SystemOut.log – the JVM output log, contains all WAS and application messages logged to the standard output.

• SystemErr.log – contains all WAS and application messages logged to standard error.

• startServer.log and stopServer.log – log messages related to server startup and shutdown.

• Native_stderr.log and native_stdout.log – contains log messages from native libraries logged to standard output and standard error.

Page 80: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The Admin Console

Page 81: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The WAS Admin Console

• A web based application for administrating the server.

• Configuration is read and saved into XML files in the config directory.

• The admin console itself is a JEE application installed on WebSphere.

Page 82: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Starting the admin console

• The admin console can be started using a browser by pointing to the URL: http://localhost:9060/ibm/console

• In the login screen we can optionally enter a username

• If security is enabled we must enter a username and password. Authentication is performed using a JAAS module.

Page 83: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The WAS Admin Console

Page 84: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Admin Console Navigation Menu

• Servers – management and administration of application servers, web servers and MQ servers.

• Applications – installation, removal and management of JEE applications.

• Resources – creation and configuration of JEE resources such as JDBC Datasources, JMS queues and messaging engines, JCA Connectors and more.

Page 85: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Admin Console Navigation Menu

• Security – security management and configuration for servers and applications.

• Environment – configuration of virtual hosts, web server plugin generation, environment variables, JNDI naming and more.

• System Administration – saving the master configuration and console prefrences.

Page 86: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Admin Console Navigation Menu

• Users and Groups – configuration and management of users, groups and roles. Relevant only if administrative security is enabled.

• Monitoring and Tuning – configuration of performance monitoring.

• Troubleshooting – logging and tracing configuration.

Page 87: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Admin Console Navigation Menu

• Service Integration – configuration of message buses and web services (handlers, security etc.)

• UDDI – management of UDDI nodes, UDDI is a web services registry.

• Guided Activities – wizards for connecting a web server to an application server and connecting to a database.

Page 88: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Customizing the Admin Console

• The console navigation provides a hierarchical view of all of the tasks available in the console. A task is a page in the work area consisting of one or more console modules.

• Use the view menu at the top of the navigation to filter the list of tasks by product. Or, you can create a customized list by selecting My tasks from the View menu.

Page 89: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Saving Changes

• Until you save changes to the master repository, the administrative console uses a local workspace to track your changes.

• You can update the master repository with your administrative console changes, discard your administrative console changes and continue working with the master repository, or continue working with your administrative console changes that are not saved to the master repository.

Page 90: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Console Preferences

• Turn on workspace automatic refresh - Specifies whether you want the administrative console workspace to redraw automatically after the administrative configuration changes.

• No confirmation on workspace discard - Specifies whether the confirmation dialog is displayed after a request is received to discard the workspace. The default is to display confirmation dialogs.

Page 91: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Console Preferences

• Use default scope - Specifies whether the default scope is the administrative console node.

• Show the help portlet - Specifies whether the help portlet on the right of the console displays.

• Synchronize changes with nodes - Specifies whether to synchronize changes that are saved to the deployment manager profile with all the nodes that are running.

Page 92: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Console Preferences

• Enable command assistance notifications - Specifies whether to send Java Management Extensions (JMX) notifications that contain command assistance data from the administrative console.

• Log command assistance commands - Specifies whether to log all the command assistance wsadmin data to a file.

Page 93: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Application Server Settings

Page 94: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Application Server Settings

• Use this page to view or change the settings of an application server instance. An application server is a server which provides services required to run enterprise applications.

• To view this administrative console page, click Servers > Application Servers > server_name.

• On the Configuration tab, you can edit fields. On the Runtime tab, you can look at read-only information. The Runtime tab is available only when the server is running.

Page 95: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Configuration Tab – General Properties

• Name - Specifies a logical name for the server. Server names must be unique within a node. Read only.

• Node Name – the Websphere node.• Run in development mode - Enabling this option may

reduce the startup time of an application server. • Parallel Start - Specifies that you want the server

components, services, and applications to start in parallel rather than sequentially.

Page 96: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Configuration Tab – General Properties

• Class loading mode - Specifies whether the class loader should search in the parent class loader or in the application class loader first to load a class.

• Access to internal server classes - Specifies whether the applications can access many of the server implementation classes.

Page 97: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Runtime Tab

• Process Id – the process id of the server process in the OS.

• Cell Name• Node Name• State – the server’s state

Page 98: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Container Settings

• Web Container – settings related to the web container.

• EJB Container – settings related to the EJB container.

• Container services – ORB service settings, profiling settings, transaction settings and more.

Page 99: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Server Infrastructure

• Java and process management – JVM settings, JVM system properties, process parameters etc.

• Administration – configuration of administration services, JMX connection type etc.

Page 100: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Communication

• Ports – the communication ports used by WebSphere, here we can change the ports.

• Messaging – the JMS messaging listener service used by MDBs.

Page 101: Web Sphere Administration guide – Packaging and Deploying Jee Applications

In General

• The configuration tab contains shortcuts to categories that can be reached using the navigator.

• Use the console’s online help by pressing the help link in the upper right corner of the screen, in order to get help about the various configuration options.

Page 102: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Administration with Scripting

• WebSphere can also be configured using a scripting language.

• WebSphere provides a scripting interface base on the Bean Scripting Framework(BSF) called wsadmin.

• Wsadmin acts as an interface to Java objects accessed by scripts.

Page 103: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Administration with Scripting

• Wsadmin uses JMX beans for configuration.

Page 104: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The wsadmin Tool

• Wsadmin supports two different scripting language syntaxes: JACL and jython.

• JACL is on its way out, jython will be the only scripting language used in WebSphere 7.

• Most existing scripts today are written in JACL.

Page 105: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The wsadmin Tool

• Wsadmin supports two different scripting language syntaxes: JACL and jython.

• JACL is on its way out, jython will be the only scripting language used in WebSphere 7.

• Most existing scripts today are written in JACL.

Page 106: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The wsadmin Tool

• Wsadmin can be launched from <WAS_HOME>/profiles/<profile name>/bin/wsadmin.bat

• Three ways to launch:– Command option wsadmin –c <command>– Script file: wsadmin –f <script file>– Interactively: wsadmin

Page 107: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The wsadmin Tool

• There are five Java objects that perform different operations:– AdminConfig – create or change the configuration.– AdminApp – install modify or manage applications.– AdminControl – work with running objects, perform traces

and data type conversion.– AdminTask – access a set of task oriented administration

commands.– Help – display information and details about which

Mbeans are running.

Page 108: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JACL Script Example

set temp [catch {$AdminApp list} appList]puts "List of application will be uninstalled are $appList"

foreach app $appList { set temp [catch {$AdminApp uninstall $app} uninstallResult] puts "Uninstall result $uninstallResult" set temp [catch {$AdminConfig save} saveResult] puts "Save result $saveResult"}

Page 109: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Managing Applications

Page 110: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Managing Applications

• Use the console to manage existing applications. (start, stop remove etc.)

• Use the console to install new JEE applications packaged in an EAR file.

Page 111: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Enterprise Applications

Page 112: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Enterprise Applications

• Start – start the selected application.• Stop – stop the selected application.• Install – install a new application.• Uninstall – remove an existing application.• Update – update an existing application with a

new EAR file.• Remove file – remove a single file from an

application.

Page 113: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Enterprise Applications

• Export – export the application as an EAR file.• Export DDL – export DDL files found in the

application.• The application status shows the current

status of the application (started, stopped).

Page 114: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an application

• We can install an application in WebSphere in 3 different ways:– Using the Admin Console.– Using wsadmin scripting files. (we will discuss

later).– Programmatically using JMX beans.

Page 115: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 1)

• Choose the EAR file to install

Page 116: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 1)

• Browse the file system and choose the EAR file to install.

• Context root – change the context root for web applications. In case we are installing a WAR file and not an EAR file.

Page 117: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 2)

Page 118: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 2)

• Precompile JavaServer Pages files - Specify whether to precompile JavaServer Pages (JSP) files as a part of installation.

• Directory to install application – install the application is a specific directory.

• Deploy enterprise beans – deploy EJBs if they have not been deployed.

• Press the next button without overriding default values.

Page 119: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 3)

Page 120: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 3)

• Use this panel to specify deployment targets where you want to install the modules contained in your application. Modules can be installed on the same deployment target or dispersed among several deployment targets. A deployment target can be an application server, cluster of application servers or Web server.

• Press the next button

Page 121: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 4)

Page 122: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 4)

• Review your settings and press finish to complete the installation.

Page 123: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 5)

Page 124: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Installing an Application (step 5)

• WebSphere displays application deployment messages. Installation problems will be displayed here.

• Chose save to master configuration to complete the application installation.

• We can now start the application by choosing the manage applications link.

Page 125: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE Technologies

Page 126: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE 1.4 Technologies

• Presentation tier technologies– Servlets 2.4– Java Server Pages (JSP) 2.0– Java Standard Tag Library– Web Services

These technologies enable the implementation of a presentation tier in the JEE framework.

Page 127: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JEE 1.4 Technologies

• Enterprise Application Technologies– Enterprise Java Beans (EJB) 2.1– Java Connector Architecture (JCA) 1.5– Java Messaging Services (JMS) 1.1– Java Transaction API (JTA) 1.1

These technologies enable the implementation of the business tier in the JEE framework.

Page 128: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Enterprise Java Beans (EJB)

• What is EJB ?– EJB is a standard JEE technology developed by Sun

and the Java community– A component architecture for building distributed

applications.– A server side technology.– Usually used to implement the application’s

business logic.

Page 129: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Benefits of EJB

• Distributed components• Transaction management support• Security• Scalability and fail-over• Asynchronous• Persistence – object relational mapping.

Page 130: Web Sphere Administration guide – Packaging and Deploying Jee Applications

EJB Types

• Stateless Session beans• Stateful Session beans• Message driven beans – asynchronous, based

on JMS.• Entities – Java Persistence architecture (JPA).

Object-relational mapping.

Page 131: Web Sphere Administration guide – Packaging and Deploying Jee Applications

EJB Example

Page 132: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java Messaging Services (JMS)

• Messaging systems (MOM) provide– De-coupled communication – Asynchronous communication– Plays a role of centralized post office

• Benefits of Messaging systems– Flexible, Reliable, Scalable communication systems

• Point-to-Point, Publish and Subscribe• JMS defines standard Java APIs to messaging systems

Page 133: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java Connector Architecture (JCA)

• Defines standard API for integrating J2EE technology with EIS systems– CICS, SAP, PeopleSoft, etc.

• Before Connector architecture, each App server has to provide an proprietary adaptor for each EIS system– m (# of App servers) x n (# of EIS's) Adaptors

• With Connector architecture, same adaptor works with all JEE compliant containers– 1 (common to all App servers) x n (# of EIS's) Adaptors

Page 134: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java Transaction API

• The Java™ Transaction API (JTA) allows applications to perform distributed transactions, that is, transactions that access and update data on two or more networked computer resources.

• The JTA specifies standard Java interfaces between a transaction manager and the parties involved in a distributed transaction system: the application, the application server, and the resource manager that controls access to the shared resources affected by the transactions.

Page 135: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java Transaction API (JTA)

• A JTA transaction is controlled by the Java EE transaction manager.

• JEE support declarative transactions, called Container Managed Transactions.

• The JTA API can also be used directly by the developer.

• JTA supports XA transactions.

Page 136: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Servlets

• Java™ objects which extend the functionality of a HTTP server

• Dynamic contents generation• Better alternative to CGI, NSAPI, ISAPI, etc.

– Efficient– Platform and server independent– Session management– Java-based

Page 137: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Servlet Example

A Servlet receives an HTTP request performs an action and generate output,

Page 138: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java Server Pages (JSP)

• Enables separation of business logic from presentation– Presentation is in the form of HTML or XML/XSLT

– Business logic is implemented as Java Beans or custom tags

– Better maintainability, reusability

• Extensible via custom tags• Builds on Servlet technology (JSP is compiled into a

Servlet).

Page 139: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JSP Example

<%@ page import="java.util.*" %>

<HTML>

<BODY>

<% System.out.println( "Evaluating date now" );

Date date = new Date(); %>

Hello! The time is now <%= date %>

</BODY>

</HTML>

Page 140: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Web Services

• What is a Web Service ?– A web service is a software system identified by a

URI, whose public interfaces and bindings are defined and described using XML. Its definition can be discovered by other software systems. These systems may then interact with the Web service in a manner prescribed by its definition, using XML-based messages conveyed by Internet protocols.

Page 141: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Web Services

• Provide a way to connect heterogonous systems in a Language neutral, platform neutral manner.

• Use the HTTP protocol to pass messages in the SOAP protocol.

• Described by a Web Services Description language (WSDL) document.

• Vendors provide tools to generate web service clients from a WSDL.

• Web services can be registered and looked up in a UDDI directory.

Page 142: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Web Services Architecture

Page 143: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Web Services in JEE

• Web services are a platform neutral standard, JEE provides its own platform implementation.

• JEE provide tools for exposing JEE components such as EJBs as web services.

• JEE also provides tools for generating web service clients from existing WSDL documents and an API for accessing the services.

Page 144: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java Authentication and Authorizations Service (JAAS)• Pluggable authentication framework

– Userid/password– Smartcard– Kerberos– Biometric

• Application portability regardless of authentication schemes underneath– JAAS provides authentication scheme independent API– Authentication schemes are specified Login configuration

file, which will be read by JAAS

Page 145: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JAAS Pluggable Authentication

Page 146: Web Sphere Administration guide – Packaging and Deploying Jee Applications

JNDI

• Java Naming and Directory Interface• Utilized by J2EE applications to locate

resources and objects in portable fashion– Applications use symbolic names to find object

references to resources via JNDI– The symbolic names and object references have

to be configured by system administrator when the application is deployed.

Page 147: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java management Extensions (JMX)

• JMX technology provides a simple, standard way of managing resources such as applications, devices, and services.

• JMX is used to monitor and manage the JVM itself (the jconsole application is an example).

• In JEE JMX is used to manage server configuration and resources.

• All applications server vendors provide JMX beans, which manage their servers.

Page 148: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Java management Extensions (JMX)

Page 149: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Putting it All Together

Page 150: Web Sphere Administration guide – Packaging and Deploying Jee Applications

The App server and JEE containers.

Page 151: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Resources

• Info center for WAS 6.1 - http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp

• IBM Redbook – sg247304 WAS 6.1 System Management and configuration.

• Admin Console context sensitive online help.

Page 152: Web Sphere Administration guide – Packaging and Deploying Jee Applications

Copyright © Oded Nissan 2009

Summary

• WebSphere Overview• JEE Overview• WebSphere Architecture• Installing WebSphere• The Admin Console• Managing Applications• JEE Technologies