Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 96037 invoked from network); 2 Jan 2002 17:44:59 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 2 Jan 2002 17:44:59 -0000 Received: (qmail 4016 invoked by uid 97); 2 Jan 2002 17:44:33 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 4000 invoked by uid 97); 2 Jan 2002 17:44:33 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 3989 invoked from network); 2 Jan 2002 17:44:32 -0000 Message-ID: <04d401c193b5$22704030$0101010a@netegrity.com> From: "Richard Sand" To: "Tomcat Users List" References: <005101c18641$b26eb300$0101010a@netegrity.com> <00e201c186ef$fec23250$0101010a@netegrity.com> <01121711004731.09717@NetOps.ento.cornell.edu> <00da01c1908a$06a50850$0101010a@netegrity.com> Subject: classloader caching resources in 4.0? Date: Wed, 2 Jan 2002 18:44:25 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Hi all, Has anyone seen this problem I describe below? Tomcat 4 seems to be caching resouce files the way it caches classes, requiring a restart of the application every time I change a properties file. Tomcat 3 (and other servlet engines) did not behave this way- every time I did a getResourceAsStream it would re-open the file. Is this new behavior correct or a bug? Thanks for any help! -Richard ----- Original Message ----- > I have a .properties file that I use for my application configuration that I > keep in WEB-INF/classes. I use > getClass().getResourceAsStream("/myfile.properties") from within a bean to > load the properties into a static hashtable, and I have a control servlet > that can tell the bean to reload the file. This just allows me to edit the > properties without having to start and stop the application (which was a > more painful process pre-Catalina). > > Now that I've switched from 3.2.3 to 4.0.1, what I'm seeing is that my > changes to the properties file are not being picked up when I reset my bean. > I've traced through everything, and determined that my subsequent calls to > getResourceAsStream are still opening the original file, even though I've > modified and saved it. Its as if the classloader is treating the resource > as a class, and it is loading it once and keeping it around, so I need to > reload the application to reload the resource. > > This was not the behavior under 3.x, so my question is, is this proper > behavior in 4.x, and if so, is there a workaround? > > Thanks for any replies! > > Best regards, > > Richard -- To unsubscribe: For additional commands: Troubles with the list: