What is an Enterprise Java Bean really?

前端 未结 7 1868
小鲜肉
小鲜肉 2021-02-05 18:59

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
  • <
7条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-05 19:10

    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.

提交回复
热议问题