This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes [JBoss 6.0 M2] Best approach to build and  deploy an EAR archive Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "[JBoss 6.0 M2] Best approach to build and  deploy an EAR archive" Watch "[JBoss 6.0 M2] Best approach to build and  deploy an EAR archive" New topic
Author

[JBoss 6.0 M2] Best approach to build and deploy an EAR archive

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Hi,
I am wondering what is the best approach regarding the packaging and deployment of a new enterprise application that
I am working on.

This enterprise application has a web project and an EJB project.
My web project requires some external libraries.
So I have 2 otpions :
1) I either put them in web-project\WebContent\WEB-INF\lib
2) I put them in \jboss-6.0.0.M2\server\default\lib and then add them to the build path of the web-project, under Eclipse

If i use option 1, I of course end up with a somewhat large EAR archive since it contains the external libraries i am using.
Although it's not that big (17 MB).

If I use option 2, the EAR archive is kept at a minimum size.

So I see a matter of size.

Another aspect to take in consideration is the deployment in the production server.

I mean developers are running their own JBoss servers in their respective machines.
One of them will be in charge to generate the EAR archive and deploy it on the JBoss server, in the production server.

So then i am wondering what's best in that case ?
1) To drop the big EAR archive (17 MB) in the deploy folder of the JBoss server (production server)
2) To drop the small EAR archive in the deploy folder of the JBoss server (production server) and update the \jboss-6.0.0.M2\server\default\lib folder (production server)
with the needed libraries as they come along ?

Also, generally, what is an acceptable size for an EAR archive ? I am not aware of any standard or limitation regarding the size.

Maybe there are other ways to do it and that i do not know about.

Thanks for your help.


SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Option 1 (in both cases) is the typical mechanism used. An alternative with an EAR is to place the library JARs into a lib directory in the EAR. But that usually depends on the JARs - if the JARs are for a UI framework (such a Struts 2), then in the WAR file would be a better location; but if they are utility JARs (such as one of Apache's commons libraries) then the EAR file might be best. JDBC driver JAR files, on the other hand, should go in the common/lib or server/xxx/lib directory.

There are no general guidelines as to WAR or EAR file size. I have seen some huge ones, especially for Grails apps!



JBoss In Action
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

Thanks Peter for this quick answer. That's reassuring.
 
 
subject: [JBoss 6.0 M2] Best approach to build and deploy an EAR archive
 
Similar Threads
Deploying a dynamic web project output as folder in eclipse
IBM Exam 157 - Questions and Answers (Sample Exam)
JBOSS 4.3.0 EAP Clustering with Apache HTTP Server 2.2.11
problem with run.bat(JBoss)
Class Loading Configuration