• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

libraries

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Dorothy",
Please check your private messsages.
 
The happiness of your life depends upon the quality of your thoughts -Marcus Aurelius ... think about this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic