Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

spawning a server in ant

 
Stephen Bloch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to write a client/server program, and to test it I need to start the server, leave it running, and then run the client. Is there a way to do both of these from within an ant task? Everything I've tried results in ant waiting for the server to terminate before it goes on to the next subtask, which is running the client.

So what have I tried?
1)

This produces the error message "The <java> task does not support the spawn attribute," directly contradicting the ant documentation. See
this thread.
2) <exec executable="${basedir}/serverd"/>
where "serverd" is a shell script looking like


This successfully starts the server, but ant never gets past it to do anything else.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Ant are you using? (You find out by running "ant -version".)
 
Stephen Bloch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I type "ant -version" at the command line, I get 1.6.2, dated July 16, 2004, but I think Eclipse is using a 1.5.3 plugin. Where can I get an updated plugin?
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I'm rather sure that Eclipse 3 uses Ant 1.6.2.
 
praveen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah,
You better to run two executables in the shell script in sequence.
i.e, 1. Server application.


<exec program="${bash.exe}" commandline="./updateBuild.sh"/>
 
praveen
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah,
You better to run two executables in the shell script in sequence.
i.e, 1. Server application.
2. Client application.

<exec program="${bash.exe}" commandline="./shellscript.sh"/>

Hope, it'll solve your problem.

cheers,
praveen
 
Stephen Bloch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have Eclipse 3 yet, because I haven't upgraded my Mac to OS 10.3 yet, because 10.4 will be out any month now.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Stephen Bloch:
I don't have Eclipse 3 yet, because I haven't upgraded my Mac to OS 10.3 yet, because 10.4 will be out any month now.


OK, this explains it.

There should be an org.apache.ant folder in your eclipse plugins folder or something like that. Replace the ant.jar file in there with that of the version of ant you need. You might need to do something more for the optional tasks, but I don't remember how that worked prior Eclipse 3. Possibly you need to edit the plugin.xml or something...

Hope this helps...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic