Re: Accessing static variable from different webapps

2005-02-08 Thread Anshaj Mathur
Thanks a lot for helping me understand all this concepts about classloading. I found a pretty good article on class loading in java. http://www.onjava.com/pub/a/onjava/2005/01/26/classloading.html Thanks, Anshaj On Thu, 03 Feb 2005 22:25:53 +0100, Mario Winterer <[EMAIL PROTECTED]> wrote: > For

Re: Accessing static variable from different webapps

2005-02-03 Thread Mario Winterer
For more information on tomcat's classloading concept have a look at: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html As you can see there, Tomcat instantiates a classloader for each web application. So if you put a class - let's say "Global" - inside the "WEB-INF/classes"

Re: Accessing static variable from different webapps

2005-02-03 Thread Anshaj Mathur
Yes it makes perfect sense. Thanks for clarify some of the basic concepts to me. Regards, Anshaj On Thu, 3 Feb 2005 06:52:55 -0600, Caldarale, Charles R <[EMAIL PROTECTED]> wrote: > > From: Anshaj Mathur [mailto:[EMAIL PROTECTED] > > Subject: Re: Accessing static variable from

RE: Accessing static variable from different webapps

2005-02-03 Thread Caldarale, Charles R
> From: Anshaj Mathur [mailto:[EMAIL PROTECTED] > Subject: Re: Accessing static variable from different webapps > > Thanks for your reply. I think JVM rules said that there should be 1 > reference per JVM for a static variable. It's one reference per classloader, not JVM. &

Re: Accessing static variable from different webapps

2005-02-03 Thread Tim Funk
Wrong. Static variables are per *classloader*, not per JVM. -Tim Anshaj Mathur wrote: Thanks for your reply. I think JVM rules said that there should be 1 reference per JVM for a static variable. Tomcat class loader creates separate instance of a static variable for each webapps. I am just trying t

Re: Accessing static variable from different webapps

2005-02-03 Thread Anshaj Mathur
Thanks for your reply. I think JVM rules said that there should be 1 reference per JVM for a static variable. Tomcat class loader creates separate instance of a static variable for each webapps. I am just trying to understand how class loader works in tomcat. Thanks, Anshaj On Thu, 03 Feb 2005 0

Re: Accessing static variable from different webapps

2005-02-03 Thread Tim Funk
Put the class in the common or shared classloader. -Tim Anshaj Mathur wrote: Dear group, I have public class which contains a static variable type integer. I am running different webapps inside single instance of tomcat. I initiated this class in different webapps. I increased the count f

Accessing static variable from different webapps

2005-02-03 Thread Anshaj Mathur
Dear group, I have public class which contains a static variable type integer. I am running different webapps inside single instance of tomcat. I initiated this class in different webapps. I increased the count from a webapp and tried to see it from different webapp. I found that count wa