Re: Tomcat and ClassLoaders

2008-08-18 Thread pmanvi


But for me the issue is different for me. I have some applications in ROOT
folder  after some time (2 to 3 hours) apparently the class is getting
loaded from other jars (having the same class) are getting loaded from other
webapps directory.

I guess it's related to class caching done at the class loader level.
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false.
 -Xonclassgc
both seems to work fine.

But not sure about the implications.


Auke Noppe wrote:
 
 Hi,
 
  
 
 I have an application that uses the embedded version of tomcat.
 
 In my classpath I have some jars that are the same as the webapp I deploy
 in
 tomcat.
 
 Now the problem is, that the webapp uses the jars from the classpath of
 the
 ‘root’ application and not the jars that the webapp has in his
 classpath(e.g. libs dir). How can I prevent the webapplication from using
 the jars from the ‘root’ application?
 
 I tried to start the program and tomcat with different classloaders, but
 nothing changed.
 
  
 
 Regards,
 
  
 
 Auke
 
 
 No virus found in this outgoing message.
 Checked by AVG Free Edition. 
 Version: 7.5.503 / Virus Database: 269.16.9/1155 - Release Date:
 27-11-2007
 20:30
  
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-and-ClassLoaders-tp13990806p19044611.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 6.0 Classloaders

2008-06-17 Thread Ole Ersoy

Hi,

I was wondering whether Tomcat 6.0 still has a classloader for classes that 
should be globally visible to all webapps only?  I read through the classloader 
documentation and it seems to be saying that $CATALINA_HOME/lib contains 
classes that are visible to both Tomcat and the webapps.

However this resource:
http://helpme.morphexchange.com/tomcat6/help/items/chapter_4_2_shared_lib

Is saying that shared/lib contains the classes visible to all webapps...

Thoughts?

Thanks,
- Ole

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 6.0 Classloaders

2008-06-17 Thread Caldarale, Charles R
 From: Ole Ersoy [mailto:[EMAIL PROTECTED]
 Subject: Tomcat 6.0 Classloaders

 I was wondering whether Tomcat 6.0 still has a classloader
 for classes that should be globally visible to all webapps
 only?

Not by default.  However, you can edit conf/catalina.properties to create any 
classloader hierarchy you want.

 I read through the classloader documentation and it
 seems to be saying that $CATALINA_HOME/lib contains
 classes that are visible to both Tomcat and the webapps.

That is correct.

 However this resource:
 http://helpme.morphexchange.com/tomcat6/help/items/chapter_4_2_shared_lib

 Is saying that shared/lib contains the classes visible to all
 webapps...

Another example of Sturgeon's Law.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6.0 Classloaders

2008-06-17 Thread Ole Ersoy

I was wondering whether Tomcat 6.0 still has a classloader
for classes that should be globally visible to all webapps
only?


Not by default.  However, you can edit conf/catalina.properties to create any 
classloader hierarchy you want.


So I take it:

common.loader = Tomcat's classes/jars visible to both webapps and to itself.  
server.loader = only tomcat

shared.loader = only webapps

So if I wanted hibernate-3.0.14.jar to be visible to all webapps I could stick 
in in CATALINA_HOME/shared/lib and set shared.loader = 
${catalina.home}/shared/lib/hibernate-3.0.14.jar and now it's visible to all 
webapps, but not to Tomcat?

Thanks!
- Ole




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 6.0 Classloaders

2008-06-17 Thread Caldarale, Charles R
 From: Ole Ersoy [mailto:[EMAIL PROTECTED]
 Subject: Re: Tomcat 6.0 Classloaders

 common.loader = Tomcat's classes/jars visible to both webapps
 and to itself.
 server.loader = only tomcat
 shared.loader = only webapps

Correct.  This is how levels prior to 6.0 worked.

 So if I wanted hibernate-3.0.14.jar to be visible to all
 webapps I could stick in in CATALINA_HOME/shared/lib and set
 shared.loader =
 ${catalina.home}/shared/lib/hibernate-3.0.14.jar and now it's
 visible to all webapps, but not to Tomcat?

Also correct, but I don't know why you'd go to that trouble.  Adding 
classloaders does not improve performance, nor does preventing the Tomcat 
kernel from seeing certain jars buy you anything.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 6.0 Classloaders

2008-06-17 Thread Ole Ersoy

So if I wanted hibernate-3.0.14.jar to be visible to all
webapps I could stick in in CATALINA_HOME/shared/lib and set
shared.loader =
${catalina.home}/shared/lib/hibernate-3.0.14.jar and now it's
visible to all webapps, but not to Tomcat?


Also correct, but I don't know why you'd go to that trouble.  Adding 
classloaders does not improve performance, nor does preventing the Tomcat 
kernel from seeing certain jars buy you anything.


I've been sitting here trying to come up with some hypothetical reasons that 
might make sense, but after writing them out, they all seem pointless, so good 
point! At least I know what's in catalina.properties now :-).

Actually one case I think is somewhat valid from an administration point of view is if you are RedBoss and you want to say to users Place all shared/provided webapp libraries in /var/lib/tomcat and have the corresponding Tomcat package pre-configured for this. 


Thanks again,
- Ole




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat and ClassLoaders

2007-11-28 Thread Auke Noppe
Hi,

 

I have an application that uses the embedded version of tomcat.

In my classpath I have some jars that are the same as the webapp I deploy in
tomcat.

Now the problem is, that the webapp uses the jars from the classpath of the
‘root’ application and not the jars that the webapp has in his
classpath(e.g. libs dir). How can I prevent the webapplication from using
the jars from the ‘root’ application?

I tried to start the program and tomcat with different classloaders, but
nothing changed.

 

Regards,

 

Auke


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.503 / Virus Database: 269.16.9/1155 - Release Date: 27-11-2007
20:30