Conclusion

Let's end with a very short summary of the stuff just described:

On the server

For each EJB (which could be a stateless session, a statefull session or an entitiy bean) we need three files:

  • bean implementation

  • remote interface

  • home interface

The resulting classes and one or more deployment desciptors (ejb-jar.xml, jboss.xml, ...) in the META-INF directory are together packaged into a jar file.

For deployment this jar file is simply copied to jboss/deploy/.

On the client

We code the client to

  • look up the home interface of the bean from the JNDI service

  • create a new bean or retrieve a existing one from the home interface

  • use the received remote interface to access the business methods of the bean implementation on the server

But before the client can look up a home interface, the client needs to know where the JNDI service is located. Therefore we have to provide a jndi.properties file. This file and some (most) jars from the jboss/client/ directory need to be included into the CLASSPATH to get the client running properly.