2

When I invoke the SAP JCo Adapter, I'm getting an error message like this:

Invocation of procedure 'invokeSAPFunction' caused java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO$Exception [project DemoProject].

What can cause it?

function invokeSAPFunction(params) {
var input = {};
input.FunctionName = params.FunctionName || "";
input.Imports = params.Imports || {};
return WL.Server.invokeSAPFunction(input);
}

I'm passing parameter as a JSON object i.e.

 {"FunctionName" : "Example BAPI function ", "Imports" : {"COMPANYID":"ID"}}

Here function name is my BAPI which is created in SAP system

<?xml version="1.0" encoding="UTF-8"?>
<wl:adapter name="SAPJCoExample"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:wl="http://www.ibm.com/mfp/integration"   
    xmlns:sapjco="http://www.ibm.com/mfp/integration/sap">

    <displayName>SAPJCoExample</displayName>
    <description>SAPJCoExample</description>
    <connectivity>
        <connectionPolicy xsi:type="sapjco:JCOConnectionPolicy" 
            jcoClientClient="800" 
            jcoClientUser="USERNAME"
            jcoClientPasswd="PASSWORD" 
            jcoClientLang="EN" 
            jcoClientAsHost="hostname" 
            jcoClientSysnr="00"
            maxConnections="10" />              
    </connectivity>
    <procedure name="invokeSAPFunction"/>
</wl:adapter>
Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48

2 Answers2

1

That error indicates that you have not installed the SAP JCO libraries correctly on your MFP server.

chrisjaun
  • 81
  • 2
  • I have placed libsapjco3.jnilib and sapjco3.jar in lib directory and jar file is part of class file. I was able to call SAP from Java Adapter but not from JCo adapter under same settings. It would be great if you can provide some update or some more details about how to install libraries. – Mohammad Feb 08 '16 at 02:49
1

Like Chris Jaun mentioned, this is an error that you'll receive if you haven't setup your machine correctly to work with JCo Adapters. Make sure the following criteria is met with your current setup:

  1. The jre directory should be your java runtime environment

  2. your jre must be 32-bit to work with the jco jar and dlls (in my experience, I've only gotten the adapters to work with the 32-bit version)

  3. librfc32.dll is in C:/Windows/System32

  4. sapjco-*.*.*.jar is in \jre\lib\ext

  5. sapjcorfc.dll is in \jre\bin

Machavity
  • 30,841
  • 27
  • 92
  • 100