What is the difference between RMI and RPC?
RMI simply offers remote access to an object running in another
process. But EJB offers far more services than RMI. EJB leverages
this remote-object feature of RMI, but also provides other services
such as persistence, transaction management, security, and resource
management. The EJB server provides all of these complex services
which allows EJB developers to worry about business logic instead.
For a complete understanding of EJB i suggest
Http://edocs.bea.com/wle/rmi/sampejb.htm