DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36717>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=36717

           Summary: Ant does not correctly set the current thread's
                    ContextClassLoader before starting a task
           Product: Ant
           Version: 1.6.2
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


I am generating dynamic class files within an Ant task using Javassist.

The bug is best illustraighted by the following code snippet (from execute
within my ant task):

System.out.println("CL1: "+Thread.currentThread().getContextClassLoader());
System.out.println("CL2: "+this.getClass().getClassLoader());

The output is:

[MyTask] CL1: [EMAIL PROTECTED]
[MyTask] CL2: [EMAIL PROTECTED]

The workaround for my code is:
                        
Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());

Which causes Javassist to work perfectly.

Yonas.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to