![]() |
|
![]() |
Did you ever wonder what goes on behind the scenes when you use a visual interactive tool (such as VisualAge for Java) to create enterprise bean JAR files? Do you ever need to create EJB JAR files without such a tool? If so, follow these steps to compile enterprise beans and create EJB JAR files that you can deploy on the WebSphere Application Server. We also provide an example batch file that automates this process for the Account and Transfer sample enterprise beans. You can modify this file for other enterprise beans you want to process, or use it as a basis for creating an automated script (such as a make file) for other operating systems. For further details, see:
Steps to compile enterprise beans and create EJB JAR files
Repeat these three steps (compile source, package into a JAR, run jetace) for each enterprise bean you are going to create and make ready for deployment. In the first step, to compile one enterprise bean that requires classes found in another enterprise bean, you can add any of the JAR files of the first enterprise bean to the compile CLASSPATH of the second enterprise bean. About jetaceThe first time you run jetace for a particular enterprise bean, you must run it in GUI (graphical user interface) mode. When in GUI mode, jetace lets you create an XML file, in addition to the output JAR file. This XML file contains all the information you enter through the GUI. It will allow you, in the future, to run jetace in line mode so you can automate this step. The next time you need to repeat this process for this enterprise bean, use the XML file as input to jetace and it will run automatically using the prior information. Example batch fileOur example Windows NT batch file, createbeans.bat, automates this process for the sample Account and Transfer enterprise beans. The batch process starts with the Account and Transfer source files, performs all the steps above using XML files to run jetace in line mode, and creates Account and Transfer EJB JAR files. Be sure to read the comments for a detailed step-by-step explanation. Follow our instructions to run
this batch file and test your own version of the Account and Transfer
enterprise beans. You can find the executable version of createbeans.bat,
plus the related source and XML files, in the <was_root>/hosts/default_host/WSsamples_app/servlets/
|