2
votes

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"/>

2
provide your project - Idan Adar
@IdanAdar I provided my adapter code. - Vinod Kumar Marupu
I don't think that's enough. Is there something testable you can provide? - Idan Adar
@IdanAdar I provided my complete adapter code. - Vinod Kumar Marupu
Did you resolve this? - Idan Adar

2 Answers

1
votes

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

1
votes

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