Basically all the previous messages do a good job by interpreting what an EJB is, let me try to interpret EJB with my variation.
Apart from JavaBean and EJB are written in Java, there is no connection between the two.
Javabean is a set of specification to be followed which will facilitate the bean to be used in an integrated development environment (
IDE). Javabean is used in the client side
EJB is a server side distributed component model which is used to develop distributed, scalable, interoperable business object.
EJB is used on the server side. It can not be used on the client side.
EJB specificies the contract between the various players in the enterprise development.
The players in the enterprise development are
Enterprise Bean Provider
Application Assembler
Deployer
EJB Server Provider
EJB Container Provider
System Administrator
EJB Server Provider and EJB Container Provider provide the infrastructure needed to run the EJB such as naming, security, transaction management.
Enterprise Bean Provider concentrates on the business logic without any concern of the transaction management or the platform where it be deployed.
EJB can be deployed in any vendor provided EJB Server and container.