Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

start/stop Sun Application server from ant build.xml

 
Bhaarat Sharma
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am very new to ant. I currently use an ant build.xml to compile my project and build an EAR file. I would like this ant script to further stop then start my sun app server once the building of EAR is done.

Can someone please tell me how I should go about doing this?

currently i start/stop my sun app server via cmd promp like this:


I'd appreciate any help. i looking around on google and found ant code used to start stop tomcat server but not sun app server.

Thanks
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears that Sun ONE application server provides some ANT tasks. Is this the version you were looking for?
 
Bhaarat Sharma
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes i have antaks in the version i am running. but my build.xml (one i used to compile my code) is not related to sun app server at all. So i am clueless as to what lines of code i should be adding into this build.xml so that i can start/stop or even deploy/undeploy application on sun app server via this build.xml
 
Bhaarat Sharma
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is what i've tried

my ant: std.build is the target that does the compiling and building of EAR file after that i call the undeploy target.

sun app server deploy/undeploy targets


however, the error i am getting is:


i am new to ant so..do i need to declare this class someplace?

Also, how does one delete a file in ant
[ September 12, 2007: Message edited by: bhaarat sharma ]
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know if this is the cause of the error, because it was correct one place and wrong the other, but -

org.apache.tools.ant.tasksdefs.optional.sun.appserv.DeployTask

should just be -

org.apache.tools.ant.taskdefs.optional.sun.appserv.DeployTask


Other than that - if the paths to the Jars in the classpaths are correct - everything else looks OK.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic