How to write a simple EJB
A simple EJB contains remote/local interface, and a class which implements that interface along with an optional configuration file (XML). For the following example, JBoss Application Server 4.2.3.GA has been used where the EJB would be deployed and tested. You have to add the following external JARs also from the JBoss Application Server client and server libraries to be able to import the javax.ejb.* libraries and the @Remote Annotation: - From ...\jboss-4.2.3.GA\client\: Add jbossall-client.jar and jnp-client.jar . - From ...\\jboss-4.2.3.GA\server\default\lib\: Add ejb3-persistence.jar and jboss-ejb3x.jar Now, let's start writing the EJB: Remote/Local Interface: Consider the following interface: import javax.ejb.*; @Remote public interface MyRemoteInterface{ public String SayHello(String name); } A Bean implementation class: Now, write the implementation of the interface as follows: import javax.ejb.*; @Stateless public class ...