Installing SAP JCo
This section tells you how to install the SAP JCo library on Windows and UNIX. Redwood Platform installs the JCo automatically for you when you place the unzipped file (tgz for UNIX, ZIP for Windows) into the <install_dir>/j2ee/cluster/global/tomcat
directory. Note that you have to restart Redwood Platform for it to detect the changes.
Note: SAP Service marketplace zips the actual JCo archive; this means that for Linux on x86_64, for example, you have to unzip the file to get the tgz file. For Microsoft Windows, it is the same, except that the ZIP file you downloaded contains another ZIP file; this is the file you need to copy to the directory specified above. Windows users can use Windows Explorer to make sure they have the correct ZIP file which contains sapjco3.dll
at the root of the ZIP file.
SAP JCo Installation Files
sapjco3.jar
sapjco3.dll
- Windowslibsapjco3.so
- AIX, HP-UX on IA64 (Itanium), Linux
Prerequisites
- All Platforms
- SAP JCo 3.1 or higher
- You need the SAP JCo of the same platform as your JVM; a 32-bit JCo requires a 32-bit JVM, even on 64-bit platforms. Note that the use of 32-bit JVM's is not recommended on 64-bit platforms.
- JCo requires the Java Cryptographic Extension (JCE) Unlimited Strength Jurisdiction Policy Files; available for Oracle JVM's on Java SE Downloads. Note that SAP JVM's already have these installed.
- On Microsoft Windows platforms, JCo 3.1 requires the Microsoft Visual C++ 2013 redistributable libraries.
javac
(available in the Java JDK)- SAP Note 1456826 - The
jco.use_repository_roundtrip_optimization
property defaults to1
with JCo 3.1, its default is0
with JCo 3.0, hence if you are upgrading,RFC_METADATA_GET
authorizations are now mandatory.
Checking your JVM for Java Cryptographic Extension (JCE)
These instructions are provided for your convenience; the provided Java code is very trivial, for example, it has no error handling and is provided solely for checking for the JCE unlimited strength jurisdiction policy files.
Note: This program is not covered by your support contract, it is provided to help you ensure you have installed the necessary policy files correctly and that your JVM has picked them up properly; if this program fails in some manner, you should contact your JVM vendor.
Skipping the JCo Installation
If the JCO Libraries installation was skipped at some point, edit the registry entry /configuration/jco/skip
and set the value to false
before restarting the central server.
Prerequisites
javac
(available in the Java JDK)
Create the Program
You create a tiny trivial Java program to check for the JCE:
- Create a file named
testJCE.java
(It must have that name unless you want to change the code below). - Copy the below code into the
testJCE.java
file. - Compile the Java program:
javac testJCE.java
. - Execute the compiled program:
java -cp . testJCE
.
public class testJCE
{
public static void main (String[] args)
throws java.security.NoSuchAlgorithmException
{
int maxKeyLen = javax.crypto.Cipher.getMaxAllowedKeyLength("AES");
//without JCE, maxKeyLen is 128, with JCE, it is Integer.MAX_VALUE
if (maxKeyLen < 129)
{
System.out.println("No, you do not have the policy files installed!\n Maximum key length is set to: " + maxKeyLen);
}
else
{
System.out.println("Yes, you have the policy files installed!\n Maximum key length is set to: " + maxKeyLen);
}
}
}
The program should print the following when the policy files have been picked up by your JVM:
Yes, you have the policy files installed!
Maximum key length is set to: [...]
Procedure
Install SAP JCo
This procedure uses the capabilities of Redwood Platform to install SAP JCo.
- Go to service.sap.com/connectorsMore about SAP Java Connector and download the appropriate 3.1.x JCo file for your platform and unzip the file.
- On Windows, copy the file to
${install_dir}/j2ee/cluster/global/tomcat
, the file will be automatically extracted on startup. - On unix, extract the
sapjco3.jar
, as well as the librarylibsapjco3
, from the archive downloaded from SAP. The jar file must be copied into your CLASSPATH, for example the${install_dir}/j2ee/cluster/global/tomcat/lib
directory of your application server. The library needs to be copied into your library path, for example${JAVA_HOME}/bin
.
Note: Ensure that the library has met all its dependencies, use ldd
on most Unices. See SAP Note 2786882 for more information.
SAP JCo on Windows
- Go to Microsoft Download Center, download the file, and install it onto the server.
- Go to SAP ConnectorsMore about SAP Java Connector and download the appropriate 3.1.x JCo file for Windows on your platform and unzip the file.
- If the file you just unzipped is yet another ZIP file, unzip it once more.
- Copy
sapjco3.dll
to<install_dir>/j2ee/cluster/global/tomcat/lib/<platform>
and thesapjco3.jar
to<install_dir>/j2ee/cluster/global/tomcat/lib/
.
SAP JCo on AIX
- Go to service.sap.com/connectorsMore about SAP Java Connector > Tools and download the appropriate 3.1.x JCo file for AIX and unzip the file.
- Gunzip, and untar the downloaded file into a temporary directory.
- Place the
libsapjco3.so
into a directory referenced by theLIBPATH
environment variable; you set theLIBPATH
in the<install_dir>/j2ee/cluster/server1/bin/setvars.sh
. - Place the
sapjco3.jar
into the classpath of the application server, such as<install_dir>/j2ee/cluster/global/tomcat/lib
. - (Optional) You issue
ldd /path/to/libsapjco3.so
to check all dependencies are met.
Note: AIX 5.3 and later support both LIBPATH
and LD_LBRARY_PATH
.
SAP JCo on Other UNIX
These instructions cover HP-UX on IA64 (Itanium), Linux, and Solaris, the latter two on all platforms.
- Go to service.sap.com/connectorsMore about SAP Java Connector and download the appropriate 3.1.x JCo file for your platform and unzip the file.
- Gunzip, and untar the downloaded file into a temporary directory.
- Place the
libsapjco3.so
into a directory referenced by theLD_LIBRARY_PATH
environment variable; you set theLD_LIBRARY_PATH
in the<install_dir>/j2ee/cluster/server1/bin/setvars.sh
. - Place the
sapjco3.jar
into the classpath of the application server, such as<install_dir>/j2ee/cluster/global/tomcat/lib
. - (Optional) You issue
ldd /path/to/libsapjco3.so
to check all dependencies are met.
Troubleshooting
The following code will traverse all paths specified in java.library.path
and print all JCo libraries found. You can issue this in the web-based shell. Note that you might have to temporarily skip JCo initialization prior to executing the following code in the web-based shell ( "Scripting > Shell" ).
import java.io.File;
{
File[] fList;
File directory;
String[] dlist = System.getProperty("java.library.path").split(System.getProperty("path.separator"));
for (String dirName : dlist)
{
directory = new File(dirName);
fList = directory.listFiles();
if (fList != null)
{
for (File file : fList)
{
if (file != null && file.isFile() && file.getName().indexOf("jco") > -1)
{
jcsOut.println(file.getAbsolutePath());
}
}
}
}
}