NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
eialbur
Joined: 15 Jun 2010 Posts: 19
|
Posted: Sat Feb 26, 2011 6:34 pm Post subject: EAR vs WAR |
|
|
I have read and understood the definitions of EAR and WAR files, but I have a question regarding the practical application of them.
I have a project that is a bunch of Servlets backed by EJBs. I've been playing around with different ways of structuring the project in Netbeans and have discovered that I can make an Enterprise Application that contains the EJB JAR and the Servlet WAR - however it also seems to work if I just have a WAR file that picks up the EJB JAR file.
Are these two approaches functionally equivalent? I'm running on Glassfish ... does Glassfish magically treat the WAR as if it were an EAR? When I deploy Glassfish does print out a list of all of the EJBs in the JAR file, so it must realize that they are EJBs. |
|
| Back to top |
|
 |
eialbur
Joined: 15 Jun 2010 Posts: 19
|
Posted: Thu Mar 03, 2011 4:31 pm Post subject: |
|
|
| Nobody has an answer to this question? |
|
| Back to top |
|
 |
Tony Posted via mailing list.
|
Posted: Sat Mar 05, 2011 9:43 am Post subject: Re: EAR vs WAR |
|
|
If you are using the latest version of Glassfish with support for the latest
J2EE specification (as it seems you must be) then it is permitted to include
EJBs inside a WAR.
I believe this was intended to simplify development.
However, I personally believe that unless your application is intended to
remain extremely simple, it is still the best policy to separate the
business logic from the user interface, which is the design pattern behind
the use of separate WAR and EJB packages. (Put simply, an EAR package is
just a way to combine related WAR and EJB packages for deployment).
Additionally, there are performance considerations to take into account.
Unless I'm totally off-base, most application servers run separate EJB's in
a different 'worker' thread ... this means that there is implicit support
for large scale deployments with separation of business logic into the EJBs
also offering the ability to scale across multiple servers if required.
Tony
-----Original Message-----
From: eialbur [mailto:address-removed]
Sent: 26 February 2011 18:34
To: address-removed
Subject: [nbj2ee] EAR vs WAR
I have read and understood the definitions of EAR and WAR files, but I have
a question regarding the practical application of them.
I have a project that is a bunch of Servlets backed by EJBs. I've been
playing around with different ways of structuring the project in Netbeans
and have discovered that I can make an Enterprise Application that contains
the EJB JAR and the Servlet WAR - however it also seems to work if I just
have a WAR file that picks up the EJB JAR file.
Are these two approaches functionally equivalent? I'm running on Glassfish
... does Glassfish magically treat the WAR as if it were an EAR? When I
deploy Glassfish does print out a list of all of the EJBs in the JAR file,
so it must realize that they are EJBs. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|