• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Best packaging and deployment strategy for web applications

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

In our current project under development, we have multiple J2EE web applications.

The j2EE server chosen in JBoss 5.x GA

I have question regarding the best packaging structure:

The current practice is
All common functions are packaged into a commons.jar
All web applications are packaged into individual .WAR files and those into individual ,EAR files

The same is then deployed by

Copying the commons.jar into <<jboss-5.1.0.GA>>\server\default\lib
and the multiple EARs (each containing a single WAR) in <<jboss-5.1.0.GA>>\server\default\deploy

JBoss picks up the EAR and explodes it in the default\tmp folder and everything works.

However, this requires JBoss to be restarted only whenever "commons.jar" is updated.
JBoss detects any change in EAR copied into 'deploy' folder deploys automatically, no restart is required.

But, my question is it nessacary to have multiple EAR?

What could be the benefit?

I feel there should be a single EAR fils having everything commons.jar + the multiple WARs
The single EAR when copied into "<<jboss-5.1.0.GA>>\server\default\deploy" should deploy and all web applications work seamlessly.

The only reasoning I could get was the multiple WARs are under development by different teams which have different release dates.
By keeping all WAR's in a single EAR, every time a WAR is to be released, the entire EAR will have to be packaged and deployed.

This could have adverse effect on the other WARs
Another reason was to avoid packaging of the entire EAR (into which could go in a unintended version of a WAR) and deploying it,

And so multiple EARs are being maintained.

Any comments?

thank you.
g1

PS: Tech stack: j2EE, Struts, Spring, Hibernate and Oracle,
We are using a single JBoss server and not a cluster.
We are employing Ant and plain eclipse, no Jboss eclipse tools in development
 
Ranch Hand
Posts: 128
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My understanding is, an EAR is used for packaging one or more modules into a single archive so that the deployment of the various modules onto an application server happens simultaneously and coherently. You can embed different artifacts within an EAR file for deployment by application servers:
1) A Web module that has a .war extension.
2) POJO Java classes may be deployed in .jar files.
3) An EJB module that has a .jar extension.
4) A Resource Adapter module that has a .rar extension.

Although it will not cause any issue but there is no logic putting a single war inside an ear. Either you make an ear including all of your war or deploy each war independently without putting them into an ear.

By the way, this question has nothing do to with JBoss. Its your own decision how you want to package and deploy your web application into any of the application server.


Thanks,
Uttam Kumar
 
Jeevan Sunkersett
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Uttam,

Yes, I feel the same way.... a single EAR should suffice, with all the WAR's, JARs, ejb-jars in it.

But I am not able to push this forward as I am unable to get an effective answer to bypass their concern:

The only reasoning I could get was the multiple WARs are under development by different teams which have different release dates.
By keeping all WAR's in a single EAR, every time a WAR is to be released, the entire EAR will have to be packaged and deployed.

Which may have adverse effect on the other already working web applications (like down time for all would be required)

Another reason was to avoid packaging into a single EAR, was an unintended version of a WAR may get packaged and deployed.

And so multiple EARs are being maintained.



thank you
~g1

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

All web applications are packaged into individual .WAR files and those into individual ,EAR files



Why do you need an additional .ear packaging over a .war if the .ear just contains that single .war? You can just deploy those individual .war files.

However, this requires JBoss to be restarted only whenever "commons.jar" is updated.



That's a classic classloader issue and one of the reasons why placing the application jars in JBOSS_HOME/server/<servername>/lib isn't recommended. More details here:

http://community.jboss.org/wiki/jbossclassloadingusecases
http://community.jboss.org/wiki/classloadingconfiguration
 
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic