7.2.3. Create an EAR Project containing an EJB Project
- A server and server runtime for JBoss EAP 6 has been set up. Refer to Section 184.108.40.206, “Add the JBoss EAP 6 Server to JBoss Developer Studio”.
Procedure 7.3. Create an EAR Project containing an EJB Project
Open the New EAR Application Project WizardNavigate to the New Project wizard appears. Select and click .menu, select , then and the
Figure 7.4. New EAR Application Project Wizard
Supply detailsSupply the following details:
- Project name.As well as the being the name of the project that appears in JBoss Developer Studio this is also the default filename for the deployed EAR file.
- Project location.The directory where the project's files will be saved. The default is a directory in the current workspace.
- Target Runtime.This is the server runtime used for the project. This will need to be set to the same JBoss EAP 6 runtime used by the server that you will be deploying to.
- EAR version.This is the version of the Java Enterprise Edition specification that your project will comply with. Red Hat recommends using
- Configuration. This allows you to adjust the supported features in your project. Use the default configuration for your selected runtime.
Add a new EJB ModuleNew Modules can be added from the Enterprise Application page of the wizard. To add a new EJB Project as a module follow the steps below:
The newly created EJB project is listed in the Java EE module dependencies and the checkbox is checked.
Add new EJB ModuleClick Create Default Modules checkbox, select the Enterprise Java Bean and click . The New EJB Project wizard appears., uncheck
Create EJB ProjectNew EJB Project wizard is the same as the wizard used to create new standalone EJB Projects and is described in Section 7.2.1, “Create an EJB Archive Project Using JBoss Developer Studio”.The minimal details required to create the project are:
All the other steps of the wizard are optional. Clickto complete creating the EJB Project.
- Project name
- Target Runtime
- EJB Module version
Optional: add an application.xml deployment descriptorCheck the Generate application.xml deployment descriptor checkbox if one is required.
Click FinishTwo new project will appear, the EJB project and the EAR project
Add Build Artifact to Server for DeploymentOpen the Add and Remove dialog by right-clicking in the Servers tab on the server you want to deploy the built artifact to in the server tab, and select .Select the EAR resource to deploy from the Available column and click the button. The resource will be moved to the Configured column. Click to close the dialog.
Figure 7.5. Add and Remove dialog
You now have an Enterprise Application Project with a member EJB Project. This will build and deploy to the specified server as a single EAR deployment containing an EJB subdeployment.