Creating a Single Action EJB

To create a Single Action EJB, do the following:
  1. In the J2EE perspective of the WebSphere Studio Application Developer, select from the menu File > New > Enterprise Application Project to load the New Enterprise Application Project window.
  2. Create a new J2EE 1.3 Enterprise Application project and its associated EJB module. You can also use an existing EJB module.

    Assign a name to your Enterprise application project

  3. In your Application Developer, right-click the EJB module of your J2EE project, and select Properties. A window pops up.
  4. In the left navigation tree of the new window, select Java Build Path.
  5. On the right panel, select the Libraries tab.
  6. Click the Add External JARs button. The JAR Selection window pops up.
  7. Browse to the following .jar files and add them as the external JARs:
    • BTTBase.jar
    • BTTFormatter.jar
    • BTTServerBean.jar
    • BTTServicesInfra.jar
    You can find these .jar files in the /jars directory of your toolkit installation folder.
  8. Click Add Variable on the right side of the Properties window. In the New Variable Classpath Entry window, select the WAS_EE_V51 entry and click Extend.

    The New Variable Classpath Entry window

  9. In the Variable Extension window that pops up, you see a folder named lib. Under the lib folder, select the following .jar files and click OK.
    • acwa.jar
    • distexcep.jar
    • qname.jar
    • wsatlib.jar
    • wsif.jar
  10. Right-click the EJB module of your J2EE project, select New > Enterprise Bean to create a session EJB.
  11. When the wizard prompts for session type, select either Stateful or Statelesss according to your need.

    Choose either Stateful or Stateless as the session type for your Single Action EJB

  12. When the wizard prompts for the Bean superclass, enter com.ibm.btt.server.bean.BaseSingleAction.
  13. Click Finish. Your Single Action EJB is created but is now with errors.
  14. Write your business logic into the bean based on the methods that the BaseSingleAction offers.
  15. Configure your Single Action EJB.
Note that you need to create a corresponding invoker for every Single Action EJB you create.
Related tasks
Configuring a Single Action EJB