How to configure JobServer to execute Jobs with SAP components on Linux

Problem Description

Your Job needs libsapjco3.so and sapjco3.jar to be executed within Studio, the same libraries must be accessible by your JobServer, or any SAP Job execution fails with the following error message:

java.lang.UnsatisfiedLinkError: no sapjco3 in java.library.path

 

Solution

  1. Create a folder, in this case, /opt/utils/sap_jco_connector.
    • This folder must be accessible to the JobServer so be sure that the Linux user used to start your JobServer can access these files! The easiest way is to create the folder on the Linux machine hosting the JobServer. However, you can also use a network shared folder.
  2. Add the libsapjco3.so and sapjco3.jar files to that folder.
  3. Modify the environment variables by adding the folder to the variable LD_LIBRARY_PATH and the sapjco3.jar in the CLASSPATH. For more information on environment variables, refer to your Linux and shell documentation.

Temporary or testing workaround

Each time you start the JobServer, perform the following steps:

  1. Open a terminal.
  2. Connect with the correct user.
  3. On the terminal enter the following commands:
    export LD_LIBRARY_PATH=/opt/utils/sap_jco_connector:$LD_LIBRARY_PATH
    export CLASSPATH=/opt/utils/sap_jco_connector/sapjco3.jar:$CLASSPATH
  4. Start the JobServer and test the execution of your Job.

 

Starting JobServer manually

To avoid using the Temporary workaround above each time you want to start you JobServer, add the variable definitions to the user .bashrc script.

  1. Edit .bashrc, and at the end of the file (or modify the existing lines), add the following:
    LD_LIBRARY_PATH=/opt/utils/sap_jco_connector
    CLASSPATH=/opt/utils/sap_jco_connector/sapjco3.jar
    export LD_LIBRARY_PATH
    export CLASSPATH
  2. Start the JobServer.

 

Starting JobServer as a service

The .bashrc script is not taken into account when starting the JobServer as a service (and the service definition uses this user to start the JobServer). The easiest solution is to add the variable definitions in the service itself.

  1. As Root, make a copy of your service file. In this case, the environment file is /etc/systemd/system/talend-rjs-6.4.1.service.
  2. As Root, open the file and add the two variables before the JAVA_HOME line, as shown below:
    #ADDED FOR SAP Connection
    LD_LIBRARY_PATH=/opt/utils/sap_jco_connector:$LD_LIBRARY_PATH
    CLASSPATH=/opt/utils/sap_jco_connector/sapjco3.jar:$CLASSPATH
    export LD_LIBRARY_PATH
    export CLASSPATH
  3. Restart the JobServer service.
Version history
Revision #:
11 of 11
Last update:
‎06-13-2019 10:07 PM
Updated by: