ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rainer Noack" <rai...@noacks.net>
Subject RE: taskdef classpath problem
Date Thu, 29 Dec 2005 21:07:13 GMT
Hi Gunnar,

After browsing a little bit through springworkframe's web-cvs IMHO the
problem is, that 
org.springframework.core.io.DefaultResourceLoader - a baseclass of
ClassPathXmlApplicationContext -
is instantiated with it's default constructor, i.e. it uses the
ThreadContextClassloader to load resources.

The ThreadContextClassloader is typically not your task's classloader.

You can set the  ThreadContextClassloader before instantiating
ClassPathXmlApplicationContext.

Dont't forget to set it back to it's original value before giving back
execution control to ant ;-)

Cheers

Rainer


> -----Original Message-----
> From: Gunnar Sigurdsson [mailto:gunnar@comnipoint.com] 
> Sent: Thursday, December 29, 2005 7:12 PM
> To: Ant Users List
> Subject: Re: taskdef classpath problem
> 
> 
> I am not loading the resources directly, that happens as a
> side effect of GenDDL using a class from one of these other jars.
> 
> The full details are like this. Lets say GenDDL.class is in 
> GenDDL.jar, and GenDDL.class calls a class Context.class 
> which is in Context.jar, and that same jar contains a text 
> file Context.xml. Now Contex.class is a sublcass of 
> org.springframework.context.support.ClassPathXmlApplicationContext
> which is in spring.jar. The failure occurs when 
> ClassPathXmlApplicationContext tries to find Context.xml. I 
> get a FileNotFoundException.
> 
> Thanks for taking a look at this.
> 
> Gunnar
> 
> On Thu, 29 Dec 2005, Stefan Bodewig wrote:
> 
> > On Wed, 28 Dec 2005, Gunnar Sigurdsson 
> <gunnar@comnipoint.com> wrote:
> > 
> > > The GenDDL class depends on other jar files that are in the same
> > > "lib" directory. When the "ddl" target is executed, ant finds the 
> > > GenDDL class and executes it, but it does not find 
> resources in the 
> > > other jar files. 
> > 
> > How are you trying to load the resources?  Are you explicitly using 
> > the classloader that has loaded your task?
> > 
> > Stefan
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> > 
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message