You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Beela Avinash <ab...@miraclesoft.com> on 2008/12/10 16:11:57 UTC
how to call the .py from wsadmin using ant
<?xml version="1.0"?>
<!-- ====================== create projectName DeployEar
===-================================ -->
<project name="DeployEar" default="createEar" basedir=".">
<property name = "path" value ="C:\Program
Files\IBM\WebSphere\AppServer_Base\bin"/>
<target name="deploy-ear">
<!-- Install Web app automatically -->
<!-- <exec executable="${path}\wsadmin.bat -lang jython -f
installear.py"/> -->
<!-- <arg value="-lang jython -f installear.py"/> -->
<exec executable="${path}\wsadmin.bat" />
<arg value="/c -lang jython -f installear.py"/>
<exec dir = "${path}" executable = "cmd">
<arg value="/c wsadmin.bat"/>
<!--<arg value="/c -lang jython -f 'C:\Program
Files\IBM\WebSphere\AppServer_Base\bin\installear.py' "/>-->
</exec>
</target>
<target name="tests">
<antcall target="deploy-ear"/>
</target>
</project>
*****************************************************************
error
C:\Program Files\IBM\WebSphere\AppServer_Base\bin>ant tests
Buildfile: build.xml
tests:
deploy-ear:
[exec] WASX7209I: Connected to process "server1" on node mcity146Node04
using SOAP connector; The type of process
is: UnManagedProcess
[exec] WASX7029I: For help, enter: "$Help help"
[exec] wsadmin>
BUILD FAILED
C:\Program Files\IBM\WebSphere\AppServer_Base\bin\build.xml:29: The
following error occurred while executing this line:
C:\Program Files\IBM\WebSphere\AppServer_Base\bin\build.xml:17: Problem:
failed to create task or type arg
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
***************************************************************************
i'm unable to call the .py file from wsadmin using ant script
the scenario is
ant has to call wsadamin and wsadmin has to call the .py file.
can anyone help me out ... Thanx in advance
--
View this message in context: http://www.nabble.com/how-to-call-the-.py-from-wsadmin-using-ant-tp20937152p20937152.html
Sent from the Ant - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how to call the .py from wsadmin using ant
Posted by Francis Galiegue <fg...@one2team.com>.
Le jeudi 11 décembre 2008, Shaaf Syed M a écrit :
> The following works okay for me.
>
>
> <exec dir="." executable="wsadmin.bat" logError="true"
> failonerror="true" output="wsconfig.out">
> <arg line="-lang jython -f ../../createQFactory.py"/>
> </exec>
>
I don't know how it works with Windows, but using arg line="" is not a good
idea. I don't know whether ant splits the line for arguments and calls
execve() in this case. It may call system(), which is a Bad Thing(tm).
> Fail on error doesnt work if the file was not found. I am not sure if it
> works with wsadmin at all.
Putting this before the <exec> can do that for you:
<fail message="File not found">
<condition>
<not>
<available file="thefile"/>
</not>
</condition>
</fail>
--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 6 83 87 78 75
Tel : +33 (0) 1 78 94 55 52
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how to call the .py from wsadmin using ant
Posted by Shaaf Syed M <sh...@gmail.com>.
The following works okay for me.
<exec dir="." executable="wsadmin.bat" logError="true"
failonerror="true" output="wsconfig.out">
<arg line="-lang jython -f ../../createQFactory.py"/>
</exec>
Fail on error doesnt work if the file was not found. I am not sure if it
works with wsadmin at all.
Also wsadmin is in my PATH env already.
Regards,
-- Shaaf
On Wed, Dec 10, 2008 at 4:24 PM, Francis Galiegue <fg...@one2team.com> wrote:
> Le mercredi 10 décembre 2008, Beela Avinash a écrit :
> [...]
> >
> >
> >
> > <exec executable="${path}\wsadmin.bat" />
> >
> > <arg value="/c -lang jython -f installear.py"/>
> >
>
> It should be ONE argument per <arg>. Ie:
>
> <exec executable="thecommand">
> <arg value="arg1"/>
> <arg value="arg2"/>
> </exec>
>
> With this, what you pass as one single argument is "/c -lang jython [etc]"
> which is probably not what you want.
>
> --
> Francis Galiegue
> ONE2TEAM
> Ingénieur système
> Mob : +33 (0) 6 83 87 78 75
> Tel : +33 (0) 1 78 94 55 52
> fge@one2team.com
> 40 avenue Raymond Poincaré
> 75116 Paris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Re: how to call the .py from wsadmin using ant
Posted by Francis Galiegue <fg...@one2team.com>.
Le mercredi 10 décembre 2008, Beela Avinash a écrit :
[...]
>
>
>
> <exec executable="${path}\wsadmin.bat" />
>
> <arg value="/c -lang jython -f installear.py"/>
>
It should be ONE argument per <arg>. Ie:
<exec executable="thecommand">
<arg value="arg1"/>
<arg value="arg2"/>
</exec>
With this, what you pass as one single argument is "/c -lang jython [etc]"
which is probably not what you want.
--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 6 83 87 78 75
Tel : +33 (0) 1 78 94 55 52
fge@one2team.com
40 avenue Raymond Poincaré
75116 Paris
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how to call the .py from wsadmin using ant
Posted by Mark Salter <ma...@talktalk.net>.
Beela Avinash wrote:
> <?xml version="1.0"?>
.
.
> <exec executable="${path}\wsadmin.bat" />
>
> <arg value="/c -lang jython -f installear.py"/>
>
> <exec dir = "${path}" executable = "cmd">
> <arg value="/c wsadmin.bat"/>
> <!--<arg value="/c -lang jython -f 'C:\Program
> Files\IBM\WebSphere\AppServer_Base\bin\installear.py' "/>-->
> </exec>
You have an arg element outside of any task as you have closed the exec
element unintentionally early?
It looks like you have tried a number of combinations and have managed
to confuse yourself.
I can't know that you invocation of wsadmin.bat will work with the arg
included within the exec element, but we shall see.
--
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org