How to use SAP JCo in Domino as an alternative to the Lotus Connector for SAP

Years ago I had to connect to SAP from within a Notes web application. I used the Lotus Connector for SAP solutions for it, but I wasn’t really happy with it.

One reason was that the “in between” code was written by another person and I didn’t quite understand what was going on. It was more or less a black box and I was loosing days figuring out what went wrong if reading or writing data didn’t work.

Another reason was: I think it costs a lot of money (and if I’m informed well enough, on a yearly basis), although it wasn’t mine, but the company I was working for that payed for it.

This year I had to make another connection to SAP, but this time I didn’t want to use the Lotus Connector. I believed it must be possible to use SAP’s own free solution for it: SAP JCo.

Believing this costed me a lot of sweat, because it’s not really documented anywhere how to use it with Domino and I’m not a Java guy. But apart from the Java part that was rather new to me, getting it to work in the first place wasn’t simple, and this is what I found out what works. It’s in the first place a matter of putting the files on the right place, and the locations mentioned below were found out with a lot of trial and error.

A little warning: use this at your own risk and make sure you try it on your development/test server first!

  1. Download and extract the latest version of the installation files from SAPNet. You will need to have a username/password for this, so ask your SAP collegues to download it for you.
  2. Copy librfc32.dll and sapjcorfc.dll to the Domino program directory
  3. Copy sapjco.jar to [Domino program directory]/jvm/lib/ext
  4. Restart the Domino server.

If you want to learn more about how to work with it, there’s sample data and documentation in the installation zip (don’t ask me about the programming, I got it to work thanks to a lot of assistance of the Java collegues).

For web applications I read data using a WebQueryOpen agent and wrote data using a WebQuerySave agent.

7 Comments

  1. Hi Martin.

    Your article is very interesting

    I have a problem trying to connect Lotus Domino 7 and SAP using a Java agent.

    I downloaded the JCo 2.1 from sap web site.

    I put the 3 files(librfc32.dll, sapjcorfc.dll and sapjco.jar) in windows/system32, also in : ..\Domino\jvm\lib\ext also in ..\Domino\jvm\lib\ext\x86
    also in Domino\

    I restarted the Domino server but the log showed me:

    java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer ‘com.sap.mw.jco.rfc.MiddlewareRFC’
    not allowed to access or modify file: C:\Archivos de programa\IBM\Lotus\Domino\jvm\lib\ext\x86\sapjcorfc.dll

    I will appreciate if you can help me in any way.

    editorlapagina@gmail.com

    Reply
  2. Hi Johann,

    I’m not at that company anymore, I have other clients now, but this is what I remember from it: you should really copy the files in the direcories as specified, and remove them from other directories (it’s not better to put them on more place “just to make sure”, it can give some interference).

    Also, it’s strange that it tries to access the file in “Archivos de programa”, it seems like it finds the files on wrong places. Try removing all files not on the right spots first and restart your server.

    Regards,
    Martin

    Reply
  3. Hi Martin.

    I just checked the “Allow restricted operations” agent property and everyting worked OK.

    It was very useful your indications about when to put the files:

    “sapjco.jar to [Domino program directory]/jvm/lib/ext”

    And

    “librfc32.dll and sapjcorfc.dll to the Domino program directory”

    Thank you very much for your article and your answer.

    Reply
  4. Sir i am a sap abap consultant and my company requires me to connect sap and ibm lotus notes using sap java connector so can you help me regarding sap java connector. I don’t have any knowledge about it i would be very thankfull to you if you reply me.

    Email id : sap.khan91@gmail.com
    Thanks and anticipation Imran khan

    Reply
  5. Hi Martin.
    I met a problem, hope to get your help very much!

    [05D0:01A1-0B58] 2016/03/16 16:45:52 HTTP JVM: Exception in thread “AgentThread: JavaAgent”
    [05D0:01A2-0B58] 2016/03/16 16:45:52 HTTP JVM: java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO (initialization failure)
    [05D0:01A4-0B58] 2016/03/16 16:45:52 HTTP JVM: at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
    [05D0:01A6-0B58] 2016/03/16 16:45:52 HTTP JVM: at JavaAgent.NotesMain(Unknown Source)
    [05D0:01A8-0B58] 2016/03/16 16:45:52 HTTP JVM: at lotus.domino.AgentBase.runNotes(Unknown Source)

    I will appreciate if you can help me in any way.
    zhangzl016@163.com

    Reply
    • If you have the jar file on the right place, then it’s probably an issue with the java security on the server. Look for the correct settings in java.policy on the internet; this is probably the direction to look into.

      Reply
      • Hi Martin,Thank you very much for your reply!

        Only a Jar JCO is failure;Other Jar is normal;

        I appreciate your solicitude , expect that is your to reply!

        Reply

Submit a Comment

Your email address will not be published. Required fields are marked *

− 3 = 4

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>