How do I start up JBoss using ant?

M

mwkohout

within an ant script running within Eclipse 3.0.1(which has ant 1.6.2
built in), I'm trying to start up an instance of JBoss on my local
machine. However, I'm having some problems with it.

here's the call:
<exec command="run.bat" dir="${jboss.root.dir}\bin\" spawn="true" />

here's the error:
BUILD FAILED:
C:\eclipse3.0.1\eclipse\IsrsQueryWebServiceWorkSpace\IsrsQueryWebService\build.xml:88:
Execute failed: java.io.IOException: CreateProcess: run.bat error=2

I was wondering if anyone might have a clue about why it's getting this
error, and I was also wondering if any custom ant tasks for JBoss
startup/shutdown existed...I've googled but haven't found any yet.
thanks
Mike Kohout
 
S

Sudsy

<exec command="run.bat" dir="${jboss.root.dir}\bin\" spawn="true" />

here's the error:
BUILD FAILED:
C:\eclipse3.0.1\eclipse\IsrsQueryWebServiceWorkSpace\IsrsQueryWebService\build.xml:88:
Execute failed: java.io.IOException: CreateProcess: run.bat error=2

You need to feed it an executable, not a batch file. Batch files cannot
be invoked directly; you need some kind of command processor. On *UNIX
systems it would be something like /bin/sh. It goes under various
guises on M$ systems.
 
M

Michiel Konstapel

You need to feed it an executable, not a batch file. Batch files cannot
be invoked directly; you need some kind of command processor. On *UNIX
systems it would be something like /bin/sh. It goes under various
guises on M$ systems.

In the case of NT/2000/XP it's cmd.exe, for 9x/Me it's command.com.
Michiel
 
S

Sudsy

Michiel said:
In the case of NT/2000/XP it's cmd.exe, for 9x/Me it's command.com.
Michiel

Thanks kindly for the clarification. So hard to keep track of what
they're calling it these days...

To the OP: With this additional information we can suggest the
following:

NT:
<exec command="cmd.exe run.bat" dir="${jboss.root.dir}\bin\"
spawn="true" />

Win 98/ME:
<exec command="command.com run.bat" dir="${jboss.root.dir}\bin\"
spawn="true" />

Disclaimer: Above information is untested. YMMV.
 
Joined
Nov 10, 2011
Messages
1
Reaction score
0
solution to start jboss using ant script

Add the following to your ant script and modify jboss.home.dir to jboss intallation folder.

<target name="startJboss">
<java classname="org.jboss.Main" fork="true" logerror="true" dir="${jboss.hime.dir}/server/default">
<arg line="-c default"/>
<classpath>
<pathelement path="${jboss.hime.dir}/bin/run.jar"/>
<pathelement path="${jboss.hime.dir}/lib/tools.jar"/>
</classpath>
</java>
</target>


Now try running the ant script. you should get the jboss started.

Good Luck....!
Don.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top