This feature is only supported in the Ultimate edition.
IntelliJ IDEA provides the following ways to create beans:
- Manually, by means of direct editing the
ejb-jar.xmlfile, using the extensive coding assistance provided by IntelliJ IDEA. - Using the context menu commands.
- Open the deployment descriptor file
ejb-jar.xmlfor editing. - Create the
<enterprise-beans>section. - In this section, create tags for the desired bean types:
<session>,<entity>, or<message-driven > - Specify the bean name and class by adding tags
<ejb-name>. and<ejb-class>. Note that you can specify the target package in this tag, for example,samples.ejb.ManuallyCreatedEntity, using code completion after each dot. - If the declared class does not yet exist, IntelliJ IDEA suggests a quick fix:

Choose from the suggestion list. If the target package was not defined in the
<ejb-class>tag, select the desired package in the Choose Destination Directory dialog box. The stub class is created in the specified location. - Proceed with defining the other bean components.
- Open the EJB tool window.
- Right-click the desired module,
choose on the context menu, and then select the bean type on the submenu.
The New <bean type> Bean dialog box opens.
Alternatively, choose on the context menu of a module, to open the dedicated editor, in the General tab click New, or right-click the diagram background in the EJB Relationships tab, and select the desired bean type.
- Specify the bean name, class and package.
- Define the bean-specific settings:
- For Entity beans (1.x and 2.x) and Session beans (1.x and 2.x), configure local and remote interfaces.
- For Entity beans (1.x and 2.x), configure primary keys and CMP bean fields.
- For Message beans, configure message listener.
- For Session beans, configure service endpoint.