Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 17798 invoked from network); 13 Sep 2005 08:13:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Sep 2005 08:13:33 -0000 Received: (qmail 209 invoked by uid 500); 13 Sep 2005 08:13:32 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 186 invoked by uid 500); 13 Sep 2005 08:13:31 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 173 invoked by uid 99); 13 Sep 2005 08:13:31 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Sep 2005 01:13:31 -0700 X-ASF-Spam-Status: No, hits=0.9 required=10.0 tests=DNS_FROM_RFC_ABUSE,USERPASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [66.163.169.223] (HELO smtp104.mail.sc5.yahoo.com) (66.163.169.223) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 13 Sep 2005 01:13:40 -0700 Received: (qmail 46050 invoked from network); 13 Sep 2005 08:13:28 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:Mime-Version:In-Reply-To:References:Content-Type:Message-Id:Content-Transfer-Encoding:From:Subject:Date:To:X-Mailer; b=nmfPGyGhbQJorql06atoMSgj8PYviXI+EH6PhdgTmiz35agor9MCP/PnqZB47ea8sTdZszxkCrqAT5f5EvX/2wVqAhCzG2FXlHUmHhT6ZxkijASDbpz7JkGXOtnaw2mEnbbJCI8eAQ7dE1I6iMCjLLA3apUBVD7ajxsTimiCpeI= ; Received: from unknown (HELO ?192.168.1.105?) (david?jencks@66.93.38.137 with plain) by smtp104.mail.sc5.yahoo.com with SMTP; 13 Sep 2005 08:13:27 -0000 Mime-Version: 1.0 (Apple Message framework v622) In-Reply-To: <2ed2f49c05091223436306abe8@mail.gmail.com> References: <2ed2f49c0509122038778c3332@mail.gmail.com> <2ed2f49c05091223436306abe8@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <0d630f16c169b26bbb6eabe0187bf356@yahoo.com> Content-Transfer-Encoding: 7bit From: David Jencks Subject: Re: Static Variables and ClassLoaders Date: Tue, 13 Sep 2005 01:13:24 -0700 To: user@geronimo.apache.org X-Mailer: Apple Mail (2.622) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, That looks to me as if it should work. Do you see the log statements from starting the gbean? If you put log statements in your servlet when it accesses the static instance which occurs first? You might try logging the classloaders involved and their parentIds. thanks david jencks On Sep 12, 2005, at 11:43 PM, Krishnakumar B wrote: > Hi, > > Thanks for the response. I am not sure if i understood ur answer > right. I tried the following > > GBean Plan Config ID = test/Hello > > > xmlns="http://geronimo.apache.org/xml/ns/deployment" > configId="test/Hello" > parentId="org/apache/geronimo/Server" > > > test/jars/hellogbean.jar > > class="com.ibm.dw.reallybigpet.HelloGBean"> > > > > Web Application Plan > > > xmlns="http://geronimo.apache.org/xml/ns/web" > configId="test/Pet" > parentId="test/Hello" >> > / > false > > > I set the Parent ID of WAR plan to GBean plan Config ID. I have > removed the dependency jar in Web Plan. > > Still i get a null for static reference created in GBean. > > Regards > Krishnakumar B > > > > On 9/13/05, Krishnakumar B wrote: >> Hi, >> >> I have a doubt related to usage of Static Variables. >> >> "Static Variables are scoped in the class they r defined. So if a >> class is loaded by more than one classloader in same JVM then there >> will be multiple copies within same JVM" >> >> How do i used Config Id/Parent Id to ensure that 2 plans use the same >> ClassLoader so that i get a single instance of static variable. >> >> Regards >> Krishnakumar B >> >