Importing the Project for the J2EE-Based Car Rental Tutorial

Use

The project you will use for this tutorial is the J2EE-based quick car rental application that is provided with the SAP NetWeaver Developer Studio. Therefore, to begin working with this tutorial, you first have to import this project into the Developer Studio workspace.

Prerequisites

You know the workspace directory for your SAP NetWeaver Developer Studio.

You know the path to the examples provided with the Developer Studio. In a default installation this path is C:\Program Files\SAP\JDT\eclipse\examples.

If you have previously worked on the J2EE quick car rental application using the Developer Studio, then this project is closed and its contents are removed from the Developer Studio workspace. In addition, the application does not exist as a deployed application on the J2EE Engine.

The J2EE Engine and the Software Deployment Manager (SDM) are running.

You can connect to the J2EE Engine from the Developer Studio for deployment. You also know the SDM password to use for the connection.

This tutorial assumes that you are working with the J2EE quick car rental project as it is provided with the J2EE Engine’s example projects. Therefore, if you have previously worked on either the J2EE or the Web Dynpro car rental applications and deployed them to the J2EE Engine, we recommend you remove them not only from the Developer Studio’s workspace, but also from the J2EE Engine and start with a completely new set of projects. Note the following:

·         When deleting the projects from the Developer Studio, also delete the content from the workspace. Also delete the Dictionary project and the Helperclasses. (Switch to the Navigator to make sure that all projects have been removed.)

·         To remove the application from the J2EE Engine, use the Deploy service in the Visual Administrator. Remove the application sap.com/QuickCarRentalEar and if applicable, local/TutSD_CarRental, and any of the corresponding components.

·         You do not need to remove any entries from the database itself.

Procedure

Importing the project template into the SAP NetWeaver Developer Studio

...

       1.      Navigate to the location of the examples for the SAP NetWeaver Developer Studio.

       2.      Unpack the J2EE_QuickCarRental.zip archive into the workspace directory for your SAP NetWeaver Developer Studio.

       3.      Start the SAP NetWeaver Developer Studio.

       4.      Switch to the J2EE Development perspective and import the projects from the quick car rental application.

                            a.      To switch to the J2EE Development perspective, choose Window ® Open Perspective  ® J2EE Development.

                            b.      Choose File  ® Import.

                            c.      Select Multiple Existing Project into Workspace and choose Next.

                            d.      In the Select base folder field, enter your workspace directory (or use the Browse... function).

The projects for the car rental application appear. These are Helperclasses, J2EE_QuickCarRentalEar, J2EE_QuickCarRentalEjb, J2EE_QuickCarRentalWeb and QuickCarRentalDictionary.

                            e.      Select all of these projects. Also select the Open projects after importindicator and choose Finish.

The projects are opened in the SAP NetWeaver Developer Studio.

       5.      Deploy the dictionary archive to the J2EE Engine.

                            a.      Switch to the Dictionary perspective. (Choose Window  ® Open Perspective  ® Dictionary.)

                            b.      Choose the Dictionary Explorer.

                            c.      Select the QuickCarRentalDictionary project, open the context menu with the right mouse button, and choose Deploy.

If this is the first time you deploy from the SAP NetWeaver Developer Studio, then you are prompted for the SDM password. Enter this password to continue with deployment.

       6.      Deploy the EAR archive to the J2EE Engine.

                            a.      Switch back to the J2EE Development perspective and the J2EE Explorer.

                            b.      Expand the J2EE_QuickCarRentalEar project.

                            c.      Select the J2EE_QuickCarRentalEar.ear node, open the context menu and choose Deploy to J2EE Engine.

       7.      To test the deployment, start a Web browser and enter the URL for the application.

http://localhost:50000/QuickCarRental

If the application does not run, then make sure the J2EE Engine and the SDM are running and that the host and port are correct.

Initial Project Structure

Once you have imported the project template into the Developer Studio, you will see the following structures in the J2EE Explorer.

J2EE Project Structure

 J2EE application project: J2EE_QuickCarRentalEar

 J2EE Enterprise Java Bean project: J2EE_QuickCarRentalEjb

 J2EE Web project: J2EE_QuickCarRentalWeb

Next Step:

You can now begin with the tutorial steps.

If you are working with the tutorial for using J2EE security roles, see Using J2EE Security Roles in the Application - Steps.

If you are working with the tutorial for using UMEpermissions, see Using UME Permissions in the Application – Steps.