How To Create EJB’s In Eclipse IDE

Here I am assuming that you are aware of creating J2EE Module In Eclipse IDE. To know more click here. So Suppose you have an EJB Module created in IDE, Then for example we will create a stateless session bean by following these steps.

  1. Under SessionEJB Module select “Session Bean” option and click “Next” – >” XDoclet Enterprise JavaBean” option.
  2. Following window will be shown so select “Session Bean” and click “Next”.
  3. Add package name and other relevant information in the next window.
  4. Click “Next”. This is an important part select state type “Stateless” and transaction type as “Container” as we are not going to write any transaction code.
  5. Click “Next” and fill more information but remember to follow concepts of EJB’s.
  6. As soon you “Finish” Xdoclet will automatically build the code, remote and home interfaces will be generated. Using Xdoclet this EJB can be easily edited.