Skip to Content
Author's profile photo Former Member

How to recompile NWDS 7.0 projects to NWDS 7.4

When migrating to Netweaver 7.4 the custom Portal Applications have to be recompiled and adjusted using the Netweaver Developer Studio (NWDS) 7.3 and following the main steps detailed below:

  1. Import Project
  2. Java Build Path adjustment
  3. Deprecated APIs handling
  4. Deployment Descriptor modification
  5. EAR package creation

Note: The first time the NWDS is used, the Installed JREs has to be set with the JDK 1.6 location. Go to Window > Preferences > Java > Installed JREs… as shown in the image below.

/wp-content/uploads/2016/07/images_1005757.png

  1. Import Existing Project into Workspace

After copying the Project’s content folder in the Workspace folder, go to NWDS and select the Import option from the File menu.

In the popup window that appears, select General > Existing Projects into Workspace, and click on Next.

 

/wp-content/uploads/2016/07/1_1005860.png

Click on Browse… (Select root directory: )

  /wp-content/uploads/2016/07/2_1005861.png

And select the Project’s folder to import

/wp-content/uploads/2016/07/3_1005862.png

  1. Java Build Path

After the import, the Project appears in the Package Explorer view with Error status (red cross icon); the Errors are listed in the Problems view. All of them are related to missing library references and are solved by adjusting the Java Build Path.

  1. a. JRE System Library

First, the new JDK used in the project has to be set.

Right-click on the Project folder and select Properties (last option).

/wp-content/uploads/2016/07/1_1005860.png

In the Properties, select Java Build Path section and then Libraries tab.

Select all the entries, they are old, and Remove them.

Click OK.

/wp-content/uploads/2016/07/6_1005866.png

Right-click on the Project’s folder and select Build Project.

In the Problems view two errors appear, that are due to the missing references in the Build Path.

/wp-content/uploads/2016/07/1_1005860.png

/wp-content/uploads/2016/07/2_1005861.png

Right-click on the Project folder and select Properties again.

Go to Java Build Path section and then Libraries tab.

Click on Add Library… button and select JRE System Library.

/wp-content/uploads/2016/07/2_1005861.png

Select Workspace default JRE radio button and click on Finish.

/wp-content/uploads/2016/07/3_1005862.png

b. JAR files to classpath

There are two options to adjust the classpath of the project, through a wizard indicating the unknown class or manually adding the required JARs.

  1. Wizard option to import missing classes:

Locate the import statement that is giving the error and copy the entire name of the unknown class.

/wp-content/uploads/2016/07/1_1005860.png

Right-click on the Project’s name and select the “Add Class to Build Path” option.

/wp-content/uploads/2016/07/2_1005861.png

Specify the class name and select it from the options given below.

The JARs containing the selected class are shown in the box at the bottom.

Select the correct JAR and click on Finish button.

/wp-content/uploads/2016/07/3_1005862.png

The error in the import statement disappears and the JAR is added to the Referenced Libraries list.

Building the project may be needed.

/wp-content/uploads/2016/07/4_1005875.png

  1. Manual option to add the JAR files:

Right-click on the Project folder and select the Properties option.

Go to Java Build Path section and then the Libraries tab.

Click on Add Variable… and select the WD_RUNTIME variable, then click on Extend… button.

/wp-content/uploads/2016/07/5_1005885.png

Look for the specific JAR in the plugins folder, select it and click OK.

The JAR is added to the Referenced Libraries list.

Building the project may be needed for the errors to disappear.

/wp-content/uploads/2016/07/6_1005866.png

  1. Handling Deprecated APIs

For the Project just imported, we could find that some of the classes/methods used in the code are deprecated in the new version. Deprecated means that, although an API is still available and supported, it will be phased out in the subsequent releases, therefore we should avoid using it, and use the suggested alternative API.

In the Problems view, the Warnings for the Project (among others) are shown.

As shown in the image, warning messages about a deprecated method/class being used in the code could be found.

/wp-content/uploads/2016/07/7_1005882.png

Go to the specific part of the code in the warning message to check the possibilities of replacing the deprecated method/class.

/wp-content/uploads/2016/07/8_1005881.png

Check the JavaDocs at: http://help.sap.com/javadocs/#section1 to find information about the new recommended class or method for the deprecated one.

  1. Deployment Descriptor (Portalapp.xml)

/wp-content/uploads/2016/07/9_1005880.png

  1. The Portalapp.xml deployment descriptor (located under dist à PORTAL-INF) should comply with the new standard.

To enable referencing the portal APIs used in the application, we must define the relevant PrivateSharingReference and/or PublicSharingReference properties. In SAP NetWeaver 7.3, references should be made via the facade DC rather than directly to the components, so we should convert the DC name to reference.

For example, if the DC name in the Javadocs is [sap.com] tc/epbc/prt/api, the reference should be com.sap.tc~epbc~prt~api. For a J2EE library, the prefix should be SAPJ2EE::library:<libName>.

  1. Portalapp.xml in our example should look as follows:

  1. EAR package creation

The PAR file extension is not supported in NW 7.3. The portal applications are now packaged in EAR files.

Right-click the project and select Export.

/wp-content/uploads/2016/07/10_1005886.png

In the popup, select SAP NetWeaver Portal and EAR File, then choose Next.

/wp-content/uploads/2016/07/11_1005887.png

Select the project from the list and choose Next.

Define the Name and Location properties and choose Next.

Verify that the EAR file is created.

  /wp-content/uploads/2016/07/12_1005888.png

  1. Related Links
  • Migrating Portal Applications à

http://help.sap.com/saphelp_nw73/helpdata/en/04/6c444aa960490e8fe9e0361b7f39e7/content.htm

  • How To… Migrate Custom Portal Applications to SAP NetWeaver 7.3 à

  http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10b84b1f-9d37-2f10-bc9e-e61d943bfa7a?overridelayout=true&53648436494622

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Very comprehensive manual! It solved my problems with NWDS 7.3 too. Great thanks!