well, RMI is Remote Method Invocation. Its a protocol by which distributed objects can communicate with each other. Sun Microsystems has provided Java implementation of this RMI protocol. There could be many implementations of RMI.

EJB, Enterprise JavaBeans, is a distributed component model provided by Sun Microsystems. EJB is based on RMI protocol and it uses Java RMI as core implementation. You can say, EJB is 10 steps ahead of Java RMI with its many features like creating components, deploying them into application server and many other features.

As you noted, using EJB really looks like RMI. It is natural
because the underlying network protocol of EJB is RMI-IIOP which is used to implement remote method invocation. You can
also find that the methods in EJB remote interface are required to throw RemoteException and the arguments must have seriolizable or primitive data type-- which are very much like the rmi requirements. Also EJB container generates
stubs/skeletons which are also generated by rmic.

But, EJB goes far beyond RMI.

First, the underlying network protocol of EJB1.1 is RMI-IIOP, rather than RMI. RMI-IIOP is an extension of RMI protocol. (To see the difference, refer to Rodman's Mastering EJB book).

Second, RMI-IIOP is just a network protocol, while EJB container is a powerful software package built upon this protocol. When you use EJB, the EJB container can do a lot of things, such as bean management, transaction managment, resource managment etc. All of these managment are transparant to EJB programmers who does not need to worry about synchorization and concurrency which are big problems for system programmmers.

TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations technology projects - with its network of technology-specific websites, events and online magazines.