You are on page 1of 19

J2EE Technology in SAP Web

Application Server

INTRODUCTIO
N
The SAP J2EE Engine is an integral component of the SAP Web
Application Server and implements the J2EE standard.
This J2EE standard has been defined by the Java Community according
to the rules of the Java Community Process and is copyright protected
by Sun Microsystems.
Since November 2002 SAP has been a member of the Executive
Committee of the Java Community.
The SAP J2EE Engine in the SAP Web Application Server SAP fulfils more
than just the J2EE standard - its functions stretch far beyond the
standard.
To make the conversion of larger software projects easier, SAP has
equipped the J2EE Engine with the following central developments:
SAP Java Connector (connects ABAP and JAVA)
Java Persistence (implementation of a database-independent
persistence layer)
Web Dynpro (front-end technology with far more functions

Integration
You can operate the SAP J2EE Engine solely for J2EE applications or together with the ABAP Engine in the SAP Web AS.

J2EE Cluster Architecture

J2EE cluster consists of:


A (central) J2EE instance with a dispatcher, three server processes, and the Software Deployment
Manager (SDM)
The Central Services, which also create an instance
The Database

Architecture of the SAP Web AS ABAP and JA

J2EE Instance
Definition
A J2EE instance is a unit in the J2EE cluster, which can be started,
stopped, and monitored separately. It runs on a physical server; but it is
also possible to run several instances on one server. An instance is
identified by the system ID (SID) and the instance number.

Structure
A J2EE instance contains at least one Server Process.
Normally it comprises one J2EE Dispatcher and several server
processes.
A J2EE instance is started and stopped by the J2EE Startup and
Control Framework.

Cont..
The J2EE dispatcher receives the request, selects a server process for the processing and
establishes the connection from the client to the server.

Example

An HTTP request that wants to execute a servlet, runs the following layers in the J2EE engine.
The J2EE dispatcher receives the request, selects a server process for the processing and
establishes the connection from the client to the server.

J2EE Dispatcher
Definition
The J2EE dispatcher receives the client request and forwards it to the server process with the
lowest capacity usage.
If there is already a connection to the client, the request goes to the server process that
processes this client.

Use
If a request arrives at the dispatcher for the first time, it is received by the connection
request handler. The connection request handler deals with the following tasks:

It initializes a connection object, which from now on is assigned to this connection.


The client then has a connection to the connection manager for all
subsequent
requests.

It asks the load balancer which server is going to process this client. A weighted
round-robin.

From now the client is connected to the connection manager.

All subsequent requests from this client are sent to the same server.

The communication handler accepts the data and passes it to the Server Process.

Structure
The dispatcher contains the following components.
The connection request handler receives the first request from a client.
From this time point on, the client has a fixed connection to the dispatcher.
The connection manager manages the existing connections to the clients.
The session level services are services that are assigned to a session.
The communication handler forwards the request to the server process.
Accumulating requests are stored in the request queue.
The graphic below shows the structure of the dispatcher.

Server Process
Definition
The server processes of the J2EE Engine actually execute the J2EE
application. Each server process is multi-threaded, and can therefore
process a large number of requests simultaneously. J2EE Dispatcher
assigns requests to the server processes.
Structure
The server process consists of the following components: Some of these
are the same as in the Dispatcher.
Communication handler
Session level services
Application-level services or the actual application program.

Central Services
Definition
The Central Services run on one physical server and are one J2EE
instance.
They
Use comprise the Message Service and the Enqueue Service.
The Central Services form the basis of communication and
synchronization for the J2EE cluster.
The Message Service keeps a list of J2EE dispatchers and J2EE server
processes of the
cluster. It represents the infrastructure for data
exchange (small datasets only) between the participating nodes. The
Message Service also supplies information to the SAP Web Dispatcher
about Load Balancing Between Many J2EE Instances.
The Enqueue Service manages logical database locks, which are set
by the executed application program in a J2EE server process. The
Enqueue Service also synchronizes data across the cluster.
Integration
Central Services are always required when a J2EE cluster is installed.
They are started on a server with their own system number and the
system ID (SID) of the whole system.
When Central Services are running, further J2EE instances are started
with the program JControl

SAP JAVA THREE TIER


ARCHITECTURE

JAVA STARTUP AND CONTROL FRAMEWORK


Definition
The Java startup and control framework comprises the programs JControl and Jlaunch. JLaunch
is started by JControl and itself starts the bootstrap Java program or an element of the Java
cluster (dispatcher or server process).

The framework consists of the following components:


JControl starts, stops, and monitors the processes of a Java instance (usually a dispatcher
and several server processes). The program implements the SAP signal handling to stop the
instance. JControl starts the JLaunch processes.
JLaunch starts a Java program. It loads the JVM into its own address space and then
represents the required cluster element. The program can receive from notification from the
JControl process via named pipes to stop the cluster element, and terminates, if the JControl
stops running (fork emulation under Windows).
The Bootstrap JAVA program synchronizes the binary data from the Java database with the
local file system and creates a property file, which describes the processes of the Java
instance.

SAP JAVA STACK STARTUP BEHAVIOUR


1. Startup of JAVA system is controlled by a so-called startup
framework
2. Parent process JControl is called when you start SAP from
MMC in Windows or

startsap script in Unix environment

3. JControl first connects to Message Server and starts the Signal


Handling.
4. Then JControl starts up an instance bootstrap which connects to
the database and update the instance. properties file for the
instance to be started in the file system.
5. JControl then starts a bootstrap for every process of the
instance; these processes, in turn, connect to the database and
update the data in the file system.
6. Using this updated data, the actual processes of the java system
are started. These processes are referred to as JLaunch

SAP JAVA STARTUP


FRAMEWORK

eveloper Trace and Log Files


The trace and log messages of the Java startup and control framework
contain important information about the startup process. In case of errors
or misbehavior it will be helpful if you check and analyze them.
The developer trace and log files are located in the
/usr/sap/<SID>/<INSTANCE NAME>/work directory, where <SID> is the
system ID of the cluster and <INSTANCE NAME> is the instance name of
the J2EE instance
Note - In case of a Java-only installation, the instance name consists of a
prefix (JC or J) and the two-digit instance number afterwards.

dev_jcontrol
The trace file of the JControl process.
JControl is responsible for starting, stopping and controlling the
processes of the J2EE instance.
Use the dev_jcontrol trace file when you have problems starting or
stopping the whole J2EE instance.

Cont..
dev_<component name>
The trace file of the corresponding JLaunch process (the <component
name> can be bootstrap, bootstrap_<cluster_element_ID>, dispatcher,
server<n>, sdm, jcmon, or icm). For example, the trace file for the
bootstrap process is dev_bootstrap.

std_<component name>.out
The standard and error output file of the corresponding JLaunch process
(the <component name> can be bootstrap,
bootstrap_<cluster_element_ID>, dispatcher, server<n>, sdm, or icm). For
example, the output file for the bootstrap process is std_bootstrap.out.
Output and error messages from the Java VM are written to this file.

jvm_<component name>.out
The standard and error output file of the JVM running the corresponding
JLaunch process (the <component name> can be bootstrap,
bootstrap_<cluster_element_ID>, dispatcher, server<n>, sdm, or icm). For
example, the output file for the JVM running the bootstrap process is
jvm_bootstrap.out.

SAP JAVA MEMORY


MANAGEMENT
Area

Description

Parameter for
the size at
process start

Parameter for
the
maximum size

Area in which new


objects are stored

NewSize

Tenured

Area in which objects


which have survived
are relocated

Define through Define through


NewSize * New MaxNewSize *
Ratio
New Ratio

Heap

Young+Tenured

Xms

Zmx

Perm

Area in which classes


and methods are
stored

PermSize

MaxPermSize

Young

MaxNewSize

Cont..

THANK YOU

You might also like