Skip to Content

Setup Adapter Module project in NWDS easily using EGit


When I first shared on SCN the custom adapter modules that I developed, I hoped that it would be beneficial to others who require similar solutions for their requirement. My intention was to bridge some of the gaps in SAP’s own standard offering (some gaps which have been around for far too long!) by providing highly reusable solutions.

I have been pleasantly surprised by the response of SCN members to the suite of adapter modules (FormatConversionBean, AttachmentSplitterBean and DynamicAttributeChangeBean). As I have provided the EAR file that can be used for direct deployment to PI/PO 7.31/7.4 (and I believe it should also work in PI/PO 7.3), many have deployed it on their systems and provided feedback that the modules are working well. Some have also provided feedback on issues and bugs which have helped me improve the modules further.

Occasionally, there are some requests on setting up the project in NWDS (based on the source codes I provide in GitHub) in order to further customize the solution. Although the blog Recompile as EJB 2.1 modules in NWDS 7.1x was written with the intention to enable those working on older PI systems to compile the modules, the procedures are also relevant for NWDS 7.3x and higher.

As I use EGit more and more in my daily routine, it has provided various valuable ways to enhance my workflow such as using EGit to quickly create an Adapter Module’s EJB & EAR project.

Similarly, for those working on NWDS 7.3x and higher and interested in customizing these adapter modules, it is much easier to use EGit to setup the project from the GitHub repository (instead of the steps in the blog for NWDS 7.1x). I have since restructured the GitHub repository so that it can be easily cloned and imported into an Eclipse/NWDS workspace. In this blog, I will share the steps of how this can be achieved relatively easily. I hope this will be useful for those who are interested in customizing/enhancing this solution further.


Note: This blog assumes that a working setup of an NWDS installation is already in place. There are many blogs in SCN that already covers that topic.

1. EGit installation and configuration

EGit comes pre-installed in an NWDS 7.5 bundle. For NWDS 7.3x, follow the Installation section of the following blog.

Using EGit for Java source code management in NWDS

Once it is installed, complete the Initial Configuration section of the above blog.

2. PI Adapter Module library files

Although NWDS 7.3x onwards provides built in XPI Adapter Libraries, these are reduced copies and do not contain all classes compared to the libraries which are on the system. Some of the logic in the custom adapter modules refer to some classes which are not available in these reduced libraries. As such, the following JAR files need to be retrieved from the PI system.


Refer to the following Wiki for the location of these files and how to get them.

Where to get the libraries for XI development – Process Integration – SCN Wiki

3. Apache POI library files

Download the following Apache POI 3.9 library files, and extract the JAR files to a folder named Apache_POI in the local file system.

Apache POI 3.9 ZIP file

Step by Step Procedure

Step 1 – Clone Git repository and Import Projects to NWDS

Go to the Git repository on the following site and click Copy to clipboard.

GitHub – engswee/equalize-xpi-modules


In NWDS, switch to Git perspective, and select Clone a Git repository.


The cloning wizard will be auto populated with the GitHub repository details. Click Next twice.


Select an appropriate location to store the Git repository locally. In the same step, select Import all existing projects after clone finishes.


Switch to the Java EE perspective, and the following 4 projects will be listed in the Project explorer. The first two are the EAR and EJB projects, followed by a standalone testing project, and lastly a Java project which the EJB project is dependent on.


Step 2 – Resolve JRE System Library

The projects were originally developed using SAP JVM 6. If a different JDK is used in your system, the JRE System Library needs to be updated accordingly.

Right click on the EJB project, select Build Path > Configure Build Path.


For example, if this was imported into an NWDS 7.5 installation (which supports Java 8), we can switch it to JDK 1.8.


Step 3 – Resolve classpath variable for Apache POI libraries

The Apache POI libraries need to be bundled together in the EAR file during deployment. As such, they are included in the build path of the EJB project as classpath variables.

Go to Window > Preferences > Java > Build Path > Classpath Variables. Select New.


Add a new entry named EXT_LIB, and select the parent folder where the Apache_POI folder reside. In the example below, select Library.


Save all the settings and when the following prompt is displayed, select Yes.


Step 4 – Resolve user library for PI adapter module libraries

Since the PI adapter module library files already exists in the system, they do not need to be bundled in the EAR file. Instead they are referenced in the EJB project as user libraries.

Go to Windows > Preferences > Java > Build Path > User Libraries. Select New.

Add a new user library named PI_LIB.


Click Add External JARs to the new user library.


Select the following two JAR files (which should already be downloaded based on the Prerequisite section).


Save all the settings. At this point, all the build path should be resolved and all classes should compile and build successfully.

For this point, furthercustomization to the codes can be performed.

You must be Logged on to comment or reply to a post.
  • Hi Eng,

    Im having a problem compiling the EJB project, i have done all the steps but i can´t fix this:


    i am using SAP Enhancement Package 1 for SAP NetWeaver Developer Studio 7.3, thanks for your help.

    Note: the JDK version is 1.6.0_45

    • Hi Andres

      From your screenshot, there seems to be nothing under PI_LIB. You might want to check if you have completed step 4 which adds the external JARs listed under prerequisite item 2.


      If you still have any issues, please raise it as a discussion thread since the comment section in the blog is not the appropriate area for resolving issues.


      Eng Swee

      • Hi Eng,

        i found the problem, i was using the wrong version of the nwds, i found the solotion thanks of one of your posts.



        Andres Guerrero.

  • Hi Eng,

    I was able to able to build successfully. Can you provide instructions on exporting it as an EAR file?

    Since there are three seperate packages -, and com.equalize.xpi.util, do I need to export three SAP Ear files and deploy them?

    I selected all three packages and exported as a single SAP EAR file. Once I added it via SAP MMC I get the below error -

     Software delivery unit located in <E:\Install\New Module\equalize-xpi-modules-masterEAR.ear> is rejected because of
     the following reasons: Component cannot be installed.
    Component is not part of any existing software components


  • Hi Eng Swee,

    thanks for your great blog, and the incredible helpful module.

    I am having trouble adding the external Apache JARs to the project. It seems as if in newer NWDS versions choosing "Add/Remove" on the EAR Project does not work properly.

    Usually it should open a window with "Java EE Module Dependencies", where I would like to add the Apache JARs, but this is not available anymore. I tested it with an old and new NWDS version. See a screenshot of a new WDS version below, on the right side you see the lacking options from the popup when choosing "Add/Remove".

    Do you have an Idea how I can get the Apache JARs into the EAR file? I tried copying the JARs manually, which is no good solution, but even that didn't work. For deployment I use the deployment view (not sure if this is linked with NWDI, but we use NWDI).


    • Hi Elias


      I haven't tried out the newer NWDS version, so I can't comment. But looking from your screenshots, it looks like you are trying to add directly to the EAR project's library. Please refer again to step 3, where you need to do this in the general Eclipse preference as classpath variables.



      Eng Swee

      • Hi Eng Swee,

        thanks for your answer. I should have explained my problem a bit more.

        First off, I didn’t get it working with the Classpath, and was searching for an alternative. I entered the Classpath (1) but didn’t get the popup you mentioned in your blog. Nontheless I cleaned and built the project manually. But this didn’t work (2). The Classpath Variable points to a folder where all Apache JARs are situated, in the root folder as well as in a subfolder Apache_POI (3).

        If I added the JARs manually to the EJB project as external JARs, it works as far as that I am able to resolve all errors in the project. But they are still missing in the EAR file I want to deploy, so that’s no solution.

        Am I doing something wrong? How do I get the apache JARs being recognized by the project, and have them in the deployed EAR as well?


        The second strange thing I encountered, if I deploy the EAR without the Apache JARs I (certainly) get the error message that an Apache class is missing (4). But if I add them manually to the EAR (5), I am getting an error that the AuditLogHelper is not found (6), although it is in the according jar in the ear (5).

        I thought about messing with the application-j2ee-engine.xml, but as far as I know this is only for referencing other globally available libraries.

        Do you have any ideas on that?

        Thanks for your support!


        • Hi Elias


          Can you show me the full screenshot from 1? There should be a few buttons (New, Edit, Remove) on the right side of the defined classpath variables. If it's there, can you show me the screenshot when you click on Edit?



          Eng Swee

          • /
          • Hi Elias


            Your classpath setup looks fine. I'm not sure why it's not working for you. I would suggest you do a full rebuild of the project in your workspace.



            Eng Swee

          • Hi Eng Swee,

            I tried that several times, but unfortunately it makes no difference.

            Lets assume I can't solve the problem with the classpath, do you have an idea why I get the error (4), although all JARs seem to be in the EAR file (5)?





            Hi Elias


            The only thing I can think of is to check if your deployment was done correctly. Did you make sure to export it as an SAP EAR file?


            You can check in Java Class Loader Viewer (under NWA), to see if the external libraries were included during deployment (under Resources tab of the selected component).



            Eng Swee


            Hi Eng Swee,

            thanks, the Java Class Loder View did the trick. There was a second EAR library visible, with a slightly different name, which I deployed beforehand while testing. Although I undeployed that one, it was still present in the classloader view. This EAR lacked the necessary Apache libraries.

            I checked the deployment view again, it was not there. To get rid of the library, we restarted the system, now it works.

            I still have to add the Apache libraries manually, but I can live with that.

            Thanks again for your support!

  • Hi Eng Swee,


    We got the below error while installing  the file directly   using SUM.

    Are we missing anything?


    Component cannot be installed. Component is not part of any existing software components.