• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

questions about EARs and Assembling and deploying multiple web applications

 
Michael Arnett
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
I need multiple web applications to a single server. None of these applications currently utilize any EJBs, just servlets, beans, and jsps. Would it be appropriate to jar these web applications (war files) into a single ear for deployment? If so, how is it possible to have them 'share' a single jar, if that is indeed possible? If any of my assumptions appear erroneous, please let me know. I am still n ot entirely clear on what the purpose/advantages of a ear file is.
Thanks in advance,
-MLA
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, you can place multiple WAR's in a single EAR. That way they can share several "utility" JAR files placed in the root directory of the EAR (so things like Log4J, etc. could be shared).
Kyle
 
Michael Arnett
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the info Kyle. One other question: Is it possible to have classpath elements relative to the server's root directory, rather than relative to the ear's root directory or the web application's root directory?
Thanks again,
-MLA
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Arnett:
Thanks for the info Kyle. One other question: Is it possible to have classpath elements relative to the server's root directory, rather than relative to the ear's root directory or the web application's root directory?
Thanks again,
-MLA

That would require knowing about the internal structure of the appserver and violate the portability of the webapps. And, in extreme cases, wouldn't even exist.
For example, I run JOnAS for EJBs, Tomcat for servlets/JSPs and Apache for the front-end. The Tomcat components are placed in OS binary directories, not in a special directory all their own. So what would be the "server directory???"
If you do need such creatures, the best way to map them is via an environment definition. But make sure you really do need them!
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree - in general, I would keep any JARs that you need wrapped up inside the EAR or WAR files as it makes deployment and manageability much, much easier.
Simon
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic