Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

libraries

 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I need some guidance on the portal approach. If I have a portal application in which all of the portlets(separate war files) are using some framework jars. The framework is the one that my org. follows. Since all the portlets use it can I share it at a common location or I have to put them in the portlet's WEB-INF\lib folder only for all the oirtlets.

Similarly if there are some other jars that are being used by all teh portlets, can I put them in a shared location?

Thanks
 
Hemant Sharma
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You can put all the common jars in the shared\app\ directory of the portal server.
 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer, but can you please tell that if suppose the version of the jar changes quite frequently, even then is it advisable to keep in shared/app or should it be in WEB-INF in this case, so that every time the version change happens the portal needn't be rebuit?
 
Hemant Sharma
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If you keep the jar in WEB-INF/lib and the jar is changing frequently, then you will need a fresh deployment (even though there was no change in portlet application) every time the jar is updated.

Its always good to keep common jars in shared/app.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I always vote to put jar files in the web-inf\lib directory, as opposed to the servers app directory. I wrote an article on application packaging and classloaders that you might find interesting:

How to package J2EE applications: Classloaders and lib directories

Here's the thing - say you've got xerces1.1.jar in your shared\app folder. Then, one of your 1000 apps wants to use xerces2.0? You've got to update and test ALL 1000 apps before this one app can move.

Alternatively, if each app puts it's xerces jar in its local WEB-INF\lib directory, the app can be upgraded to a newer version without bothering all of the other 1000 apps on the server.

Of course, if all the apps hit the same db2, then the db2 driver should be on the shared\apps folder. For that matter, when you upgrage to a newer version of db2, all apps will have to update at the same time, so there it makes sense.

Indeed, putting things int he web-inf\lib directory will require a re-deploy of the app. Hopefully, though, updating a jar file is a very controlled, and regression-tested process that doesn't happen all that often.

As with most J2EE things, there are no right answers, there are only wrong answers. If you can manage not to get a wrong answer, you're doing good.

-Cameron McKenzie
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Dorothy",
Please check your private messsages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic