ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Problem with ANT classloader?
Date Fri, 17 May 2002 17:07:11 GMT
I'm not creating any class loader, just using Class.forName(). I used to do
it Class.forName(classname, false, getSystemClassLoader()), but then when
run in-ant-process, this failed because I was running under the
AntClassLoader, not the system class loader (Does ant install it's class
locader as the Thread context class loader?). I changed my code to use the
same loader as the one that loaded the class that does the Class.forName
call (the AntCL in my case), and that's when the LinkageError crops in.

Of course I run with fork="true" to turn around that, but it's just slower.
I'd like to understand why I get this behavior in-ant-process!!!! --DD

-----Original Message-----
From: Ian Atkin [mailto:ianatkin@blueyonder.co.uk] 
Sent: Friday, May 17, 2002 12:02 PM
To: Ant Users List
Subject: Re: Problem with ANT classloader?

i get different but similar problems:-
- doing XSLT transforms with extension elements in them
- get similar complaints but it's a SAX class that offends

i think this is down to non-Ant code doing it's own class loading
- Ant has already loaded the class, client or 3rd party code then goes 
and loads it again
- if in-process this changes the loaded class, so when it's next used 
the JVM throws a LinkageError
- but i'm not sure so I'm going to read the lang spec again

i've always simply used fork=true on the <javac> to get round these troubles

must have run it in-process?

Ian


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

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


Mime
View raw message