0

EJB2.0 with OpenEJB: Entity Bean (CMP) and the Remote Client

I figured this one out months back and just kept an archived copy of the application’s source codes and a custom-configured OpenEJB. Fortunately, I have not lost them.

Software Applications used:

  • WinXPSP3
  • Virtual Machine (e.g., vmware)
  • Eclipse 3.4.2
  • OpenEJB 3.1.4
  • Openlogic Mysql 4.1.22 (or simple MySQL)
  • JDK 1.6 update 21
  • MySQL Connector 5.0.8

Step 1 – Place the MySQL connector in OpenEJB’s lib folder

openejb_lib_mysqlconnector

Step 2 – Modify openejb.xml to include the following configuration

Step 3 – Create a MySQL database

openejb_mysql_database

Step 4 – Create or modify persistence.xml

Step 5 – Create or modify ejb-jar.xml

Step 6 – Create the Java Codes

The client class

The Entity Bean

The Home interface

The Remote Component interface

Step 7 – Place files in appropriate directories

openejb_entitybean_cmp_file_placements

openejb_entitybean_cmp_file_placements2