Show TOC

Procedure documentationCreating EJB 2.1 Components Locate this document in the navigation structure

 

In this document you can find the differences between the wizards for creating Enterprise JavaBeans (EJB) 2.1 components and Enterprise JavaBeans (EJB) 3.0 components in the Developer Studio. They are both created using the EJB Project wizard but with different project facets for each version.

Procedure

1. Create an EJB Project
  1. In the context menu of the Project Explorer, choose   New   EJB Project  .

  2. Enter the name of the EJB project and choose Modify. Select SAP EJB J2EE 1.4 Project in the Configurations field.

  3. Define the project facets. You can save the currently selected facets; these are the default facets for the SAP EJB J2EE 1.4 Project which you chose in the Configurations field. The default facets are:

    • EJB Module with version 2.1

    • Java 6.0, but you can change the version to Java 1.4 and Java 5.0

    • SAP-Specific EJB Module with version 2.1

    You can optionally add Java Persistence, and EJBDoclet facets. Choose OK.

    Note Note

    You can change the project facets later at any time from   Properties   Project Facets   in the context menu of the project.

    End of the note.
  4. In the Target Runtime field, select SAP Libraries. This automatically sets the necessary libraries for building the project as specified in the Configuration field.

  5. Choose Finish.

More information: Creating EJB 3.0 Projects in the Developer Studio

2. Create Session and Message-Driven Beans

The wizards for creating enterprise beans in EJB 2.1 components are different from those in EJB 3.0 components.

In EJB 2.1 components you can create enterprise beans using the same wizard. Unlike EJB 3.0 components, in EJB 2.1 components you can create not only session and message-driven beans but entity beans as well.

  1. In the context menu of the EJB Project, choose   New   EnterpriseBean  .

  2. In the first page of the New EJB wizard enter the name of the bean and select the bean type. Choose Finish.

    Note Note

    The entity beans are no longer part of the EJB 3.0 Specification. You can create them only in EJB 2.x components.

    End of the note.

More information about creating:

3. Edit Deployment Descriptors

When you create an EJB Project, the Developer Studio automatically creates both ejb-jar.xml and ejb-j2ee-engine.xml. You can use the multipage editor for editing the deployment descriptors to configure your EJB components.

More information: