Show TOC

Creating EJB 2.1 ComponentsLocate this document in the navigation structure

Use

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. Choose the New pushbutton.

  2. Select Start of the navigation path EJB Next navigation step EJB Project End of the navigation path, then choose Next .

  3. In the EJB module version field, select 2.1 .

  4. Specify the desired additional settings.

  5. (Optional) To configure the project facets, choose Modify in the Configuration area.

    You can add Java Persistence and EJBDoclet facets.

    Note

    You can change the project facets later at any time by choosing Start of the navigation path Properties Next navigation step Project Facets End of the navigation path in the project context menu.

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

  7. Choose Finish .

For more information, see Creating EJB 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 Start of the navigation path New Next navigation step Enterprise JavaBeans End of the navigation path.

  2. In the first page of the New EJB wizard, enter the EJB Name and select the Bean Type .

    Note

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

  3. (Optional) Specify additional settings of the EJB.

  4. Choose Finish .

For more information, see:

Creating Session Beans in the Developer Studio

Creating Message-Driven Beans in the Developer Studio

3. Edit Deployment Descriptors

When you create an EJB 2.1-compliant 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.

For more information, see:

ejb-j2ee-engine.xsd

ejb-j2ee-engine_3_0.xsd