Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 20048 invoked by uid 500); 2 Oct 2001 01:36:34 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 20032 invoked from network); 2 Oct 2001 01:36:34 -0000 Message-ID: <014c01c14af1$441bf060$700101cf@vkoppika> From: "Shyam Koppikar" To: References: Subject: Re: Classloader question Date: Mon, 1 Oct 2001 20:20:55 -0700 Organization: Descon Consultants 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.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ----- Original Message ----- From: "Geir Magnusson Jr." To: Sent: Monday, October 01, 2001 4:16 AM Subject: Classloader question > Howdy, > > I am trying to get rid of the issues that popped up recently with Ant 1.4 > and Velocity. I will phrase the question generally... > > How do I, in a custom Ant task, dependably access the 'task classloader'? > > Here's the issue I believe I am facing. Suppose I have the following : > > > > classname="org.apache.velocity.texen.ant.TexenTask"> > > > > > > > useClassPath="true" > contextProperties="service.props" > controlTemplate="Control.vm" > outputDirectory="../test/texen-classpath/results" > outputFile="report" > /> > > > Now, in the Texen code, I want to, via a classloader, access the stuff added > to the classpath defined in the . > > What we were doing was something on the order of > > ClassLoader cl = this.getClass().getClassLoader(); > > But that doesn't fly in 1.4 as it appears that 1.4 delegates upwards for > classloading (rather than downwards...) I may have the interpretation of > the cause wrong - the symptom is that if you put the jar with Texen (the > velocity.jar) in the classpath before invoking ant, you get the problem. If > you don't, all is fine. > > So what I want to do is ensure I always get the 'lower' classloader (or find > another solution.) > > Thanks. > > Geir > > > -- > Geir Magnusson Jr. geirm@optonline.net > System and Software Consulting > "They that can give up essential liberty to obtain a little temporary safety > deserve neither liberty nor safety." - Benjamin Franklin > > >