NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

EAR vs WAR

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
eialbur



Joined: 15 Jun 2010
Posts: 19

PostPosted: Sat Feb 26, 2011 6:34 pm    Post subject: EAR vs WAR Reply with quote

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

PostPosted: Thu Mar 03, 2011 4:31 pm    Post subject: Reply with quote

Nobody has an answer to this question?
Back to top
Tony
Posted via mailing list.





PostPosted: Sat Mar 05, 2011 9:43 am    Post subject: Re: EAR vs WAR Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
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 cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo