ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Larsen <rob...@the-playground.dk>
Subject taskdef A class needed by class X cannot be found: Task
Date Fri, 08 Jul 2011 12:02:59 GMT
Hi list

I am having a problem with an Ant installation on my Ubuntu 11.04.

I have a task which I have made myself and it has always worked (and
actually still does) but now I am getting the below error:

$ java -version && javac -version && ant -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
javac 1.6.0_24
Apache Ant version 1.8.1 compiled on October 13 2010
$ ant -f spritemap.xml
Buildfile: /home/robert/code/test/spritemap.xml

BUILD FAILED
/home/robert/code/test/spritemap.xml:3: taskdef A class needed by
class dk.cego.spritemapper.SpriteMapperTask cannot be found: Task
 using the classloader AntClassLoader[]

Total time: 0 seconds
$


On another machine however I get different results:
$ java -version && javac -version && ant -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
javac 1.6.0_24
Apache Ant version 1.8.1 compiled on October 13 2010
$ ant -f spritemap.xml
Buildfile: /home/robert/SpriteMapper/spritemap.xml

spritemap_trim:
[spritemap] Layouter used:
Guillotine(BestShortSideChooser,ShortestAxisSplitStrategy)
[spritemap] Resulting file is 1200 by 1462 pixels. Area is 1754400
square pixels.
[spritemap] Waste: 1%
[spritemap] Combined filesize: 1940786 Map filesize: 2277040

BUILD SUCCESSFUL
Total time: 2 seconds
$


I have googled this and can see that others have similar problems
(with other tasks thou) but not a working solution. Some have
suggested that having several versions of Ants classes loaded can
bring problems but on both machines the correct version is loaded (I
verified this with strace).
And the MD5 sum of all classes in /usr/share/ant/lib is the same all
the same files are loaded on both systems (in different order thou).
On the machine that fails:
$ strace -f ant -f spritemap.xml 2>&1|grep open|grep '.jar'|sed
's/.*"\(.*\)".*/\1/g'|xargs md5sum
6bdab51d6194c67d87cf04798bf8f364
/usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/rt.jar
37af554c699ef3c111cacc425b76b6fc  /usr/share/java/ant-launcher-1.8.1.jar
ba2c37a77600506cad2f0cd43b644ccd
/usr/share/maven-repo/javax/xml/jaxp-api/1.3/jaxp-api-1.3.jar
4ff5d1693f53efd8dd896a1a4455f7d7  /usr/share/java/xercesImpl-2.9.1.jar
82cb294674ba80a873e5dbe8a1ab239e  /home/robert/.ant/lib/SpriteMapper.jar
b31960add562a83ab98f7aec05424fd5  /usr/share/ant/lib/ant.jar
59e172f974c15d7720fbc345de0794aa  /usr/share/ant/lib/ant-javamail.jar
83e75d199a69105f1b4a45da65edf96f  /usr/share/ant/lib/ant-apache-oro.jar
b866a005fcd2359c022b8b30e46962b2  /usr/share/ant/lib/ant-apache-bsf.jar
37af554c699ef3c111cacc425b76b6fc  /usr/share/ant/lib/ant-launcher.jar
a424187753013263098f871b988ffa66  /usr/share/ant/lib/ant-apache-bcel.jar
a602bc912519abf1f880254a9d112e14  /usr/share/ant/lib/ant-jsch.jar
6aca7709b093bc66eddc35db11d30c41  /usr/share/ant/lib/ant-junit.jar
e5fa415ffece5e45d9eaa97d6b2cb305  /usr/share/ant/lib/ant-antlr.jar
73f01c5fea143194e71dca49a674a8de  /usr/share/ant/lib/ant-nodeps.jar
04a884ec7baa2808f6ca21272b386f59  /usr/share/ant/lib/ant-commons-net.jar
ce1fe292df3ca1c6cf0abef4010044e4  /usr/share/ant/lib/ant-apache-log4j.jar
30d9de0cee3200b492eeba7e9513e70d  /usr/share/ant/lib/ant-swing.jar
9d6b2d5bd33c11e83ef5255593b8b39d  /usr/share/ant/lib/ant-apache-regexp.jar
387e6c508bd112f5a014deec1102576d  /usr/share/ant/lib/ant-jdepend.jar
42d220c4c460e71def44d43da3aa2293  /usr/share/ant/lib/ant-jmf.jar
098c0a8dfdf7d3bb54b72927effc0ba6
/usr/share/ant/lib/ant-commons-logging.jar
e164ab5811a3a8911484d69fccf10e41  /usr/share/ant/lib/ant-apache-xalan2.jar
756a9b04d6874dfeccca05c49605de66
/usr/share/ant/lib/ant-apache-resolver.jar
3a144abb259517f50d2a78b43b4960bf
/usr/lib/jvm/java-6-sun-1.6.0.24/lib/tools.jar
b31960add562a83ab98f7aec05424fd5  /usr/share/ant/lib/ant.jar


On the machine that works:
$ strace -f ant -f spritemap.xml 2>&1|grep open|grep '.jar'|sed
's/.*"\(.*\)".*/\1/g'|xargs md5sum
6bdab51d6194c67d87cf04798bf8f364
/usr/lib/jvm/java-6-sun-1.6.0.24/jre/lib/rt.jar
37af554c699ef3c111cacc425b76b6fc  /usr/share/java/ant-launcher-1.8.1.jar
ba2c37a77600506cad2f0cd43b644ccd
/usr/share/maven-repo/javax/xml/jaxp-api/1.3/jaxp-api-1.3.jar
4ff5d1693f53efd8dd896a1a4455f7d7  /usr/share/java/xercesImpl-2.9.1.jar
82cb294674ba80a873e5dbe8a1ab239e  /home/robert/.ant/lib/SpriteMapper.jar
59e172f974c15d7720fbc345de0794aa  /usr/share/ant/lib/ant-javamail.jar
9d6b2d5bd33c11e83ef5255593b8b39d  /usr/share/ant/lib/ant-apache-regexp.jar
e5fa415ffece5e45d9eaa97d6b2cb305  /usr/share/ant/lib/ant-antlr.jar
42d220c4c460e71def44d43da3aa2293  /usr/share/ant/lib/ant-jmf.jar
37af554c699ef3c111cacc425b76b6fc  /usr/share/ant/lib/ant-launcher.jar
098c0a8dfdf7d3bb54b72927effc0ba6
/usr/share/ant/lib/ant-commons-logging.jar
83e75d199a69105f1b4a45da65edf96f  /usr/share/ant/lib/ant-apache-oro.jar
04a884ec7baa2808f6ca21272b386f59  /usr/share/ant/lib/ant-commons-net.jar
b31960add562a83ab98f7aec05424fd5  /usr/share/ant/lib/ant.jar
6aca7709b093bc66eddc35db11d30c41  /usr/share/ant/lib/ant-junit.jar
e164ab5811a3a8911484d69fccf10e41  /usr/share/ant/lib/ant-apache-xalan2.jar
b866a005fcd2359c022b8b30e46962b2  /usr/share/ant/lib/ant-apache-bsf.jar
a602bc912519abf1f880254a9d112e14  /usr/share/ant/lib/ant-jsch.jar
73f01c5fea143194e71dca49a674a8de  /usr/share/ant/lib/ant-nodeps.jar
a424187753013263098f871b988ffa66  /usr/share/ant/lib/ant-apache-bcel.jar
756a9b04d6874dfeccca05c49605de66
/usr/share/ant/lib/ant-apache-resolver.jar
387e6c508bd112f5a014deec1102576d  /usr/share/ant/lib/ant-jdepend.jar
30d9de0cee3200b492eeba7e9513e70d  /usr/share/ant/lib/ant-swing.jar
ce1fe292df3ca1c6cf0abef4010044e4  /usr/share/ant/lib/ant-apache-log4j.jar
3a144abb259517f50d2a78b43b4960bf
/usr/lib/jvm/java-6-sun-1.6.0.24/lib/tools.jar
b31960add562a83ab98f7aec05424fd5  /usr/share/ant/lib/ant.jar

Any ideas what I should do next ?
I feel like I have tried everything.


Have an awesome weekend
Robert


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


Mime
View raw message