ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: Preventing Parent Classloading
Date Fri, 10 Oct 2003 20:12:36 GMT
Samuel Gabriel wrote:

>We ran into this problem in one of our projects. The solution we found is to
>override the loadClass method so that it looks into the classloader classes
>before it looks into the parent classes. This way if there are classes that
>are conflicting our classes will always be loaded first.
>  
>
Are you able to send me some sample code for your class loader? I've 
been trying to achieve that myself but with no luck.

Regards, Upayavira

>Sam
>
>-----Original Message-----
>From: Dominique Devienne [mailto:DDevienne@lgc.com] 
>Sent: Friday, October 10, 2003 11:00 AM
>To: 'Ant Developers List'
>Subject: RE: Preventing Parent Classloading
>
>  
>
>>-----Original Message-----
>>From: Upayavira [mailto:uv@upaya.co.uk]
>>
>>Dominique Devienne wrote:
>>    
>>
>>>Here's something that might work. The code you sketched below, which only
>>>depends on Cocoon classes, could be make part of Cocoon itself in an
>>>existing or new JAR from Cocoon/WEB-INF/lib, as a new main() entry point.
>>>
>>>This way, you could then just use the Java task within your own task (do
>>>this all the time in my own custom task), calling that entry point, and
>>>setting the classpath explicitly. Play as well with the attributes to
>>>include or not the system and Ant runtime.
>>>
>>>
>>>      
>>>
>>The only problem I can forsee with this is that I'll already have the
>>configuration of the task read into a DOM object, which I'll want to
>>pass to the main() method. But I suspect the Java task will only pass
>>Strings. Am I correct here?
>>    
>>
>
>Well, yes. But you can always serialize your DOM tree to disk, and pass the
>name of the temp file to the main as an arg. If Java cannot sort the
>classloader stuff in non-forking mode, then you can still fork it, and this
>time it should work. --DD
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>For additional commands, e-mail: dev-help@ant.apache.org
>
>
>  
>



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


Mime
View raw message