You are on page 1of 10

Java EE in SAP Technology

The use of Java EE in SAP technology has the following advantages for SAP NetWeaver
Application Server:

 The open integration architecture SAP NetWeaver integrates perfectly into the openness
of Java EE.
 Java EE is further proof of the strategy of platform-independence pursued by SAP.
 The Java EE Connector architecture allows standardized integration of
external applications.
 Web Services technologies are supported directly by Java.
 The quickly-growing Java community provides simple access to experienced developers.

Terms in SAP Web AS Java


If you are new to SAP Web AS Java, these are the familiar terms that being used.

Java is an object-oriented and platform-independent programming language that has


spread across many areas.
Java Runtime Environment is an independent platform environment to run Java program
Java Programs consist of application and applet. Java applications are computer programs
with the full functional range also provided by other programming languages. The term
applet essentially means “little application”. It usually means a Java applet, a small
computer program that runs in a Web browser and is written in the Java programming
language.
Java virtual machine is a model of a processor (which often does not exist as real
hardware) and the associated system architecture. It is a computer program that emulates

a processor. see graphic below.


A Java Development Kit (JDK) is required to write platform-independent Java programs.
The Java Development Kit includes the software required to create and test Java
applications and applets, the packages with the Java classes that are part of the basic
configuration, and the online documentation
Java Standard Edition (Java SE). The standard edition is the normal
software environment and defines the Java™ SE Development Kit (JDK). This includes the
Java SE Runtime Environment (JRE).
Java Enterprise Edition (Java EE). The enterprise edition builds on the JDK and
integrates additional packages such as Enterprise JavaBeans (EJB), servlets, JavaServer
Pages (JSP), Java Mail API, and Java Transaction Service (JTS). The Java EE SDK (Software
Development Kit) includes the Sun Java System Application Server and requires a JDK.
Java Micro Edition (Java ME). The micro edition is a small runtime environment for small
devices such as Personal Digital Assistants (PDAs) or telephones.
Enterprise Java Beans is a package of application logic components in accordance with
Java EE specification.
EJB Container is a location to execute Enterprise Java Beans which is part of Java EE
application server.
Web Container is a part of Java EE Application Server which Java Server Pages and Java
servlets are executed in.
Java Server Pages (JSP) are a technology developed by Sun, which essentially allow the
simple dynamic generation of HTML and XML output for a Web server.

SAP Java Component Deployment


– Offline
During SAP Dual Stack (ABAP & Java) maintenance, sometime it is necessary to update one
of Java component. If you are unlucky then you could stuck in the middle of update. This
can be serious problem if you dont know what the process is. I recommend you to always
backup your directory instead of the DB because in SAP Web AS Java the Java program will
reside in the filesystem. Below are one of the command to update Java component offline
(this is needed if you stuck on upgrading the component)

GO to /usr/sap/<SID>/DVEBMGS00/j2ee/cluster/bootstrap/scripts
as sidadm 99> ./batchdeployer.csh -sdu /usr/sap/trans/EPS/in/ENGINEAPI10_0-
20002603.SCA
ENGINEAPI and SERVERCORE must be in the same level (queue) to deploy
Note : Please be careful if you want to run this command.

Error when openning service in


Visual Administrator
In some case, this picture is shown when you try to open service in cluster -> server ->
service (for example SLD Data Supplier)

SLD Data Supplier error

If you open OSS Notes 1017526, you can only find general cause which somehow a little bit
confusing, which state : For SAP J2EE Engine SP15 (NW04), add the Java option “-
DP4ClassLoad=P4Connection” in the “go” script and make sure the J2EE Application
“com.sap.engine.class.download” is started .
To solve this problem you need to copy sldserv.jar file
from/usr/sap/<SID>/<InstID>/j2ee/cluster/server<x>/bin/services/sld/to usr/sap/<SID>/
<InstID>/j2ee/admin/lib/
You may try to look for the other services under /bin/services folder and move it to
admin/lib. good luck.

IAIK Security library not found!


Problem : When I open key storage service in Visual Admin I got an error.
SID -> Server -> Service -> Key Storage.
Error :
“IAIK Security library not found!”
“java.lang.NoClassDefFoundError: iaik/security/provider/IAIK”
Solution :
Copy the iaik_jce.jar or iaik_jce_export.jar from the SCS
Instance \\\SAPMNT\\SYS\global\security\lib\tools\iaik_jce.jar to your CI
directory \usr\sap\\JC\j2ee\admin\lib

SAPJSF User is Getting Locked?


You might have experienced this problem before. This is a known problem if you have a
system with AS Java add in or dual stack installed in your system. SAPJSF is a
communication user used by User Management Engine service to connect to ABAP service.
In the ABAP system, you see that user SAPJSF is getting locked, for example from User
Information (transaction code : SUIM). There are several issues known cause SAPJSF user
is locked based on my experience:

 Password in the UME configuration is different with in ABAP User Data.


 Role for user SAPJSF in ABAP system is not set correctly.
 User type in ABAP system is not set correctly
To check your password configuration in UME service, you can go to configtool :
– Switch to configuration editor mode.

– Switch to change mode

-Go to Configuration –> cluster_data –> server -> cfg -> services
-Click on Propertysheet com.sap.security.core.ume.service
-Change the password in ume.r3.connection.master.passwd
Make sure that this password configuration is defined also in ABAP system (transaction
SU01).
In general there are two roles which should be assigned in SAPJSF user in ABAP system
depends on the configuration. Those are :
– SAP_BC_JSF_COMMUNICATION_RO
– SAP_BC_JSF_COMMUNICATION
And make sure that you generate profile for those roles and assigned correctly to user
SAPJSF.
By default , SAPJSF is set to service user type.

Other Glossary in Web AS Java


Java Cluster consists of all Java components in SAP system like Java instance, Central
Services and database. Minimal Cluster installation contains one Java instance ( Java
dispatcher, server process, and SDM), one Central Services (Enqueue Server, Message
Server) and database (Java Schema).
Java dispatcher has function like ABAP dispatcher which receives requests from client, it
will then select free server process(es) to handle those requests. The dispatcher distributed
new coming requests using ’round robin’ algorithm.
Server process runs a Java application. Every request from dispatcher will be processed
here by system or application thread. The server processes are implemented as multi-
threaded servers , therefore it can process multiple requests in parallel.
Central Services run on one host and form a separate Java instance. They consist os
message service and enqueue services. Both message service and enqueue services has
been described in my previous post. The Central Services is essentially required when a
Java cluster is installed.

Web AS Java Architecture


Web Application Server Java (Web AS Java) components are displayed in picture below:

A typical installation has a central instance (CI), a central service instance (SCS), a Java
instance, and a database. The CI is identified by its dispatcher, a server, and Software
Deployment Manager (SDM). Java instance can also has dispatcher and one or more server
processes but not the SDM. Note that Central Instance, Central Service Instance and Java
Instance can be installed on different machine, and these supports High availability and
scalability. Central Service Instance contains message service and enqueue service installed
together in one machine.

May be some of you getting confused about the name which used here. So here’s the
description about Web AS Java :

Java Instance : Java instance contains one dispatcher and one or more server
processses. Sever processes can be defined depends on the memory available since these
processes will consume a memory once it’s started. These java intances can be installed on
one or distributed across multiple hosts which is known as the central or distributed
installation.
Message Service : message server is a program in OS level which will be used for
communicating between Java cluster such as dispatcher and server processes. It will
maintain all dispatcher and server process nodes that are running on J2EE engine, provide
information for Web dispatcher for load balancing, notify the other nodes if some nodes are
up or down.
Enqueue Server : enqueue server is responsible for maintaining the locks for all objects
which is used by Portal application, component and services. One different with enqueue
service in ABAP system is used by Portal application, component and services. One different
with enqueue service in ABAP system is that in Java system also synchronize data in the
Java cluster.

Important Log Files for Portal Application


If you run a Portal application based on SAP Web AS, you may find an error on your running
process. Mostly the errors are logged into a log files of Java server process. A Portal
application usually identified by prefix http://<hostname&gt;:<port>/irj/… Here’s the
important log files location :
1. <drive>:\usr\sap\<SID>\DVEBMGS<inst_no>\j2ee\
cluster\serverX\log\defaultTrace.xx.trc
2. <drive>:\usr\sap\<SID>\DVEBMGS<inst_no>\j2ee\
cluster\serverX\log\applications.x.log

X: server process number, start from 0,1,2 .. X


xx:default trace number which will be overwritten between 0-19 by default. the most
updated can be displayed with the latest timestamp in OS.

The thing is not all people can read what is inside the log files since this is generated
roughly from Java process, but those texts are very helpful to predict the portal application.
The logs also display some Java class which is used by application. for example :

#1.5#001185E9BA0D0090000031F90000524C00046B19DB1815A0#1243658700982#com.
sapportals.wcm.repository.manager.cm.persistence.BasicPersistenceDB#sap.com/irj#com.s
apportals.wcm.repository.manager.cm.persistence.BasicPersistenceDB#J2EE_GUEST#0#SA
PJ2EE Engine JTA Transaction :
[0384ffffffd20071ffffffb2]#n/a##0ff0c3b04a1111deb8c3001185e9ba0d#Thread[ThreadPool
.Worker1,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Error##Plain###Excep
tion occured during garbage
collection: com.sapportals.wcm.repository.manager.cm.persistence.PersistenceException:
SQLException: Cannot change transaction isolation during distributed transaction and when
the connection is shared. DataSource name: “SAPSR3DB”, current isolation level is
“TRANSACTION_READ_UNCOMMITTED”, new isolation level is
“TRANSACTION_READ_COMMITTED”.#

Yes, of course you need to practice how to solve the issue. There will be a hundreds or even

a thousands of variation of the error. Well , prepare your time to learn then

Procedure to unlock J2EE Admin using SAP*


1. Open ConfigTool which is located in
<drive>:\usr\sap\SID\JC05\j2ee\configtool\configtool.bat, for Unix you can run
./configtool.sh
2. Switch to configuration editor mode.
3. Go to cluster_data -> server -> cfg -> services.

4. Switch to edit mode by pressing pencil button.


5. Click on Propertysheet com.sap.security.core.ume.service
6. Change ume.superadmin.activate to TRUE.
7. Define the SAP* password in ume.superadmin.password.

8. Restart Web AS Java.


9. Login to visual admin.
10. Go to service -> security provider. Open tab User Management.
11. Find user administrator then press unlock button and define the new password for
administrator user.
12. Then repeat step 1-4, change ume.superadmin.activate to TRUE FALSE.
13. Restart Web AS Java again.
14. Now you can login to Web AS Java page using administrator user.

Unlock Java Administrator using SAP*


Java Engine UME (User Management Engine) can be stored in Data Source which are
located either in SAP System data source, UME Database or Directory Service Data Source.
They have different scenario of user administration, those are :

1. J2EE_ADMIN for SAP Web AS with ABAP and Java


2. J2EE_ADM_<SID> for SAP Web AS Java (UME uses ABAP user administration)
3. Administrator for SAP Web AS Java (UME uses a database or directory service for user
administration)
As they are user administrator for its scenario, what will happen if this user is locked by
wrong password entered? Depends on the scenario, as I know there are two ways also to
unlock this user:

1. UME uses ABAP user administration, user J2EE_ADMIN or J2EE_ADM_<SID> can be


unlocked using SU01 in ABAP System.
2. UME uses database or service for user administration, user administrator can be
unlocked by user like SAP*. But we have to activate SAP* first to do this.

How to change SDM password ?


Question : How to change SDM password ?

Answer : If you forgot your SDM password, you can change it in two options,

1. Go to folder <drive>:\usr\sap\<SID>\JC<Sys No>\SDM\program, then run in the


command prompt below:
sdm jstartup “mode=standalone”
sdm changepassword “newpassword=<newpassword>”
sdm jstartup “mode=integrated”
StartServer.bat or ./StartServer.sh (in Unix)
2. Go to: C:/usr/sap/<SID>/JC<Sys No>/SDM/program/config/sdmrepository.sdc
Please backup this file before you change anything.
Change line between <HashedPassword> and </HashedPassword>, for example below
is the password for sdm:
<HashedPassword>
yPLDEBe3oOb6H2mmjJ0zztOgw/A=
</HashedPassword>
Info :
SDM is Sofware Deployment Manager which is used to deploy/undeploy software component
in Web AS Java, like Java Engine component and some Java Portal component.

You might also like