Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is an Enterprise Java Bean really?

On the Tomcat FAQ it says: "Tomcat is not an EJB server. Tomcat is not a full J2EE server."

But if I:

  • use Spring to supply an application context
  • annotate my entities with JPA annotations (and use Hibernate as a JPA provider)
  • configure C3P0 as a connection pooling data source
  • annotate my service methods with @Transactional (and use Atomikos as JTA provider)
  • Use JAXB for marshalling and unmarshalling
  • and possibly add my own JNDI capability

then don't I effectively have a Java EE application server? And then aren't my beans EJBs? Or is there some other defining characteristic?

What is it that a Java EE compliant app server gives you that you can't easily/readily get from Tomcat with some 3rd party subsystems?

like image 691
HDave Avatar asked Jun 07 '10 20:06

HDave


People also ask

Why are Enterprise Java Beans used?

Enterprise JavaBeans (EJB) technology is the server-side component architecture for Java Platform, Enterprise Edition (Java EE). EJB technology enables rapid and simplified development of distributed, transactional, secure and portable applications based on Java technology.

What is meant by Enterprise Java Beans?

Enterprise JavaBeans (EJB) is an architecture for setting up program components, written in the Java programming language, that run in the server parts of a computer network that uses the client/server model.

What type of bean is enterprise?

There are three types of EJBs: Session Bean, Entity Bean, and Message-Driven Bean.

Are Enterprise Java Beans still used?

To "Core Java, Volume II" author. Well, EJB is certainly alive and very well in Java Persistence Architecture (JPA). JPA is a subset of the EJB3 standard.


1 Answers

EJBs are JavaEE components that conform to the javax.ejb API.

JavaEE is a collection of APIs, you don't need to use all of them.

Tomcat is a "partial" JavaEE server, in that it only implements some of the JavaEE APIs, such as Servlets and JNDI. It doesn't implement e.g. EJB and JMS, so it's not a full JavaEE implementation.

If you added some additional bits and pieces (e.g. OpenEJB, HornetQ), you'd add the missing parts, and you'd end up with a full JavaEE server. But out of the box, Tomcat isn't that, and doesn't try to be.

like image 103
skaffman Avatar answered Oct 04 '22 01:10

skaffman