Show TOC

 Assembling the Calculator ApplicationLocate this document in the navigation structure

Use this procedure to package the Calculator session bean, the CalcProxy JavaBean, and the Calculator JSP in an application archive (EAR file). The EAR file contains the JAR and the WAR files with the application components, as well as deployment descriptors - application.xml and application-j2ee-engine.xml.

Prerequisites
  • You have already created the archive files CalculatorEjb.jar and CalculatorWeb.war.

Procedure

Creating the Enterprise Application Project

  1. Choose Start of the navigation path File Next navigation step New → Project End of the navigation path

    .
  2. Select J2EE (the left-hand pane) and Enterprise Application Project (the right-hand pane). Choose Next.

  3. Enter CalculatorEar as the project name and leave the default settings unchanged. Choose Next.

  4. Select CalculatorEjb and CalculatorWeb as referenced projects. Choose Finish.

    The wizard generates the project structure of the new Enterprise Application project.

    Defining the Context Root

  5. Expand the project node and double-click the application.xml.

    The deployment descriptor editor appears.

  6. Choose the Modules tab.

  7. Select CalculatorWeb.war as a module.

  8. Change the name of the predefined value in the Context Root field to /Calculator

    The new context root /Calculator will be used for starting the application.

  9. Save the editor contents.

    Building the EAR file

  10. In the J2EE Explorer, select the project node CalculatorEar.

  11. Open the context menu and choose Build Application Archive.

    The system displays a message to inform you that the build has been successful.

  12. Close the screen by choosing OK.

Result

The Enterprise archive file CalculatorEar.ear has been generated. It contains all the EJB classes and all Web resources, along with the deployment descriptors from the Enterprise Application project.

J2EE Explorer CalcualatorEar

Next step:

You can deploy the application on SAP J2EE Engine.