Show TOC Start of Content Area

Procedure documentation Creating EJB 3.0 Projects in the Developer Studio  Locate the document in its SAP Library structure

Use

Before you create an enterprise bean, you need an EJB 3.0 project to which you can assign it. The EJB 3.0 project also contains the deployment descriptors that will be included in the EJB JAR file.

Procedure

...

       1.      Choose FileNewProject… from the main menu.

       2.      Choose EJBEJB Project on the New Project dialog.

       3.      Choose Next.

       4.      Enter a name for your new EJB project in the Project name field.

       5.      If you want to add your project to an EAR, select Add project to an EAR and enter a name for your EAR project in the EAR Project Name field.

       6.      Choose the project facets you want to use in your EJB project. The facets are configurable properties of the project. You can leave the default settings or you can add additional facets, such as Java Persistence. Choose Next.

       7.      If you want you can generate the ejb-jar.xml deployment descriptor. Set the Generate Deployment Descriptor indicator. This automatically generates the ejb-jar.xml in your EJB project.

       8.      Choose Finish.

Result

The project appears in the Project Explorer. It has an ejbModule folder and the SAP-specific deployment descriptor: ejb-j2ee-engine.xml.

Note

The deployment descriptor ejb-jar.xml is no longer created by default in the Developer Studio. According to the Java EE 5 specification, the information that was previously taken from the deployment descriptors can now be taken from the corresponding annotations in the source code.

You can modify the project facets after you have created the project. You can reach them using PropertiesProject Facets in the context menu of the project.

Caution

Do not make the project Java 6.0 compliant (by default it is always JDK 5.0 compliant, regardless of the Developer Studio’s Java Virtual Machine (JVM)) using PropertiesJava CompilerCompiler compliance level option. Since the AS Java runs on a JDK 5.0 compliant virtual machine, your project will not deploy there.

You can now add enterprise beans and helper components to the project.

More Information

      Creating Session Beans

      Creating Message-Driven Beans

End of Content Area