EAR vs separate EJB + WAR

前端 未结 2 2047
野趣味
野趣味 2020-12-04 17:03

What\'s the difference in deploying application as EAR (with 1 EJB and 1 WAR module) vs separate modules? I want to use GlassFish 3 web profile but it does not support EAR a

2条回答
  •  不知归路
    2020-12-04 17:49

    Whats the difference in deploying application as ear (with 1 ejb and 1 war module) vs separate modules?

    Not a complete list: In an EAR you can define Utility JARs as well, they are located in e.g. EAR/lib and can be reused by WARs and EJB JARs. Often EAR files provide prorietary deployment features, e.g. in WebSphere you can specify DataSource details, so that you do not have to define a DataSource (and JDBC driver) using management utilitiers.

    Since I want use Glassfish 3 web profile, but it does not support ear archive. Can I simply use ejb and war as separate modules? Any other options?

    Yes, the web profile spec explicitly allows you to deploy a lightweight EJB version as part of the WAR. Simply place the EJB JAR inside the WARs WEB-INF/lib. This link provides a comparison of features (Web profile vs full-blown): http://glassfish.java.net/downloads/v3-final.html

提交回复
热议问题