Scripting-Function Module Jar-Cache changes .jar filenames

Hi everyone,

i am currently developing a module based on the scripting-function project from the sdk-examples. I include the sapjco-3.1.11.jar in the modl build and create the following method to load jco classes:

 @ScriptFunction(docBundlePrefix = "AbstractScriptModule")
    public Class<?> loadJcoClass(
            @ScriptArg("classPath") String classPath) throws ClassNotFoundException {

        return Class.forName("com.sap.conn.jco." + classPath);
    }

I can create the classes like this:

AbapException = system.example.loadJcoClass("AbapException")

This works out well but when i try to use these classes i get this error:

java.lang.ExceptionInInitializerError: java.lang.ExceptionInInitializerError: JCo initialization failed with java.lang.ExceptionInInitializerError: Illegal JCo archive "__3959807480__sapjco-3.1.11.jar". It is not allowed to rename or repackage the original archive "sapjco3.jar".

This happens because SAP does not allow to change the original jar filename but when i install the module to my Gateway the jars from the modl are stored in the jar-cache folder and receive a prefix to their name which leads to the error.

Any ideas to fix this?

@GeraldB