CONTENTS   NextPrevious  



Configuration of Additional Libraries

SAP J2EE Engine 6.20 functions – both basic and additional – are provided by a set of services and libraries. The libraries are separated into three groups, and the JAR files are located in three subdirectories of SAP J2EE Engine 6.20 cluster nodes installation directories: system-lib , lib , and additional-lib . This task describes the specific functions each group provides, and explains how to add JAR files to each group (if required).

Additional libraries required to run a certain application can be added at deploy time using SAP J2EE Engine 6.20 Deploy Tool. For further information, refer to the Deployment  Manual .

System-Lib

This directory contains JAR files that are used by the system for unification of system functions when different versions of Java Development Kit (JDK) are used. You are not supposed to add any JAR files to the ones available in this directory.

Lib

The JAR files in this directory refer to SAP J2EE Engine 6.20 kernel functions –that is, they represent system core modules.

When a new JAR is added, the system classloader detects it and loads its classes at startup.  You do not have to set any references to this JAR. The corresponding cluster node has to be restarted to load the classes in the additional JAR.

Additional-Lib

All libraries that are to be used from more than one application must be put into this directory, and then references must be set to them.

Note : If a certain library is to be used by just one application, it is recommended you put its JAR directly into the application EAR for deployment. This way, no references need be set.

This directory contains JAR files that provide SAP J2EE Engine 6.20 additional functions. You can add JAR files and set references to them. To activate the changes, you can restart only the services that have references to the new module(s) – that is, it is not necessary to restart the whole system or the cluster node.

The libraries from the additional-lib directory are described in library.txt file, which is located in …/managers/ directory. When a library is added to the directory, the library.txt file is updated with the new entry.

The libraries that are included by default in the additional-lib directory are used by SAP J2EE Engine services and are vital for the proper functioning of the application server. These standard libraries and the references between them are defined in default-library.txt , located in ../server/managers/settings directory . The libraries are loaded at server startup and are used by both core and additional services.

Note 1: It is recommended that you avoid editing default-library.txt . If editing proves to be necessary (for example, when different libraries should be used for various OS), the file must be edited manually on each cluster node, which may lead to inconsistency. Furthermore, the files that are listed in default-library.txt must only be changed using the tools provided for upgrading and patching of the versions.

Note 2: default-library.txt is not available in older server versions. To run a server component from an older version within a cluster in which default-library.txt is available, copy the file in the ../server/managers/settings directory of the server element from the older version.

Adding a New JAR to the Set of Libraries

A new JAR is added to the set of libraries by copying it into the additional-lib folder, or its subfolders. You must then modify the library.txt  file placed in the corresponding managers directory. A new library line has to be added to the text file to indicate that a new JAR is added to additional-lib directory. A new reference  line must then be added, if this library has a reference link to another one. The syntax of this file is as follows:

library jsse jsse.jar

reference jsse jnet

This example illustrates the adding of jsse.jar , named jsse , which has a single reference to jnet library. Jnet must be also defined in library.txt :

library jnet jnet.jar

JAR names must be specified as a relative path from the additional-lib folder.

A reference between jsee and jnet now means that jsee.jar uses classes from jnet.jar .

Multiple libraries can be organized under one name. For example:

library majorLib lib1.jar;lib2.jar;…libN.jar

This avoids having to set references among all libraries. In the example above, majorlib is loaded with a single classloader, which provides for their usage as a common entity – for example, each of the libraries can use classes from any other library.

Note: Supported separators are semi-colon (;) and space.

Except for JAR files, directories with classes can also be set as a library. The absolute path to the directory must be specified using “!” before the path denoting it is a directory. For example:

library classes !C:\myClasses

Console Administrator

New libraries can be added to the additional-lib directory using the CHANGELIB command from the DEPLOY command group. For details on its parameter and usage, refer to Shell Commands Reference section in this manual.

Note: You can specify a subdirectory of additional-lib and locate the libraries you deploy there. This might be necessary, for example, to avoid collisions when you have deployed various applications that use different versions of a particular library. If you specify a non-existing directory, it is created automatically. You can change the name of the JAR files.

Deploy Tool

To add libraries, you can also use Deploy Tool provided with SAP J2EE Engine 6.20. For more information, refer to the Deployment  Manual .

Setting References from Service to Services or Libraries

You can set references from a service to another service, or from a service to a library. When an extra service or library is installed on SAP J2EE Engine 6.20, you can set a reference to it. This task can be performed either using the Visual Administrator tool or provider.xml  file of the corresponding service. Note that a reference to a service or a library must be set explicitly for each service – that is, a service or library cannot be referenced by another service unless it is specified in the provider.xml file of this service.

Visual Administrator

Reference to a service or library can be set by choosing the Control Descriptor ® Distribute tab of the corresponding service in Visual Administrator. The “Service References” pane enables you to add, remove, and edit references.

Provider.xml File

You can set a reference to a service or library using the provider.xml  file of each service. You must add the following field to the list of available references:

<reference type="ReferenceType" strength="ReferenceStrength">
ReferenceName
</reference>

The “ReferenceType” can be service or library . The value of the “ReferenceStrength” element can be weak or hard .

Note: If a reference to other resources (services and libraries) is added in Servlets_jsp Service, the classpath to the specified JAR must be added in the ServletCompilerClassPath property. It is used to find external resources that are used by JSPs at compilation time. After changing the classpath, Servlet_jsp Service must be restarted.

Adding a Reference from a Deployed Application to a Service or Library

If an application deployed on SAP J2EE Engine 6.20 uses resources from outside the application EAR, it must set references to them to work properly. Resources can be either SAP J2EE Engine 6.20 services or additional libraries (JAR files that are not included inside the application)

Referring to a JAR, instead of including it inside the application, has several advantages:

To add a reference to a service or JAR file that to be used by an application deployed on SAP J2EE Engine 6.20, you must modify the reference.txt file, located in the <SAPj2eeEngine_install_dir>cluster/server/managers directory. The structure of reference.txt is simple. Consider the following example:

reference petstore library:ejb
reference petstore service:ejb
reference petstore service:security
reference petstore service:servlet_jsp

To add another reference, just add a new line to the text file, specifying the type of reference ( service or library ), and the name of the service or library. Each service must match exactly the name of the corresponding service in the server namespace. Each library must be already specified in library.txt . The name of the application must be specified, as deployed in the server namespace (for example, petstore ). All names are case sensitive. If an application uses an XML file, a reference must be added to the inqmyxml.jar file, or to another available XML parser.

Console Administrator

This task can be also performed using the CHANGEREF command from the DEPLOY Shell commands group. For details on its parameters and usage, refer to the Shell Commands Reference section of this manual.

Deploy Tool

To add or modify references to libraries, you can also use Deploy Tool provided with SAP J2EE Engine 6.20. For more information, refer to the Deployment  Manual .

Previous  Next