Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: [SOLVED] SAP on OS X error: UnsatisfiedLinkError: no sapjco3 in java.library.path

  1. #1

    Default [SOLVED] SAP on OS X error: UnsatisfiedLinkError: no sapjco3 in java.library.path

    I want to share this solution to an issue I was having.


    I'm evaluating the migration of a old big ETL process from Talend to PDI, this process extracts data from SAP and stores it to SQL, so I just downloaded the latest PDI stable release and started to do some proof of concepts, but I got stuck in this ugly error some hours:

    Code:
    Unable to connect to the SAP ERP server: 
    Possibly the SAP JCo implementation library (e.g. sapjco3.dll) does not exist or cannot be loaded. Please copy it to your libext directory! If you use version 3.0.5 or higher on Windows be sure to have MS Visual C++ 2005 SP1 Redistributable Package ATL Security Update installed.
    
    
    org.pentaho.di.trans.steps.sapinput.sap.SAPException: 
    Possibly the SAP JCo implementation library (e.g. sapjco3.dll) does not exist or cannot be loaded. Please copy it to your libext directory! If you use version 3.0.5 or higher on Windows be sure to have MS Visual C++ 2005 SP1 Redistributable Package ATL Security Update installed.
    
    
        at org.pentaho.di.trans.steps.sapinput.sap.impl.SAPConnectionImpl.open(SAPConnectionImpl.java:144)
        at org.pentaho.di.trans.steps.sapinput.sap.impl.SAPConnectionImpl.open(SAPConnectionImpl.java:88)
        at org.pentaho.di.trans.steps.sapinput.sap.impl.SAPConnectionImpl.open(SAPConnectionImpl.java:65)
        at org.pentaho.di.trans.steps.sapinput.sap.SAPConnectionFactory.getConnectionTestReport(SAPConnectionFactory.java:61)
        at org.pentaho.di.core.database.DatabaseMeta.testConnection(DatabaseMeta.java:2464)
        at org.pentaho.ui.database.event.DataHandler.testDatabaseConnection(DataHandler.java:533)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    I googled a lot about this but I couldn't find a solution, I tried adding the DYLD_LIBRARY_PATH enviroment variable, copying the libsapjcolib.jnilib to the libswt/osx64 and writing to mattcasters on twitter in a desperate effort (sorry about that) but nothing worked.
    So after too much debugging and testing, the solution was quite simple.

    First, I set the DYLD_LIBRARY_PATH enviroment variable following the install instructions from the SAP JCo.
    Then I just modified the spoon.sh adding the following lines at the end of the "Darwin" case "LIBPATH=$LIBPATH:$DYLD_LIBRARY_PATH" (see code):
    Code:
    Darwin)
        ARCH=`uname -m`
            OPT="-XstartOnFirstThread $OPT"
            case $ARCH in
                    x86_64)
                            if $($_PENTAHO_JAVA -version 2>&1 | grep "64-Bit" > /dev/null )
                                then
                              LIBPATH=$BASEDIR/../libswt/osx64/
                                else
                              LIBPATH=$BASEDIR/../libswt/osx/
                                fi
                            ;;
    
    
                    i[3-6]86)
                            LIBPATH=$BASEDIR/../libswt/osx/
                            ;;
    
    
                    *)
                            echo "I'm sorry, this Mac platform [$ARCH] is not yet supported!"
                            echo "Please try starting using 'Data Integration 32-bit' or"
                            echo "'Data Integration 64-bit' as appropriate."
                            exit
                            ;;
            esac
           
           #THIS IS TO FIX THE cannot load library error from SAP JCo
            LIBPATH=$LIBPATH:$DYLD_LIBRARY_PATH
            ;;
    And now it works like a charm.

    PD:
    The app files doesn't work on my Mac (don't know why), so that's why I'm using the spoon.sh launcher.

    Hope this will be helpful for someone.

  2. #2
    Join Date
    Nov 1999
    Posts
    459

    Default

    Thanks a lot for sharing this!

    I added this information into our Wiki: http://wiki.pentaho.com/display/EAI/SAP+Input

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.