| Author | Message | 
		
		  | jeevan | 
			  
				|  Posted: Wed Nov 07, 2012 12:59 pm    Post subject: Ant script is failing to create bar |   |  | 
		
		  | Grand Master
 
 
 Joined: 12 Nov 2005Posts: 1432
 
 
 | 
			  
				| I am working on to create a bar file using ant script.   When it reaches 
 exec TAG, it lists commands, parameters correctly then it fails immediately.  -debug can produce this but not sure why it failing.
 
 I would apprecaite for any help
 
 This is what the ant errors out in -debug mode
 
 
 build.xml:63: exec returned: 1
 at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:636)
 at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:662)
 at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:487)
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
 at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
 a:106)
 at org.apache.tools.ant.Task.perform(Task.java:348)
 at org.apache.tools.ant.Target.execute(Target.java:357)
 at org.apache.tools.ant.Target.performTasks(Target.java:385)
 at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
 at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
 at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
 cutor.java:41)
 at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
 at org.apache.tools.ant.Main.runBuild(Main.java:758)
 at org.apache.tools.ant.Main.startAnt(Main.java:217)
 at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
 at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | ganesh | 
			  
				|  Posted: Wed Nov 07, 2012 1:42 pm    Post subject: |   |  | 
		
		  | Master
 
 
 Joined: 18 Jul 2010Posts: 294
 
 
 | 
			  
				| Can you post the failing exec tag? |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | bsiggers | 
			  
				|  Posted: Wed Nov 07, 2012 1:45 pm    Post subject: |   |  | 
		
		  | Acolyte
 
 
 Joined: 09 Dec 2010Posts: 53
 Location: Vancouver, BC
 
 | 
			  
				| It could be a lot of things. Could you put your exec command that is being generated within <echo> tags and see the interpreted result? 
 Could be that the command you're putting there is failing, not found, your paths not setup correctly for the command, etc.
 
 Best Regards,
 Ben Siggers.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | jeevan | 
			  
				|  Posted: Wed Nov 07, 2012 1:49 pm    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 12 Nov 2005Posts: 1432
 
 
 | 
			  
				| 
   
	| bsiggers wrote: |  
	| It could be a lot of things. Could you put your exec command that is being generated within <echo> tags and see the interpreted result? 
 Could be that the command you're putting there is failing, not found, your paths not setup correctly for the command, etc.
 
 Best Regards,
 Ben Siggers.
 |  
 
 <!-- The default target to build the Broker Archive file. The required projects have been exported to ${workspace.home}. CHANGE VALUES FOR -p AND -o SWITCHES BELOW AS REQUIRED. -->
 <target name="buildBAR" description="Build BAR file" depends="init">
 <echo message="Building Broker Archive file : ${bar.file.path}"/>
 <exec failonerror="true" executable="${ createbar.cmd }">
 <arg value="-data"/>
 <arg value="${workspace.home}"/>
 <arg value="-b"/>
 <arg path="${bar.file.path}"/>
 <arg value="-cleanBuild"/>
 <arg value="-p"/>
 <arg value="${P1}"/>
 <arg value="${P2}"/>
 <arg value="${P3}"/>
 <arg value="${P4}"/>
 <arg value="${P5}"/>
 <arg value="${P6}"/>
 <arg value="${P7}"/>
 <arg value="${P8}"/>
 <arg value="${P9}"/>
 <arg value="${P10}"/>
 <arg value="${P11}"/>
 <arg value="${P12}"/>
 <arg value="-o" />
 <arg value="${F1}"/>
 <arg value="${F2}"/>
 <arg value="${MS1}"/>
 <arg value="${MS2}"/>
 <arg value="${MS3}"/>
 </exec>
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | jeevan | 
			  
				|  Posted: Wed Nov 07, 2012 1:53 pm    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 12 Nov 2005Posts: 1432
 
 
 | 
			  
				| 
   
	| jeevan wrote: |  
	| 
   
	| bsiggers wrote: |  
	| It could be a lot of things. Could you put your exec command that is being generated within <echo> tags and see the interpreted result? 
 Could be that the command you're putting there is failing, not found, your paths not setup correctly for the command, etc.
 
 Best Regards,
 Ben Siggers.
 |  
 
 <!-- The default target to build the Broker Archive file. The required projects have been exported to ${workspace.home}. CHANGE VALUES FOR -p AND -o SWITCHES BELOW AS REQUIRED. -->
 <target name="buildBAR" description="Build BAR file" depends="init">
 <echo message="Building Broker Archive file : ${bar.file.path}"/>
 <exec failonerror="true" executable="${ createbar.cmd }">
 <arg value="-data"/>
 <arg value="${workspace.home}"/>
 <arg value="-b"/>
 <arg path="${bar.file.path}"/>
 <arg value="-cleanBuild"/>
 <arg value="-p"/>
 <arg value="${P1}"/>
 <arg value="${P2}"/>
 <arg value="${P3}"/>
 <arg value="${P4}"/>
 <arg value="${P5}"/>
 <arg value="${P6}"/>
 <arg value="${P7}"/>
 <arg value="${P8}"/>
 <arg value="${P9}"/>
 <arg value="${P10}"/>
 <arg value="${P11}"/>
 <arg value="${P12}"/>
 <arg value="-o" />
 <arg value="${F1}"/>
 <arg value="${F2}"/>
 <arg value="${MS1}"/>
 <arg value="${MS2}"/>
 <arg value="${MS3}"/>
 </exec>
 |  
 This time, I am getting different error
 
 BUILD FAILED
 C:\ant\bin\build.xml:63: exec returned: 1
 at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:636)
 at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:662)
 at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:487)
 at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
 at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
 a:106)
 at org.apache.tools.ant.Task.perform(Task.java:348)
 at org.apache.tools.ant.Target.execute(Target.java:357)
 at org.apache.tools.ant.Target.performTasks(Target.java:385)
 at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
 at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
 at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
 cutor.java:41)
 at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
 at org.apache.tools.ant.Main.runBuild(Main.java:758)
 at org.apache.tools.ant.Main.startAnt(Main.java:217)
 at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
 at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | mqjeff | 
			  
				|  Posted: Wed Nov 07, 2012 2:02 pm    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 25 Jun 2008Posts: 17447
 
 
 | 
			  
				| 
   
	| jeevan wrote: |  
	| <arg value="-p"/>
 <arg value="${P1}"/>
 <arg value="${P2}"/>
 <arg value="${P3}"/>
 <arg value="${P4}"/>
 <arg value="${P5}"/>
 <arg value="${P6}"/>
 <arg value="${P7}"/>
 <arg value="${P8}"/>
 <arg value="${P9}"/>
 <arg value="${P10}"/>
 <arg value="${P11}"/>
 <arg value="${P12}"/>
 
 |  This is not right.
 
 
   
	| Code: |  
	| <arg value="-p"/> <arg line="${P1} ${P2} ${P3} ${P4} ${P5} ${P6}"/>
 |  |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | bsiggers | 
			  
				|  Posted: Wed Nov 07, 2012 2:04 pm    Post subject: |   |  | 
		
		  | Acolyte
 
 
 Joined: 09 Dec 2010Posts: 53
 Location: Vancouver, BC
 
 | 
			  
				| Hi jeevan, 
 You aren't going to be able to figure out what's going wrong without knowing what command you are passing to the exec statement. Like I mentioned before, it would be helpful to you to be able to see what is actually being run (including parameters that you're actually passing in) to the mqsicreatebar command.
 
 Hope this helps, Best Regards,
 Ben Siggers.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | jeevan | 
			  
				|  Posted: Wed Nov 07, 2012 2:10 pm    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 12 Nov 2005Posts: 1432
 
 
 | 
			  
				| 
   
	| mqjeff wrote: |  
	| 
   
	| jeevan wrote: |  
	| <arg value="-p"/>
 <arg value="${P1}"/>
 <arg value="${P2}"/>
 <arg value="${P3}"/>
 <arg value="${P4}"/>
 <arg value="${P5}"/>
 <arg value="${P6}"/>
 <arg value="${P7}"/>
 <arg value="${P8}"/>
 <arg value="${P9}"/>
 <arg value="${P10}"/>
 <arg value="${P11}"/>
 <arg value="${P12}"/>
 
 |  This is not right.
 
 
   
	| Code: |  
	| <arg value="-p"/> <arg line="${P1} ${P2} ${P3} ${P4} ${P5} ${P6}"/>
 |  |  
 thanks mqjeff. I was wondering whether there is an alternative way to express these parameters.
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | jeevan | 
			  
				|  Posted: Wed Nov 07, 2012 2:12 pm    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 12 Nov 2005Posts: 1432
 
 
 | 
			  
				| 
   
	| bsiggers wrote: |  
	| Hi jeevan, 
 You aren't going to be able to figure out what's going wrong without knowing what command you are passing to the exec statement. Like I mentioned before, it would be helpful to you to be able to see what is actually being run (including parameters that you're actually passing in) to the mqsicreatebar command.
 
 Hope this helps, Best Regards,
 Ben Siggers.
 |  
 I know what command I am passing and what parameters I am passing. In fact, before ant, I have tested the syntax of the command in bath file. I know the command along with the parameters work perfectly. Although there are a few other issue in compiling in headless environment but that is not ant issue or command issue.
 
 
 Here is the previous discussions
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | fjb_saper | 
			  
				|  Posted: Wed Nov 07, 2012 6:45 pm    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| you might also want to add -trace. 
 Lot of interesting things printed that way...
 _________________
 MQ & Broker admin
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | jeevan | 
			  
				|  Posted: Thu Nov 08, 2012 6:16 am    Post subject: |   |  | 
		
		  | Grand Master
 
 
 Joined: 12 Nov 2005Posts: 1432
 
 
 | 
			  
				| 
   
	| fjb_saper wrote: |  
	| you might also want to add -trace. 
 Lot of interesting things printed that way...
 |  
 My biggest issue for me is not the an ant script to get working, but find out why the headless compilation (creation of bar file - using compilation and create bar interchangeably).
 
 As I mentioned in my previous post, when I took delete the .metadata dir from the workspace or create a new workspace and copy only prpject, it only compiles, one main flow, and 3 message setup. none of subflows, java and one main flow are not getting added to the bar file.  Same code works in Tooklit and with compilation with .metadata dir in workspace or in eclipse workspace.
 
 Last edited by jeevan on Thu Nov 08, 2012 7:02 am; edited 1 time in total
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  | fjb_saper | 
			  
				|  Posted: Thu Nov 08, 2012 6:53 am    Post subject: |   |  | 
		
		  |  Grand High Poobah
 
 
 Joined: 18 Nov 2003Posts: 20767
 Location: LI,NY
 
 | 
			  
				| There are a few tricks. If you defined any path variables (java project), you need to also define them in ANT, and will have to use
 ant -Dtoolkit.home=<tkinstall> buildAll
 
 Seek guidance through a PMR...
  _________________
 MQ & Broker admin
 |  | 
		
		  | Back to top |  | 
		
		  |  | 
		
		  |  |