aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes How to Start/Stop Websphere Applisation Server using ANT in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "How to Start/Stop Websphere Applisation Server using ANT in eclipse" Watch "How to Start/Stop Websphere Applisation Server using ANT in eclipse" New topic
Author

How to Start/Stop Websphere Applisation Server using ANT in eclipse

yatin shinde
Greenhorn

Joined: Jan 10, 2008
Posts: 6
hi;
I am new to Eclipse and Websphere. I deploy one project in Websphere Application Server. every time when i am done any change in my code and recompile that every time i manually stop and restart my Websphere Application server. which i don't want.
Now i am tring that using ant in eclipse i start and stop my Websphere Application server.
I tried alot but it not work..
So please help me.....
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30555
    
152

Originally posted by yatin shinde:
Now i am tring that using ant in eclipse i start and stop my Websphere Application server.
I tried alot but it not work..

Yatin,
Welcome to JavaRanch!

What did you try? Can you show the Ant task you called? And when you say it doesn't work, what happened - error message, etc?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
yatin shinde
Greenhorn

Joined: Jan 10, 2008
Posts: 6
HI Jeanne;
Thanks for showing intrest in my problem.
to start stop websphere application server in eclips using Ant's build.xml
which i found in following site :
"http://publib.boulder.ibm.com/infocenter/wasinfo/v5r1//index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/javadoc/ae/com/ibm/websphere/ant/tasks/package-summary.html"
but while running this script it gives me foli error :

Buildfile: D:\Yatin\XXX\build.xml

BUILD FAILED
D:\Yatin\XXX\build.xml:20: taskdef class com.ibm.websphere.ant.tasks.StartServer cannot be found

Total time: 140 milliseconds
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30555
    
152

Originally posted by yatin shinde:
BUILD FAILED
D:\Yatin\XXX\build.xml:20: taskdef class com.ibm.websphere.ant.tasks.StartServer cannot be found

How are you letting the build know where to find the jar containing the IBM tasks? There are two approaches that will work:
1) Add the jar to your ant classpath.
2) Add the classpath in your taskdef statement.

Can you show the line of code or classpath that does this?
yatin shinde
Greenhorn

Joined: Jan 10, 2008
Posts: 6
HI Jeanne;

I already try your both suggation of
1) Add the jar to your ant classpath.
2) Add the classpath in your taskdef statement.

it that time it gives me foll. error

start.server:

BUILD FAILED
D:\Yatin\XXX\build.xml:32: Unable to parse setupCmdLine: null\bin\setupCmdLine.bat (The system cannot find the path specified)

Total time: 192 milliseconds
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30555
    
152

Yatin,
Progress. Now Ant is finding the task and having problems with an environmental setting. Can you post the Ant snippet where you call the start server task?
yatin shinde
Greenhorn

Joined: Jan 10, 2008
Posts: 6
hi i am able to start and stop WebsphereApplicationServer using ant in eclipse
for this i use ant's exec command and run "startServer.bat" to start server and to stop "stopServer.bat"
but now i am new problem is that i want to build ant file in such a way that if i run ant build.xml file it check status of server
and if server is started then it stop server
and if server is stop it start server....
i am not able to put my code because while i pest code and click apply button it give error so please understant and help me........:-)
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30555
    
152

I think you would be better off writing a Jython script and calling it from Ant to get that information.

What error are you getting when posting code? If it is about < not being allowed, you need to convert them into &lt; symbols.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to Start/Stop Websphere Applisation Server using ANT in eclipse