Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 31371 invoked from network); 20 Apr 2006 17:09:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Apr 2006 17:09:31 -0000 Received: (qmail 34643 invoked by uid 500); 20 Apr 2006 17:09:25 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 34601 invoked by uid 500); 20 Apr 2006 17:09:25 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 34589 invoked by uid 99); 20 Apr 2006 17:09:25 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Apr 2006 10:09:25 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [12.106.87.70] (HELO irvbhxw03.quest.com) (12.106.87.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Apr 2006 10:09:23 -0700 Received: from tormbxw01.prod.quest.corp ([10.4.100.91]) by irvbhxw03.quest.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 20 Apr 2006 10:09:02 -0700 Received: from tor106065.prod.quest.corp ([10.4.114.58]) by tormbxw01.prod.quest.corp with Microsoft SMTPSVC(5.0.2195.6713); Thu, 20 Apr 2006 13:09:01 -0400 From: Robert Clark Organization: Quest Software Inc. To: user@ant.apache.org Subject: Re: SystemClassLoader fails to load inside my own ant task Date: Thu, 20 Apr 2006 13:09:00 -0400 User-Agent: KMail/1.9.1 Cc: Marcel Ruff References: <4445582B.4060702@avitech-ag.com> In-Reply-To: <4445582B.4060702@avitech-ag.com> X-Face: @wf=R>`Gp1sqW"$*(jmq~x\Y:on!638~obu4W34T^iIADeQK]WA}}rUgp4Ih&a3^:<~P&$|P|2"Ad=8J_<=?utf-8?q?s5=23x5v7QZ=24Pn67lUsJSsDyIF=7C=23=3A9Cy=23D=0A=09i=3F=7E=5D?= =?utf-8?q?=7BX=3Ama68Crle=7BV=2EREz?="twUaW>&^Y.qHk1\)8i[n/[#/~oi$,g(:/)gt6" =?utf-8?q?Fm=5EGW!BBsD=0A=09+RP?="I3Xb~I6OH#&2^==29GQ~5UAfE._cNv.V4{qdw2uBp MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604201309.00438.robert.clark@quest.com> X-OriginalArrivalTime: 20 Apr 2006 17:09:01.0261 (UTC) FILETIME=[1E98C7D0:01C6649D] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Tuesday April 18, 2006 17:20, Marcel Ruff wrote: > ... > > The java.util.logging.LogManager.java uses following code: > > Class clz = ClassLoader.getSystemClassLoader().loadClass(word); > > It seems the system class loader does not find my XbNotifyHandler > class even that it is definitely in the CLASSPATH, > i have also tried > > > with no success. > > But this is works fine: > Class clz = > Thread.currentThread().getContextClassLoader().loadClass(cname); > > but i can't change the java.util.logging code to use the > ContextClassLoader! > > How can i resolve this issue? Ant loads classes and tasks using it's own classloader. If the java.util.logging code need to load a class using the system classloader, then the only way I know of to arrange this is to add it to the CLASSPATH environment variable *before* starting Ant. I'd suggest you also consider filing a bug with Sun about this. there are some places in LogManager.java where they try the System classloader and then fall back on the context classloader and some places they do not. I don't see any reason not to fall back to the context classloader in all cases. This would allow the java.util logging to work with Ant as well. - Rob --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org