Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Ant is running an out-of-date task class -- why?
Ant is running an out-of-date task class -- why? [message #212139] Thu, 11 August 2005 18:01 Go to next message
Eclipse UserFriend
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 #212147 is a reply to message #212139] Thu, 11 August 2005 18:26 Go to previous messageGo to next message
Darin Swanson is currently offline Darin SwansonFriend
Messages: 2386
Registered: July 2009
Senior Member
Sorry nothing jumps out at me.
What are you actually including in your project.class.path? Do you have a
JAR that is out of date?

Darins

"James Adams" <james_adams@yahoo.com> wrote in message
news:fdea8f5d0fed68e0aae3fede0ae0429e$1@www.eclipse.org...
> 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 Go to previous message
Eclipse UserFriend
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
Previous Topic:change eclipse vm frequently: easy solution?
Next Topic:override a class, method, type or field
Goto Forum:
  


Current Time: Thu Mar 28 13:00:24 GMT 2024

Powered by FUDForum. Page generated in 0.02660 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top