Re: Tomcat 8 : Shared loader

2016-06-15 Thread Amit Pande
Thank you Mark for your valuable inputs. They are indeed a great help.

Thanks,
Amit

On 15/06/16 7:00 pm, "Mark Thomas"  wrote:

>On 15/06/2016 12:03, Amit Pande wrote:
>> 
>> 
>> On 15/06/16 4:06 pm, "Mark Thomas"  wrote:
>> 
>>> On 15/06/2016 11:00, Amit Pande wrote:
 We develop multiple web application which happen to share the same
 stack (Spring, Hibernate,etc).

 Thinking of sharing these third party libraries instead of duplicating
 in each web app war.
>>>
>>> Why?
>> To avoid jar duplication and improve memory footprint
>
>Is memory footprint really that much of an issue?
>
 IIUC, putting those in Tomcat (8)'s lib folder might cause issues
since
 the classes in there are loaded by a common loader.
>>>
>>> What issues?
>> Since loaded by a common class loader , the jars put in here will be
>> available to tomcat internal classes,even if not required , also need be
>> to thread safe.
>
>What is the harm in these classes being visible to Tomcat?
>
>I fail to see what thread-safety has to do with this.
>
>You do need to think about memory leaks though.
>
 And sharing such libraries using the shared loader seems a better
 approach.
>>>
>>> Why?
>> As loaded by shared loader which seems to be meant for sharing
>> libraries across web apps ŠI guess here also the thread safely concern
>> exists , need to validate though.
>
>As above, thread-safety is not a relevant concern.
>
 Is my understanding correct ?
>>>
>>> No idea. You have not explained your understanding yet.
>> Hope it is explained now.
>
>It has. And your understanding, particularly around thread safety is not
>correct.
>
 Does it have any further issues ?
>>>
>>> Further issues compared to what?
>> It was a general awareness question to get to know if people ran into
>> some issues after putting jars in tomcat¹s shared loader's path.
>
>It increases the risk of issues due to:
>- memory leaks since few libraries are written with a multi-class loader
>environment in mind
>- upgrades are harder since you have to take Tomcat down to upgrade any
>shared library
>- dependency management is harder since all webapps have to use the same
>set of dependencies
>
 That said, I don't see much documentation around using shared loader.
 Any documentation/help in this regard is highly appreciated.
>>>
>>> There isn't much call for the shared loader. You need to go back to the
>>> 5.5.x documentation for a diagram that includes the shared loader.
>>>
>>> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html
>> 
>> Thanks for this. In absence of clear documentation in recent release, I
>> was doubtful if it was deprecated.
>
>Not deprecated. Just rarely useful so disabled by default.
>
>Generally, it causes more problems than it solves so unless you are
>really under memory pressure it isn't worth the trouble.
>
>Mark
>
>
>-
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org
>



Re: Tomcat 8 : Shared loader

2016-06-15 Thread Mark Thomas
On 15/06/2016 12:03, Amit Pande wrote:
> 
> 
> On 15/06/16 4:06 pm, "Mark Thomas"  wrote:
> 
>> On 15/06/2016 11:00, Amit Pande wrote:
>>> We develop multiple web application which happen to share the same
>>> stack (Spring, Hibernate,etc).
>>>
>>> Thinking of sharing these third party libraries instead of duplicating
>>> in each web app war.
>>
>> Why?
> To avoid jar duplication and improve memory footprint

Is memory footprint really that much of an issue?

>>> IIUC, putting those in Tomcat (8)'s lib folder might cause issues since
>>> the classes in there are loaded by a common loader.
>>
>> What issues?
> Since loaded by a common class loader , the jars put in here will be
> available to tomcat internal classes,even if not required , also need be
> to thread safe.

What is the harm in these classes being visible to Tomcat?

I fail to see what thread-safety has to do with this.

You do need to think about memory leaks though.

>>> And sharing such libraries using the shared loader seems a better
>>> approach.
>>
>> Why?
> As loaded by shared loader which seems to be meant for sharing
> libraries across web apps ŠI guess here also the thread safely concern
> exists , need to validate though.

As above, thread-safety is not a relevant concern.

>>> Is my understanding correct ?
>>
>> No idea. You have not explained your understanding yet.
> Hope it is explained now.

It has. And your understanding, particularly around thread safety is not
correct.

>>> Does it have any further issues ?
>>
>> Further issues compared to what?
> It was a general awareness question to get to know if people ran into
> some issues after putting jars in tomcat¹s shared loader's path.

It increases the risk of issues due to:
- memory leaks since few libraries are written with a multi-class loader
environment in mind
- upgrades are harder since you have to take Tomcat down to upgrade any
shared library
- dependency management is harder since all webapps have to use the same
set of dependencies

>>> That said, I don't see much documentation around using shared loader.
>>> Any documentation/help in this regard is highly appreciated.
>>
>> There isn't much call for the shared loader. You need to go back to the
>> 5.5.x documentation for a diagram that includes the shared loader.
>>
>> http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html
> 
> Thanks for this. In absence of clear documentation in recent release, I
> was doubtful if it was deprecated.

Not deprecated. Just rarely useful so disabled by default.

Generally, it causes more problems than it solves so unless you are
really under memory pressure it isn't worth the trouble.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat 8 : Shared loader

2016-06-15 Thread Lulseged Zerfu
No issues except that you may need to update jarsToSkip if not already in that 
list.
BRLulseged

> From: amit.pa...@veritas.com
> To: users@tomcat.apache.org
> Subject: Re: Tomcat 8 : Shared loader
> Date: Wed, 15 Jun 2016 12:46:40 +
> 
> Thanks a lot, Lulseged for your inputs.
> 
> With this approach, did you see any apparent issues / precautions that we
> should be aware of ?
> 
> Thanks,
> Amit
> 
> On 15/06/16 3:54 pm, "Lulseged Zerfu" <zlulse...@hotmail.com> wrote:
> 
> >It should be shared.loader:
> >shared.loader="${catalina.base}/shared"
> >
> >> From: zlulse...@hotmail.com
> >> To: users@tomcat.apache.org
> >> Subject: RE: Tomcat 8 : Shared loader
> >> Date: Wed, 15 Jun 2016 10:21:39 +
> >> 
> >> Hi
> >> I have also same problem and have solved it by using shared folder.
> >> Look at the catalina.properties file under $CATALINA_HOME/conf
> >> You can look in to the common.loader an server.loader how to define
> >>loaders. 
> >> You should add loaders in the same way in the shared.loader.
> >> I have created $CATALINA_HOME/shared and added my libraries here.
> >> server.loader="${catalina.base}/shared"
> >> Hope it helps.
> >> Lulseged Zerfu
> >> 
> >> > From: amit.pa...@veritas.com
> >> > To: users@tomcat.apache.org
> >> > Subject: Tomcat 8 : Shared loader
> >> > Date: Wed, 15 Jun 2016 10:00:51 +
> >> > 
> >> > We develop multiple web application which happen to share the same
> >>stack (Spring, Hibernate,etc).
> >> > 
> >> > Thinking of sharing these third party libraries instead of
> >>duplicating in each web app war.
> >> > 
> >> > IIUC, putting those in Tomcat (8)'s lib folder might cause issues
> >>since the classes in there are loaded by a common loader.
> >> > 
> >> > And sharing such libraries using the shared loader seems a better
> >>approach.  Is my understanding correct ? Does it have any further issues
> >>?
> >> > 
> >> > That said, I don't see much documentation around using shared loader.
> >>Any documentation/help in this regard is highly appreciated.
> >> > 
> >> > Thanks,
> >> > Amit
> >> > 
> >>  
> >   
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
  

Re: Tomcat 8 : Shared loader

2016-06-15 Thread Amit Pande
Thanks a lot, Lulseged for your inputs.

With this approach, did you see any apparent issues / precautions that we
should be aware of ?

Thanks,
Amit

On 15/06/16 3:54 pm, "Lulseged Zerfu" <zlulse...@hotmail.com> wrote:

>It should be shared.loader:
>shared.loader="${catalina.base}/shared"
>
>> From: zlulse...@hotmail.com
>> To: users@tomcat.apache.org
>> Subject: RE: Tomcat 8 : Shared loader
>> Date: Wed, 15 Jun 2016 10:21:39 +
>> 
>> Hi
>> I have also same problem and have solved it by using shared folder.
>> Look at the catalina.properties file under $CATALINA_HOME/conf
>> You can look in to the common.loader an server.loader how to define
>>loaders. 
>> You should add loaders in the same way in the shared.loader.
>> I have created $CATALINA_HOME/shared and added my libraries here.
>> server.loader="${catalina.base}/shared"
>> Hope it helps.
>> Lulseged Zerfu
>> 
>> > From: amit.pa...@veritas.com
>> > To: users@tomcat.apache.org
>> > Subject: Tomcat 8 : Shared loader
>> > Date: Wed, 15 Jun 2016 10:00:51 +
>> > 
>> > We develop multiple web application which happen to share the same
>>stack (Spring, Hibernate,etc).
>> > 
>> > Thinking of sharing these third party libraries instead of
>>duplicating in each web app war.
>> > 
>> > IIUC, putting those in Tomcat (8)'s lib folder might cause issues
>>since the classes in there are loaded by a common loader.
>> > 
>> > And sharing such libraries using the shared loader seems a better
>>approach.  Is my understanding correct ? Does it have any further issues
>>?
>> > 
>> > That said, I don't see much documentation around using shared loader.
>>Any documentation/help in this regard is highly appreciated.
>> > 
>> > Thanks,
>> > Amit
>> > 
>>
> 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 8 : Shared loader

2016-06-15 Thread Amit Pande


On 15/06/16 4:06 pm, "Mark Thomas"  wrote:

>On 15/06/2016 11:00, Amit Pande wrote:
>> We develop multiple web application which happen to share the same
>>stack (Spring, Hibernate,etc).
>> 
>> Thinking of sharing these third party libraries instead of duplicating
>>in each web app war.
>
>Why?
>> To avoid jar duplication and improve memory footprint
>
>> IIUC, putting those in Tomcat (8)'s lib folder might cause issues since
>>the classes in there are loaded by a common loader.
>
>What issues?
>> Since loaded by a common class loader , the jars put in here will be
>>available to tomcat internal classes,even if not required , also need be
>>to thread safe.
>
>> And sharing such libraries using the shared loader seems a better
>>approach.
>
>Why?
>> As loaded by shared loader which seems to be meant for sharing
>>libraries across web apps ŠI guess here also the thread safely concern
>>exists , need to validate though.
>
>> Is my understanding correct ?
>
>No idea. You have not explained your understanding yet.
>> Hope it is explained now.
>
>> Does it have any further issues ?
>
>Further issues compared to what?
>> It was a general awareness question to get to know if people ran into
>>some issues after putting jars in tomcat¹s shared loader's path.
>
>> That said, I don't see much documentation around using shared loader.
>>Any documentation/help in this regard is highly appreciated.
>
>There isn't much call for the shared loader. You need to go back to the
>5.5.x documentation for a diagram that includes the shared loader.
>
>http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

>> Thanks for this. In absence of clear documentation in recent release, I
>>was doubtful if it was deprecated.
>
>Mark
>
>-
>To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>For additional commands, e-mail: users-h...@tomcat.apache.org
>


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 8 : Shared loader

2016-06-15 Thread Mark Thomas
On 15/06/2016 11:00, Amit Pande wrote:
> We develop multiple web application which happen to share the same stack 
> (Spring, Hibernate,etc).
> 
> Thinking of sharing these third party libraries instead of duplicating in 
> each web app war.

Why?

> IIUC, putting those in Tomcat (8)'s lib folder might cause issues since the 
> classes in there are loaded by a common loader.

What issues?

> And sharing such libraries using the shared loader seems a better approach.

Why?

> Is my understanding correct ?

No idea. You have not explained your understanding yet.

> Does it have any further issues ?

Further issues compared to what?

> That said, I don't see much documentation around using shared loader. Any 
> documentation/help in this regard is highly appreciated.

There isn't much call for the shared loader. You need to go back to the
5.5.x documentation for a diagram that includes the shared loader.

http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Tomcat 8 : Shared loader

2016-06-15 Thread Lulseged Zerfu
It should be shared.loader:
shared.loader="${catalina.base}/shared"

> From: zlulse...@hotmail.com
> To: users@tomcat.apache.org
> Subject: RE: Tomcat 8 : Shared loader
> Date: Wed, 15 Jun 2016 10:21:39 +
> 
> Hi
> I have also same problem and have solved it by using shared folder.
> Look at the catalina.properties file under $CATALINA_HOME/conf
> You can look in to the common.loader an server.loader how to define loaders. 
> You should add loaders in the same way in the shared.loader.
> I have created $CATALINA_HOME/shared and added my libraries here.
> server.loader="${catalina.base}/shared"
> Hope it helps.
> Lulseged Zerfu
> 
> > From: amit.pa...@veritas.com
> > To: users@tomcat.apache.org
> > Subject: Tomcat 8 : Shared loader 
> > Date: Wed, 15 Jun 2016 10:00:51 +
> > 
> > We develop multiple web application which happen to share the same stack 
> > (Spring, Hibernate,etc).
> > 
> > Thinking of sharing these third party libraries instead of duplicating in 
> > each web app war.
> > 
> > IIUC, putting those in Tomcat (8)'s lib folder might cause issues since the 
> > classes in there are loaded by a common loader.
> > 
> > And sharing such libraries using the shared loader seems a better approach. 
> >  Is my understanding correct ? Does it have any further issues ?
> > 
> > That said, I don't see much documentation around using shared loader. Any 
> > documentation/help in this regard is highly appreciated.
> > 
> > Thanks,
> > Amit
> > 
> 
  

RE: Tomcat 8 : Shared loader

2016-06-15 Thread Lulseged Zerfu
Hi
I have also same problem and have solved it by using shared folder.
Look at the catalina.properties file under $CATALINA_HOME/conf
You can look in to the common.loader an server.loader how to define loaders. 
You should add loaders in the same way in the shared.loader.
I have created $CATALINA_HOME/shared and added my libraries here.
server.loader="${catalina.base}/shared"
Hope it helps.
Lulseged Zerfu

> From: amit.pa...@veritas.com
> To: users@tomcat.apache.org
> Subject: Tomcat 8 : Shared loader 
> Date: Wed, 15 Jun 2016 10:00:51 +
> 
> We develop multiple web application which happen to share the same stack 
> (Spring, Hibernate,etc).
> 
> Thinking of sharing these third party libraries instead of duplicating in 
> each web app war.
> 
> IIUC, putting those in Tomcat (8)'s lib folder might cause issues since the 
> classes in there are loaded by a common loader.
> 
> And sharing such libraries using the shared loader seems a better approach.  
> Is my understanding correct ? Does it have any further issues ?
> 
> That said, I don't see much documentation around using shared loader. Any 
> documentation/help in this regard is highly appreciated.
> 
> Thanks,
> Amit
>