• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

spawning a server in ant

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I'm rather sure that Eclipse 3 uses Ant 1.6.2.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic