Ant is running an out-of-date task class -- why? [message #212139] |
Thu, 11 August 2005 18:01 |
Eclipse User |
|
|
|
Originally posted by: james_adams.yahoo.com
I have a small Java program which populates database tables with test
data. I am running this program from Ant using a <taskdef> in the target.
I launch this Ant task with Eclipse using the External Tools button.
I have recently updated the Java class in order to add different test data
to the tables. However now when I run the Ant task the old class gets
executed and the old test data is inserted into my database tables. This
happens no matter how many times I restart Eclipse or rebuild my project.
It appears that the original class is still present in some directory that
Ant uses in its classpath, and this out-of-date class is taking precedence
over the new version. The new class is present in the classpath which I
assign in build.xml. I can find no instance of the previous version of
the class which Ant is running instead of the current version.
One thing of interest is that when I run the Ant task in Eclipse I get a
message telling me "Waiting for virtual machine to exit" -- I'm not sure
what this means but perhaps it has some significance?
My task is defined in the Ant target like so:
<target name="populate"
description="Creates and persists some sample Ioi, Trader, and
Firm objects">
<taskdef name="populateTables"
classname="com.mycom.focus.tools.PopulateTables"
classpathref="project.class.path">
</taskdef>
<populateTables/>
</target>
If anyone can shed any light on this for me I'd certainly appreciate it.
Thanks in advance!
--James
|
|
|
|
Re: Ant is running an out-of-date task class -- why? [message #212154 is a reply to message #212147] |
Thu, 11 August 2005 20:05 |
Eclipse User |
|
|
|
Originally posted by: james_adams.yahoo.com
Darin Swanson wrote:
>
> What are you actually including in your project.class.path? Do you have a
> JAR that is out of date?
Thanks for looking at this Darin.
The problem turned out to be a bonehead mistake on my part. I have both a
main() and an execute() method in my class. The execute() is just a copy
of the code in main(), and when I modified the class I modified the code
in main() without making the same changes to execute(), which is the
actual method that Ant is running. Now that I have made the changes in
execute() all is well again in the universe.
--James
|
|
|
Powered by
FUDForum. Page generated in 0.02660 seconds