You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by si...@aciworldwide.com on 2002/10/08 18:19:23 UTC

Ant build fails: unable to find ant.Md5Task

I am trying to build Sun's Liberty Alliance IPL.

I am using Win2K.

IPL was built using Sun's jwsdp toolkit, so I decided to give it a shot. 
The install for this puts it's bin directory on my path.  The distribution 
includes Ant.  The bin directory has an ant.bat file that invokes ant. 
(See attached file.)

IPL requires xml-security.

I downloaded xml-security-bin-1_0_4.zip, unpacked it, opened a DOS box, 
cd'ed to the xml-security dir, and entered "ant".  I got the following 
error message:
Total time: 7 seconds
C:\projects\xml-security-src-1_0_4\build.xml:446: taskdef class 
ant.Md5Task cannot be found

There is a sub-directory called ant in the xml-security dir with two class 
files, HexDump.class and Md5Task.class.

I rtfm that came with Ant about developing user classes.  It says "Make sure the class that implements your task is in the classpath when 
starting Ant."

I am naively assuming this mean that it wasn't able to find Md5Task.class.

I tried copying and editing the jwsdp ant.bat file, editing it to add the 
explicit path to the classpath parameter in the line where the 
AntExecutable is invoked with java.exe.  This still failed.  When invoked 
with the -debug flag, the resulting output shows the java.class.path 
property as NOT including the xml-security/ant directory.  Hmm.

 I am not an ant expert, even after spending an hour reading the docs.  I 
am guessing that there is a way, either in the build.xml file or a 
.property file to set this.

Any ideas?

Thanks,

Sid Sidner
ACI Worldwide, 330 South 108 Avenue, Omaha, NE 68154-2684, USA
+1-402-778-1851, Fax: +1-402-330-1528, Mobile: +1-402-650-1979 New!
sidners@aciworldwide.com, www.aciworldwide.com
AIM, YIM: TooTallSid 

Re: Ant build fails: unable to find ant.Md5Task

Posted by Christian Geuer-Pollmann <ge...@nue.et-inf.uni-siegen.de>.
Your both right. The dirty 'trick' is the following:

 - ant.bat adds the $PATH (%PATH%) to the classpath
 - If your path contains the current directory (.), . is also in the CP
 - When you chdir to xml-security/ , the class ant.Md5Task is found because
   it's in ./ant/Md5Task

Solution: "Go to the xml-security dir and call 'ant' there."

If anyone knows how to make these classes available to an out-of-the-box 
ant installation, I'd be very happy.

Christian

--On Tuesday, October 08, 2002 7:17 PM +0200 Karel Wouters 
<Ka...@esat.kuleuven.ac.be> wrote:

> Hi,
>
> I also get this error regularly, because I always forget to add . (the
> current directory) to the classpath.
> In Linux, the solution is
> export CLASSPATH=.:$CLASSPATH
>
> A wild guess for MS-related stuff (I won't call it operating system :):
> set CLASSPATH=.;%CLASSPATH%
> or something like that.
>
> Hope that helps.
>
> Karel.
>
> On Tue, 8 Oct 2002 sidners@aciworldwide.com wrote:
>
>> I am trying to build Sun's Liberty Alliance IPL.
>>
>> I am using Win2K.
>>
>> IPL was built using Sun's jwsdp toolkit, so I decided to give it a shot.
>> The install for this puts it's bin directory on my path.  The
>> distribution includes Ant.  The bin directory has an ant.bat file that
>> invokes ant. (See attached file.)
>>
>> IPL requires xml-security.
>>
>> I downloaded xml-security-bin-1_0_4.zip, unpacked it, opened a DOS box,
>> cd'ed to the xml-security dir, and entered "ant".  I got the following
>> error message:
>> Total time: 7 seconds
>> C:\projects\xml-security-src-1_0_4\build.xml:446: taskdef class
>> ant.Md5Task cannot be found
>>
>> There is a sub-directory called ant in the xml-security dir with two
>> class files, HexDump.class and Md5Task.class.
>>
>> I rtfm that came with Ant about developing user classes.  It says "Make
>> sure the class that implements your task is in the classpath when
>> starting Ant."
>>
>> I am naively assuming this mean that it wasn't able to find
>> Md5Task.class.
>>
>> I tried copying and editing the jwsdp ant.bat file, editing it to add the
>> explicit path to the classpath parameter in the line where the
>> AntExecutable is invoked with java.exe.  This still failed.  When invoked
>> with the -debug flag, the resulting output shows the java.class.path
>> property as NOT including the xml-security/ant directory.  Hmm.
>>
>>  I am not an ant expert, even after spending an hour reading the docs.  I
>> am guessing that there is a way, either in the build.xml file or a
>> .property file to set this.
>>
>> Any ideas?
>>
>> Thanks,
>>
>> Sid Sidner
>> ACI Worldwide, 330 South 108 Avenue, Omaha, NE 68154-2684, USA
>> +1-402-778-1851, Fax: +1-402-330-1528, Mobile: +1-402-650-1979 New!
>> sidners@aciworldwide.com, www.aciworldwide.com
>> AIM, YIM: TooTallSid
>



Re: Ant build fails: unable to find ant.Md5Task

Posted by Karel Wouters <Ka...@esat.kuleuven.ac.be>.
Hi,

I also get this error regularly, because I always forget to add . (the
current directory) to the classpath.
In Linux, the solution is
export CLASSPATH=.:$CLASSPATH

A wild guess for MS-related stuff (I won't call it operating system :):
set CLASSPATH=.;%CLASSPATH%
or something like that.

Hope that helps.

Karel.

On Tue, 8 Oct 2002 sidners@aciworldwide.com wrote:

> I am trying to build Sun's Liberty Alliance IPL.
>
> I am using Win2K.
>
> IPL was built using Sun's jwsdp toolkit, so I decided to give it a shot.
> The install for this puts it's bin directory on my path.  The distribution
> includes Ant.  The bin directory has an ant.bat file that invokes ant.
> (See attached file.)
>
> IPL requires xml-security.
>
> I downloaded xml-security-bin-1_0_4.zip, unpacked it, opened a DOS box,
> cd'ed to the xml-security dir, and entered "ant".  I got the following
> error message:
> Total time: 7 seconds
> C:\projects\xml-security-src-1_0_4\build.xml:446: taskdef class
> ant.Md5Task cannot be found
>
> There is a sub-directory called ant in the xml-security dir with two class
> files, HexDump.class and Md5Task.class.
>
> I rtfm that came with Ant about developing user classes.  It says "Make sure the class that implements your task is in the classpath when
> starting Ant."
>
> I am naively assuming this mean that it wasn't able to find Md5Task.class.
>
> I tried copying and editing the jwsdp ant.bat file, editing it to add the
> explicit path to the classpath parameter in the line where the
> AntExecutable is invoked with java.exe.  This still failed.  When invoked
> with the -debug flag, the resulting output shows the java.class.path
> property as NOT including the xml-security/ant directory.  Hmm.
>
>  I am not an ant expert, even after spending an hour reading the docs.  I
> am guessing that there is a way, either in the build.xml file or a
> .property file to set this.
>
> Any ideas?
>
> Thanks,
>
> Sid Sidner
> ACI Worldwide, 330 South 108 Avenue, Omaha, NE 68154-2684, USA
> +1-402-778-1851, Fax: +1-402-330-1528, Mobile: +1-402-650-1979 New!
> sidners@aciworldwide.com, www.aciworldwide.com
> AIM, YIM: TooTallSid