Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sharing resources between EARs

 
Andrew Sweeney
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there everyone,


I'm trying to share some code (a couple of util classes or so) between EARs w/in WAS 4.0. Is there a good way to do this, outside of packaging two versions into the underlying JARs? This may be a very rudimentary problem, but I await your ideas... Thanks!
[ April 09, 2002: Message edited by: Andrew Sweeney ]
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, this can't be done, don't try it. EARs are meant to be separate, totally self-contained appliation packages. Just add the same ZIP or JAR file inside both EARs and update the manifest files of your WAR and EJB-JAR files appropriately.
Yes, there are classpaths in WebSphere that are shared by all EAR files, but DON'T USE THEM!
Kyle
 
Se Ravin
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kyle,
We have some 10 web applications under an appserver and all are using log4j as the logging tool,I have put log4j jar file in the AppServers class path.Is this not the correct way to do?
Should i put them in all the ear file?
Expecting ur reply,
Senthil
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IMHO, yes, Log4J should be included in the EAR file of each. Imagine what would happen if ONE of your 10 apps moved to a different level of Log4J than the other ones -- what you've done is create a dependency between your applications that shouldn't exist.
Don't worry about having multiple copies of the same code -- the space is not enough to worry about.
Kyle
 
Andrew Sweeney
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kyle,
I think my apprehension stems not from the storage issue, but more of a maintenance one. Imagine you have sixty EARs deployed, when the decision comes down that all apps now need a larger audit trail. This will involve going into every EAR and making the change within the code. Is there a way to maintain resource integrity, while still ensuring efficient maintainability?
-Andrew
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, we would advocate having a build process for your EARs that comes straight out of your source code repository (PVCS, ClearCase, CVS, etc.) so that when after an EAR is built it doesn't have to be monkeyed with. When you update your app, you request a build and voila, you get an up-to-date, complete EAR that you then redeploy.
Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic