Now, we shall create an EJB project to create entity beans.
In Eclipse, go to File | New | Other to create an EJB project. In the New wizard, select EJB Project from the EJB folder and click on Next as shown in the following screenshot:
Specify a Project name and click on New Runtime to configure a target runtime for Oracle WebLogic Server 12c if not already configured, as shown in the following screenshot:
In New Server Runtime Environment, select the Oracle WebLogic Server 12c (12.1.1) server, tick Create a new local server checkbox, and then click on Next as shown in the following screenshot:
Select the WebLogic home directory, and the Java home directory also gets specified. Click on Next as shown in the following screenshot:
Select
Server Type as Local and then select Domain Directory as C:\Oracle\Middleware\user_project\domains\base_domain
. Click on Finish as shown in the screenshot:
The Target runtime server gets configured. Select EJB module version as 3.1. Select the default Configuration and click on Next as shown in the following screenshot:
Select the default Java configuration for Source folders on build path as ejbModule and Default output folder as build/classes
, and click on Next as shown in the following screenshot:
Select the default EJB module configuration and click on Finish. An EJB project gets created. The EJB project does not contain any EJBs, which we shall add in subsequent sections.
Right-click on the project node in the Project Explorer tab and select Project Properties. Select Project Facets in the Properties window. The EJB project should have the EJB Module project facet enabled as shown in the following screenshot:
Session beans require an EJB project and entity beans require the JPA project facet for database persistence. We have created an EJB project but this EJB project does not have the JPA project facet enabled by default. In the next section, we shall add the JPA facet to the EJB project.