Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
engswee
Active Contributor

Update 15 Feb 2016: For those who intend to customize these modules in NWDS 7.3x (or higher), it is recommended to follow the steps listed in the blog Setup com.equalize.xpi.af.modules Adapter Module project in NWDS easily using EGit instead


Introduction

FormatConversionBean and the other modules in equalize-xpi-modules are developed in NWDS 7.31 SP13 Patch 0 as EJB 3.0 modules. To be able to use these modules in PI versions earlier than that, the EJB & EAR projects needs to be recompiled in an NWDS version matching the PI system where it will be deployed.

As the source codes are publicly available in the GitHub repository, this blog is a guide on how to perform the recompilation on the modules. As EJB 3.0 is only applicable for PI 7.3x onwards, the module codes needs to be refactored for EJB 2.1.

This guide is also applicable for those who wish to download the modules to make further changes according to their own requirement. Ignore EJB 3.0 -> 2.1 changes if they are not applicable.

Prerequisite

Following are the prerequisites in order to recompile the modules.

  • Download and install appropriate version of NWDS (refer NWDS Download Links Wiki)
  • For NWDS 7.1x and earlier, the download links only provide a kernel with minimum functionality. Ensure that the NWDS is updated to have the appropriate functionality for PI development.
  • Install version of JDK that is compatible with the NWDS (i.e. JDK 1.5 for NWDS 7.1x) - refer wiki for the JVM versions used by each XI/PI version

Note: I was not able to update the NWDS 7.11 CE kernel, maybe the update site is no longer available (I'm not sure). Therefore the examples provided below are using NWDS 7.31 and some of the screenshots might look different. However, the procedure is still more or less the same.

Source Codes and Libraries

As a preparation step, the following source codes and libraries need to be downloaded first.

Extract all the Zip files into appropriate directories in the local file system.

Step by Step Procedure

The steps listed here are based on the steps listed in Section 4 of the following document. This blog will only describe the differences of each step where it is applicable. Otherwise, the steps listed in the document should be followed.

How to Create Modules for the JEE Adapter Engine

4.1 & 4.2

Follow steps listed in document

4.3

Create EJB 2.1 Project following on steps listed with the following details

  • EJB project name: com.equalize.xpi.af.modules.ejb
  • EAR project name: com.equalize.xpi.af.modules.app

4.4

Ignore steps listed in document.

Create package com.equalize.xpi.af.modules under ejbModule.

Import the downloaded source code for com.equalize.xpi.af.modules into the newly created package.

Browse to the directory where the extraced source codes are and select the following files and folders to import.

Repeat steps for importing com.equalize.xpi.util and org.java source codes.

4.5

Replace content of ejb-jar.xml file based on following criteria:-

  • Compiling for EJB 2.1 - Use following file > EJB 2.1 ejb-jar.xml
  • Compiling for EJB 3.0 - Use file included in equalize-xpi-modules ZIP extract

4.6

Replace content of ejb-j2ee-engine.xml file based on following criteria:-

  • Compiling for EJB 2.1 - Use following file > EJB 2.1 ejb-j2ee-engine.xml
  • Compiling for EJB 3.0 - Use file included in equalize-xpi-modules ZIP extract

4.7

Follow steps listed in document to include PI AF library files.

Additionally, include external Apache POI libraries in the build path.

Add the following 5 files as External JARs.

4.8

Ignore steps listed in the document.

At this point, most of the imported source code should no longer have any syntax errors. There remains a few more tweaking in order for the remainder of the source code to be error-free and ready for compilation.

The message logger class, com.sap.engine.interfaces.messaging.api.logger.MessageLogger, is only available from 7.3x onwards. Therefore, when compiling for 7.1x and below, the MessageLoggerHelper class needs to be deleted as shown below.

Additionally, the AbstractModule class needs to be changed as follows:

  • Remove logic using MessageLoggerHelper
  • Class needs to implement javax.ejb.SessionBean interface (and corresponding methods) as required by EJB 2.1

The source code for AbstractModule can be replaced with the following source code > EJB 2.1 AbstractModule.java. After copying the source code, rename the class from AbstractModule_EJB21 to AbstractModule.

At this point, the EJB project should be error free.

4.9

Skip steps listed in the document.

4.10

The steps listed in the document can be followed, or optionally just replace the content of application-j2ee-engine.xml with the same file included in the equalize-xpi-modules ZIP extract.

4.11 & 4.12

Follow steps listed in the document to complete compilation and deployment.

Reference

To perform testing of the modules prior to deployment, refer to the following article on how to do perform standalone testing in NWDS

Standalone testing of Adapter Module in NWDS

4 Comments
Labels in this area