EJB Development Quickstart with MyEclipse---7
天下维客,你可以修改的网络知识库
Running XDoclet Code Generation
Once you've configured your project's XDoclet settings you can run the XDoclet code generator at any time. Typically you should execute XDoclet after each change to the XDoclet EJB configuration or application server settings or when you modify the XDoclet annotations of any EJB bean implementation class.
Now is a good opportunity to execute XDoclet on the firstejb project and test the new XDoclet settings as Trader EJB has not yet been extended with new XDoclet-annotated business methods.
- To run XDoclet on the firstejb right-click on the project and select MyEclipse > Run XDoclet from the context-menu (see Figure 15).
Figure 15. Starting XDoclet code generation on EJB project
- Monitor the Console view for anomalous output messages from the xdoclet-build script. Figure 16 depicts XDoclet progress messages as the TraderBean class is processed.
Figure 16. Console output of Run XDoclet action
Upon XDoclet's completion the firstejb project should include new versions of the Trader and TraderHome interfaces and the ejb-jar.xml and jboss.xml deployment descriptors. Figure 17 depicts the initial generation of these new project resources.
Note: When we created the TraderBean.java class during Section 5, we specified its Java package name as com.genuitec.trader.ejb and emphasized that the package name end in ".ejb". This is because the Standard EJB XDoclet packageSubstitution subtask creates a corresponding Java package name ending in ".interfaces" and adds generated EJB and Home interfaces to it. In our example, the com.genuitec.trader.interfaces package was created and it contains the for the Trader EJB and TraderHome interfaces. If you did not follow this package naming convention and are using default XDoclet setting some of the files may not be generated.
Figure 17. Contents of EJB project before and after XDoclet generation






