Generating code for EJB deployment

This task assumes you have already assembled an enterprise bean (EJB) module, added it to an application, saved the application, and verified the application.

Before installing your application in WAS, generate deployment code for the application. This step is required for EJB modules and for any enterprise application archive (EAR) files that contain EJB modules. During code generation, the Assembly Toolkit prepares entity bean (JAR) files for deployment in a run-time environment. If your EJB project contains container-managed persistence (CMP) beans that have not been mapped, generating deployment code creates a default top-down mapping.

  1. If you have turned automatic validation off, manually validate your enterprise beans before generating deployment code for them. If validating your beans results in compilation errors or validation errors, fix the errors before generating deployment code. However, if validating your beans results in warning or information messages, you can generate deployment code.

  2. If you have changed the class path of your EJB project, ensure that the source folder for your EJB project is at the beginning of the class path of the project. Generating deployment code imports both the JAR file and the source code of the JAR file, so entries on the class path must be in the correct order.

  3. In the J2EE Hierarchy view of the Assembly Toolkit, right-click on the enterprise application EAR(file) or EJB module (enterprise bean JAR file) for which you want to generate code for deployment.

  4. Click a Generate Deployment Code option.

    • For EAR files, click Generate Deployment Code.

    • For enterprise bean JAR files, click Generate > Deployment and RMIC Code > EJB_module > Finish.

    Alternatively, you can generate deployment code for enterprise bean JAR files using the deployment tool for Enterprise JavaBeans (ejbdeploy) from a command prompt. For a detailed list of available options in the EJBDeploy tool, enter ejbdeploy from a command prompt.

Code is generated into the folder where your enterprise beans are located. Problems with the generation of Java RMI stub compiler (RMIC) code result in a window that displays error messages.

Install the Java 2 Platform, Enterprise Edition (J2EE) application on your server machine. You can install the application onto a server using the administrative console. Before installing the application, you might need to set class paths.


See Also

Application assembly and J2EE applications