aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes questions about EARs and Assembling and deploying multiple web applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "questions about EARs and Assembling and deploying multiple web applications" Watch "questions about EARs and Assembling and deploying multiple web applications" New topic
Author

questions about EARs and Assembling and deploying multiple web applications

Michael Arnett
Ranch Hand

Joined: Mar 22, 2001
Posts: 65
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


Sun Certified Programmer for the Java 2 Platform 1.4
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
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


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Michael Arnett
Ranch Hand

Joined: Mar 22, 2001
Posts: 65
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

Joined: Jun 25, 2001
Posts: 16141
    
  21

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!


Customer surveys are for companies who didn't pay proper attention to begin with.
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: questions about EARs and Assembling and deploying multiple web applications