Configuring EJB Deployment Descriptors
See Also
Deployment descriptors are XML-based text files whose elements describe how
to assemble and deploy a module to a specific environment. The elements also
contain behavioral information about components not included directly in code.
If you are developing enterprise beans on the Java EE 5 platform and deploying to
a Java EE 5 compliant application server, you develop enterprise beans using EJB 3.0 technology.
If you are developing enterprise beans on the Java EE 6 platform and deploying to
a Java EE 6 compliant application server, you develop enterprise beans using EJB 3.1 technology.
EJB 3.0 and EJB 3.1 technology support the use of annotations in your code to describe behavior
that was described using deployment descriptors in EJB 2.1 technology.
As a result, deployment descriptors files are no longer required when deploying to a Java EE 6 compliant
server.
EJB 3.0 and EJB 3.1 technology also support the use of deployment descriptors.
You may need to use a combination of annotations and deployment descriptors in your project when you configure your
project, for example to configure security settings.
For EJB modules, there are two types of deployment descriptors:
To edit ejb-jar.xml:
- In the Projects window, expand the Configuration Files node for your EJB module project.
- Double-click ejb-jar.xml to open the file in the visual editor.
- Select one of the following tabs:
- General. This tab enables you to specify general information about the EJB module, details about security roles
and descriptor details about each of the enterprise beans in the module.
See the following topics for more information about the properties you can set in the General tab:
- CMP Relationships. This tab enables you to view and modify CMP relationships for CMP beans in your module.
See the following topic for more information about the properties you can set in the CMP Relationships tab:
- XML. This tab enables you to edit the descriptor file in the XML editor.
- Edit the properties.
- Save your changes.
To edit glassfish-ejb-jar.xml:
- In the Projects window, expand the Configuration Files node for your EJB module project.
- Double-click glassfish-ejb-jar.xml to open the file in the visual editor.
- Select a tab at the top of the editor. See the following topic for more information about the editor tabs:
- Edit the descriptor file as necessary and save your changes.
To edit the server-specific deployment descriptor for any other application server:
- Double-click the deployment descriptor node in the Projects window.
The IDE opens the XML source of the deployment descriptor in the Source Editor.
- If you enter any XML syntax errors the IDE automatically alerts you. To
fully ensure your changes have not cause any errors, you should verify the
EJB module.
- See Also
- About Deployment Descriptors
- About Configuring EJB Modules
- Configuring Web Application Deployment Descriptors
- Managing Container-Managed Relationships
- Verifying an Enterprise Application
- Refactoring an Enterprise Bean
Legal Notices