Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Classloader problems

Classloader problems

2007-06-07       - By Kevin Jackson

Hi all,

For obscure reasons, I have to redefine the core email task using a taskdef.
This is my build file:
<path id="jsch.path">
 <pathelement location="${}/jsch/ant-jsch.jar"/>
 <pathelement location="${}/jsch/jsch-0.1.33.jar"/>
<taskdef name="scp"

<taskdef name="sshexec"
<taskdef name="mail"
   <pathelement location="${}/mail/ant-javamail.jar"/>
   <pathelement location="${}/mail/mail.jar"/>

Now the strange thing is that thescp & sshexec tasks report that they
have been over-ridden by the new definitions, and with -debug enabled
I can see the correct classes being loaded.  The mail task however
just reports ' Class
loaded from parent loader (parentFirst)'.

Then finally it fails with ClassNotFoundException.  This means that
the <classpath> is ignored for the mail taskkdef, but is used
correctly for the scp/sshexec taskdefs.

I would think it would make sense to treat all taskdefs & classpaths equal...

I cannot copy the jars into ~/.ant/lib, or $ANT_HOME/lib, and I cannot
rely on a CLASSPATH variable or an external calling script.  The only
way I can make what I want to do work is via the taskdefs which honour
the <classpath> or classpathref.  Does anyone know how to work around


To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.