EJB3 Local and Remote interfaces

前端 未结 4 1446
野的像风
野的像风 2021-02-07 02:23

I understood that Local interface is designed for clients in the same container\'s JVM instance and remote interface is designed for clients residing outside the EJB container\'

4条回答
  •  情深已故
    2021-02-07 02:37

    Officially @Local annotated beans can only be accessed if they're in the same application. A .war deployed separately from an .ear (or other .war or other .jar EJB) is a different application, even when deployed to the same application server instance.

    There's thus no guarantee that the code in your .war can call @Local EJB beans that are defined in the .ear.

    However, in practice in nearly all application servers this just works.

    There's a request for the EJB 3.2 spec to officially support local cross-application calls: https://download.oracle.com/otndocs/jcp/ejb-3_2-fr-spec

提交回复
热议问题