Skip to Content
The Adapter Module Development for J2EE Adapters is explained in detail at the following

How – to – Guide: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f013e82c-e56e-2910-c3ae-c602a67b918e

The procedure given in the above guide describes the module development using SAP NetWeaver Developer Studio (NWDS) with Local components. With Local components / projects the process is simple to develop and deploy on the server for use. But, in various companies there are many security reasons due to which they do not allow sharing of the SDM Password for deployment of components. In such cases, the development and deployment of components is always through the Software Component Development Tracks or NetWeaver Development Infrastructure (NWDI). With NWDI, the projects are called as Development Components (DC).

The step – by – step process of development of Adapter Module using NWDI can be stated as:

  • Development of the External Library DC

          o Expose Module Library Jars as Public Parts

          o Activating the External Library DC

  • Development of EJB DC

          o Creating the J2EE EJB Module DC.

          o Adding Module Libraries (API Public Part) as Used DC

          o Adding the code to the module

          o Building the EJB DC

          o Activating the EJB DC

  • Development of EAR

         o Creating the J2EE Enterprise Application DC.

         o Adding Module Libraries (SDA Public Part) as Used DC

         o Adding library and services references to the EAR

         o Building the EAR DC

         o Activating and Deploying the EAR DC

  • Using the Module

The steps that additional and / or differ from the steps given in How to Guide are rendered in BOLD.

Step – by Step Solution

The following section describes in details all the steps that are important from the NWDI perspective of Development of the J2EE Module.

Pre-requisites

Before starting up with the actual process of development it is important that the user is aware of:

  • Basic concepts of NWDI
  • NWDI Login, Activity Check-in and Activating Procedure
  • Process of Component Usage or Adding Used DCs to Project


Development of External Library DC

For development of the Adapter Module we need to use the following seven JAR files provided in  PI Server:

  • aii_af_cci.jar
  • aii_af_mp.jar
  • aii_af_ms_api.jar
  • aii_af_ms_spi.jar
  • aii_af_trace.jar
  • aii_af_svc.jar
  • aii_af_cpa.jar

When the development is done using local projects, these JAR files are added directly to the classpath of the EJB Project. But, when it comes to development with NWDI, these required external JAR files need to be complied in a different DC Type called as External Library.

Create External Library DC

The steps to create an External Library DC:

  1. Create a new Development Component of type External Library
  2. Copy the external JAR Files required for the Adapter Module
  3. From the context menu, select Development Component à Build.
Expose Module Library JARS as Public Parts

The Steps for creating reusable Public Parts of the DC:

  1. Select all the JAR files. Right Click to get the Context Menu.
  2. Select Development Component à Add to Public Part
  3. Select the radio button: Provides an API for developing/compiling other DCs and give appropriate name to the public part.
  4. This creates the API Type public part for the External Library project. This public part contains all JARs to be used as reference, while coding in the EJB for the Adapter Module.
  5. Repeat the above steps for the other radio button: Can be packaged into other build results (e.g. SDAs) for the SDA Type public part, to be used with the EAR DC for Deployment.
  6. From the context menu, select Development Component à Build.
Activating External Library DC
  1. When the External Library DC is being developed on actual track, then, while performing all the above activities, NWDS will prompt for the creation of activity and adding tasks to it.
  2. Once the above mentioned steps are done, switch to Development Configurations perspective, Open Activities View.
  3. Right – Click on activity created for the External Library, and select Check-in. When prompted for Activation, Activate the activity.
  4. Wait until successful activation in the Activation Request view.


Development of EJB DC

The concept of EJB and the coding in the EJB for the Adapter Module are the same, even when DC development is done on track. The creation of the EJB DC and adding and EJB to the DC is the same except creation of Activity for the EJB DC as an extra step.

Adding Module Library (API Public Part) as Used DC

The way to include the external JARs differs with EJB DC Development.

  1. Once the EJB is created, expand your EJB project and open the context menu of Used DCs folder.
  2. Select Add Used DCs. The dialog Add Dependency appears.
  3. Choose the Inactive tab and select the External Library DC, expand till Public Parts. Select the API type Public Part
  4. In the next dialog, select only the Build Time dependency type and choose Finish.
Building and Activating EJB DC

The EJB DC id built from the Context Menu option Development Component à Build DC.

The procedure to “Activate” the EJB DC is similar to that of activating the External Library DC.

Note:  Make sure that the steps: to add code to the business method of EJB, replacing the comments in the bean for the Remote, Home, Local and Local Home files and adding the JNDI name to the bean are performed as given in the original How – to – Guide.

Development of EAR DC

An Enterprise Application DC is required to wrap the EJB Module DC for deployment. Here, again the steps for creating, Building and Deploying the EAR DC will be similar to that of the EJB DC and External Library DC. We will not go into the details of it.

Adding Module Library (SDA Public Part) as Used DC

The only extra step in the EAR DC development is the addition of the public part of the External Library DC.

  1. Once the EAR DC is created, expand the project and open the context menu of Used DCs folder.
  2. Select Add Used DCs. The dialog Add Dependency will appear.
  3. Choose the Inactive tab and select the External Library DC, expand till Public Parts. Select the SDA type Public Part.
  4. In the next dialog, select Build Time and Run Time dependency types and choose Finish.

Note:  The references in the application-j2ee-engine.xml file need to be added as per the How – to – Guide.

Using the Module

Once the EAR DC is deployed on the runtime PI server of the track, the J2EE Adapter Module is ready to use in the communication channel.

The procedure to use the module in the business scenario does not differ at all from what is given in the How – to – Guide.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Alessandro Guarneri
    Hi there,
    Question for you: this is for 7.0 only, isn’t it? Won’t work on 7.1, will it?

    Secondly, do have an idea about what type of DC I am supposed to use for PI Adapters? (not module…)

    Cheers,
    Alex

    (0) 

Leave a Reply