Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 83210 invoked from network); 12 Jan 2002 05:53:10 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Jan 2002 05:53:10 -0000 Received: (qmail 20601 invoked by uid 97); 12 Jan 2002 05:52:56 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 20558 invoked by uid 97); 12 Jan 2002 05:52:55 -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 20547 invoked from network); 12 Jan 2002 05:52:55 -0000 X-Originating-IP: [202.138.116.213] From: "Jiger Java" To: tomcat-user@jakarta.apache.org Bcc: Subject: RE: having to restart tomcat for new classes -More Date: Sat, 12 Jan 2002 11:22:53 +0530 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 12 Jan 2002 05:52:55.0499 (UTC) FILETIME=[618479B0:01C19B2D] 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 Craig, > >* Creating objects based on classes loaded from /WEB-INF/classes or > /WEB-INF/lib, but passing references to them to classes that are > loaded from the shared class loader (and are thus NOT reloaded by > the reloading mechanism). The old objects survive the reload (because > there are still live references to them, so they cannot be > garbage collected). But they are GUARANTEED to cause a > ClassCastException when you try to reference them after the reload > completes. > I my case I am NOT loading anything from shared classpath. nor am I giving references to them of classes in /WEB-INF/classes or /WEB-INF/lib classes. So this is very funny & annoying error. If u had read my previous mails, I had described that I was using a Utility that I created on the samelines as Struts BeanUtil.populateBean() method. Which auto-populates FormBean's from request or Hastables. It works perfectly well normally, but as soon as I recompile any class in my webapp triggering webapp reload, The formbean population fails for some methods, so my validate will return false & the app goes into loop showing errors highlighted although user has filled in all the required details. If I still continue, tomcat starts giving me annoying errors like ClassCastException, NoClassDefFound, LinkageError and what not. I could send u my stacktraces once more if u want.This seems to be a bug of how all classes loaded from the same place, then destroyed & Re-created start giving problems. Any idea. Thanks & Awaiting your reply, Jiger > > > Can u just explain how can we prevent classloading errors & points to >keep > > in mind so that even if entire Context is being restarted does not >affect > > our app. > > > >The simplest rule is to put 100% -- that's every single one -- of your >application classes, plus any library classes that your application uses, >under /WEB-INF/classes or /WEB-INF/lib, instead of in a shared library >directory. That way, they will always get reloaded when your webapp does. > >If you use shared JAR files (for example, from Tomcat's "lib" directory), >you need to absolutely ensure that there are no references to the old >objects (loaded from /WEB-INF) kept by objects that are loaded by a shared >class loader. As you can imagine, this is a much harder thing to do. The >suggestion in the previous paragraph is much simpler to implement, and >avoids pretty much all potential problems. > > > Thanks & Awaiting your reply, > > Jiger > > > >Craig > > >-- >To unsubscribe: >For additional commands: >Troubles with the list: > _________________________________________________________________ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe: For additional commands: Troubles with the list: