Compiling the EJB

The EJBWizard is designed to generate all the basic parts of an EJB and support services. However, it is not a full lifecycle IDE. Once you've generated the EJB, you should do the following:

  1. Review the "build.xml" file for any changes you may need to make. To better fit site standards/requirements, you can copy the build.model file from the EJBWizard/templates directory into a templates subdirectory of the project and customize it.

  2. For BMP Entity EJBs, edit the generated SQL code in the bean definition as needed.

  3. Add business logic to the EJB file. The EJBWizard only generates the business method definitions, not their logic.

  4. If you are planning on using the generated JSPs, edit the JSP controller class as needed - this usually means adding input data validation logic - and customize the JSP's as needed.

  5. Review the remaining code for any corrections and customizations you may need.

  6. Run the Ant tool using the build.xml file (this is the default name used by Ant) to build the EJB jar and/or its J2EE jar (which contains the JSP source and controller classes in a form that makes it easier to extract them and load them into a WAR file).

Although the EJBWizard does not have the ability to go back and re-edit generated code, if you generate an EJB into a directory containing an existing EJB, the old files will be saved with a ".bak" extension. Some program editing environments, such as Emacs contain the ability to compare and merge two versions of a file, so this can be helpful. This feature should be used with care, however. Only one backup copy is kept. Previous backup versions will be overwritten.