Bug 46877 - Taskdef uses wrong class loader
Summary: Taskdef uses wrong class loader
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: 1.7.1
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-19 07:05 UTC by Adam Crume
Modified: 2009-03-19 07:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Crume 2009-03-19 07:05:07 UTC
I am running Ant via the API, and I have ant.jar and ant-contrib.jar loading in separate class loaders.  The problem is that taskdef tasks can't find the ant-contrib classes.  I've tried calling project.setCoreLoader(ClassLoader), and I've also tried setting the thread's context class loader.  Nothing works.  I looked in the code, and the root of the problem seems to be on line 335 of Project.java (in version 1.7.1, anyway).  The createClassLoader(Path) method uses the Project class's class loader rather than the core class loader for the parent.