Packaging EJB in JavaEE 6 WAR vs EAR

前端 未结 5 783
春和景丽
春和景丽 2020-11-29 01:15

Starting a new project and would like to know the pros and cons of packaging EJB in a WAR vs EAR.

Will JNDI still works when EJBs are in the WAR? efficiency? etc.?

5条回答
  •  星月不相逢
    2020-11-29 01:44

    So far this is what I got.

    EJB in WAR

    pros:

    1. Simpler to develop and deploy

    2. You can expose Session Bean methods as REST service with @Path annotation. See here

    cons:

    1. JNDI lookup is not supported, so I believe you cannot do RMI from another application client

    2. As arjan pointed out it lacks modularity in design.

提交回复
热议问题