Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 94582 invoked from network); 9 Mar 2002 02:37:43 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 9 Mar 2002 02:37:43 -0000 Received: (qmail 29012 invoked by uid 97); 9 Mar 2002 02:37:29 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 28954 invoked by uid 97); 9 Mar 2002 02:37:28 -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 28917 invoked from network); 9 Mar 2002 02:37:28 -0000 Date: 8 Mar 2002 18:37:28 -0800 Message-ID: <20020309023728.17833.cpmta@c007.snv.cp.net> X-Sent: 9 Mar 2002 02:37:28 GMT Content-Type: text/plain Content-Disposition: inline Mime-Version: 1.0 To: tomcat-user@jakarta.apache.org From: Christopher K.St.John X-Mailer: Web Mail 3.9.3.5 X-Sent-From: cks@distributopia.com Subject: Re: Writing my own valve to do extra logging X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N "Dr. Evil" wrote: > > So my solution is to write a valve ... Then I edited > bin/catalina.sh so that mylogger.jar was on the java > classpath > Don't edit bin/catalina.sh to change the classpath on the command line. Just put the jar in the right place (as defined by the classloader howto, it looks like you've done that), put catalina.sh back the way it was before, and it should all work. You don't strictly have to know this, but here's the deal: Catalina defines a bunch of classloaders. They form a tree. The root of the tree is the built in Java classloaders. The leaf classloaders can see the classes loaded by the root, but the root can't see the classes loaded by the leaves. One of the built-in classloaders loads the stuff on the classpath. Since you your Valve's jar is on the classpath, a built-in classloader is loading your Valve. So far so good. But your valve depends on a Catalina class. And the Catalina class _isn't_ loaded by the built-in classloader, it's loaded by a Catalina classloader. The built-in classloader can't see the Catalina classes (they're not on the classpath), so you get the error message. The solution is to let a Catalina classloader load your Valve's jar. Instead of having a classpath, the classloader that loads the stuff in server/lib just loads every jar in the directory. So just copy your jar into the right directory and Catalina will see it. -- Christopher St. John cks@distributopia.com DistribuTopia http://www.distributopia.com -- To unsubscribe: For additional commands: Troubles with the list: