java - How do I troubleshoot an ANT "exec" command line error message? -


using ant script, trying build bar file deploy in iib server. facing error like:

bip0960e incorrect "-a", "-l", "-p", or "-o" argument supplied mqsicreatebar

please let me know how solve error.

thank you.

i using following ant script :

<?xml version="1.0" encoding="utf-8"?> <project name="test" default="create_bar" basedir=".">     <property file="ucd.properties"></property>      <taskdef resource="net/sf/antcontrib/antlib.xml">           <classpath>               <pathelement location="c:\apache-ant-1.9.6\lib\antcontrib.jar"/>           </classpath>      </taskdef>         <!-- making windows command environment  -->      <target name="mqsiprofile.cmd">      <exec executable="${broker.mqsi.path}\mqsiprofile.cmd" />      </target> //  <!-- creating bar file -->         <target name="create_bar">             <for list="${project_name}" delimiter="," param="pname">                 <sequential>                 <echo message="@{pname}"/>                 <exec executable="${toolkit.home}\mqsicreatebar.exe" spawn="false" vmlauncher="false" failonerror="true">                 //  <!-- project's workspace-->                     <arg value="-data" />                     <arg value="${workspaces.dir}" />                     <!--barfile generated path-->                     <arg value="-b" />                     <arg value="${bar.loc}\@{pname}.msgflow.generated.bar" />                     <!--project name-->                     <arg value="-p" />                     <arg value="@{pname}" />                     <!--message flows corresponding projects has given in cvscheckout.properties-->                     <arg value="-o" />                     <arg line="@{bar.loc}\${@{pname}.flow_name}" />                     <arg line="@{bar.loc}\iam_demo_compute.esql" />                 <arg value="-deployassource" />                 </exec>                  </sequential>             </for>         </target>      </project> 

i placed necessary components build bar file.

the bip0960 error message above indicates have passed incorrect parameters executable running in script. need troubleshoot parameter string passing executable.

it can hard debug ant execstatements in way have structured them.

a technique debugging ant scripts create single property command line parameter string, , echo parameters console confirm construction. use parameter string output review, test, modify , re-run command , parameters, until work.

to this, refactor exec statement references single parameter string, called ${myparams}:

<!-- create command parameters --> <property name="myparams" value="-data ${workspaces.dir} -b ${bar.loc}\@{pname}.msgflow.generated.bar -p @{pname -o @{bar.loc}\${@{pname}.flow_name} @{bar.loc}\iam_demo_compute.esql -deployassource" />        <!-- echo myparams --> <echo message="myparams: ${myparams}" /> <!-- pass myparams executable --> <exec executable="${toolkit.home}\mqsicreatebar.exe" spawn="false" vmlauncher="false" failonerror="true">   <arg line="${myparams}" /> </exec>  

the echo statement show property variables expanded. copy , paste command line, , try again. when have right parameters, copy , paste script, replacing static values correct variables.

likewise easier manage changes command line 1 property, instead of multiple arg values.

use construction, , can troubleshot exec command problems.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -