This topic describes common tasks you can perform with EJB modules. For more
detailed information, click the links in the right column.
To perform this task |
Follow these steps |
Create an EJB module project. |
- Choose File > New Project (Ctrl-Shift-N).
- Select the right template
from the Java EE category.
|
Create an enterprise bean. |
- Select the project node for any EJB module project.
- Choose File > New (Ctrl-N).
- Select an enterprise bean template
from the Enterprise category.
|
Generate CMP entity beans from a database. |
|
Build an EJB module. |
- If the module is part of an enterprise application, right-click the
enterprise application project and choose Build.
- If the module is a stand-alone EJB module, right-click the EJB module
project and choose Build.
|
Package a JAR file on an EJB module's classpath in the EJB JAR file. |
- Right-click the EJB project's node and choose Properties.
- Click Libraries in the left panel of the dialog box.
- Select the checkbox in the Package column for the classpath item.
|
Verify an EJB module. |
|
Deploy an EJB module. |
- If the module is part of an enterprise application, right-click the
enterprise application project and choose Run
.
- If the module is a stand-alone EJB module, right-click the EJB module
project and choose Run.
|
Generate a reference to an enterprise bean. |
- Open any Java class file from an EJB module project or web application
project.
- Right-click anywhere inside the class file and choose Insert Code
> Call Enterprise Bean.
|
Add an EJB module to an enterprise application. |
|
Edit an EJB module's deployment descriptors. |
- Expand Configuration Files node for the EJB module project.
- Double-click the deployment
descriptor.
|
Add or remove local and remote interfaces. |
- Expand Configuration Files node for the EJB module project.
- Double-click ejb-jar.xml to open the deployment descriptor
in a visual editor.
- Expand the Enterprise Bean Implementation and Interfaces section for
the enterprise bean.
- Select or unselect the checkbox for the appropriate interface.
|
Add a business method to an enterprise bean. |
- Open the bean class for the enterprise bean in the Source Editor.
- Right-click in the bean class and choose Insert Code > Add
Business Method.
|
Add a method to an interface. |
- Click the hint in the left margin next to the line containing the method in the Source Editor
and choose an interface from the popup menu.
|
Debug an EJB module. |
- If the module is part of an enterprise application, right-click the
enterprise application project and choose Debug
.
- If the module is a stand-alone EJB module, right-click the EJB module
project and choose Debug.
|
Repackage an existing EJB JAR file for deployment on a different application
server. |
- Create a Packaged Archive project
based on the existing EJB JAR file.
- In the new project, modify the appropriate configuration files and create
any necessary server-specific files.
|