RE: Doubt on lifecycle of a class in "shared" folder

2008-07-18 Thread java_is_everything
So, it means my code and "intentions" are alright, it's GWT that seems the culprit, since I have not touched the default conf/properties file. Regards Ajay Garg Caldarale, Charles R wrote: > > > > What, pray tell, is a "static instance" in Java terminology? > > If the class file of interes

RE: Doubt on lifecycle of a class in "shared" folder

2008-07-17 Thread Caldarale, Charles R
> From: Edward Song [mailto:[EMAIL PROTECTED] > Subject: RE: Doubt on lifecycle of a class in "shared" folder > > I believe it is because you are sharing the class definition, > not instances, even if they are static instances. > > So webapp1 will create a sta

RE: Doubt on lifecycle of a class in "shared" folder

2008-07-17 Thread Edward Song
: java_is_everything [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2008 6:39 AM To: users@tomcat.apache.org Subject: Re: Doubt on lifecycle of a class in "shared" folder Sh

Re: Doubt on lifecycle of a class in "shared" folder

2008-07-17 Thread Mikolaj Rydzewski
java_is_everything wrote: Now, webapp1 sets the list size to 1. Now when Sharer.getListForOthers() from webapp1, "Size is 1", while when Sharer.getListForOthers() from webapp2, it shows "Problem !!". Any light ?/ Maybe gwt adds some magick? I have checked it now on 5.x a

Re: Doubt on lifecycle of a class in "shared" folder

2008-07-17 Thread java_is_everything
Shared Class : /// package client; import java.util.ArrayList; public class Sharer { public static ArrayList listForOthers = null; static {

Re: Doubt on lifecycle of a class in "shared" folder

2008-07-17 Thread java_is_everything
Thanks for the reply. Yes, I had ensured it (even did a double-check after your mail, everything seems in place). But the problem persists. Everytime, webapp2 calls x.getA(), a null is returned, which shouldn't be the case, since a is a static variable. I have done another test. What I have done

Re: Doubt on lifecycle of a class in "shared" folder

2008-07-17 Thread Konstantin Kolinko
Make sure, that you do not have a copy of x.class in WEB-INF/classes or WEB-INF/lib/*.jar of any of your web applications. Those take precedence over shared or common classes. See http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html for details. 2008/7/17 java_is_everything <[EMAIL PR

Re: Doubt on lifecycle of a class in "shared" folder

2008-07-17 Thread Mikolaj Rydzewski
java_is_everything wrote: public int getA() { return a; } [...] value 123. But I don't .. :-( Instead I get a null as returned value. It's impossible to return null from such method. Show us complete code (both shared class and webapps). -- Mikolaj Rydzewski <[EMAIL

Re: Doubt on lifecycle of a class in "shared" folder

2008-07-16 Thread java_is_everything
I am sorry. The methods setA() and getA() are static, Rest everything remains same. Regards Ajay Garg java_is_everything wrote: > > Hi all. > > I have placed two applications in the webapps folder, and calling a class, > say 'x.java' placed in tomcat's shared folder. x.java is of the followi

Doubt on lifecycle of a class in "shared" folder

2008-07-16 Thread java_is_everything
Hi all. I have placed two applications in the webapps folder, and calling a class, say 'x.java' placed in tomcat's shared folder. x.java is of the following config : public class