Author |
Message
|
Ashish.Shekhar |
Posted: Thu Sep 11, 2008 2:22 am Post subject: Message Broker v6: Ant - mqsicreatebar console output lost |
|
|
Newbie
Joined: 11 Sep 2008 Posts: 3
|
I'm using a build script for automating the bar file build, deployment etc.
The issue is that when calling the mqsicreatebar from the ant build using the exec tag, the ant build does not capture any console output.
Here's the example build.xml that I'm executing from eclipse:
Code: |
<project name="test" default="run" basedir=".">
<target name="run">
<echo>Ant build - Create bar</echo>
<exec executable="C:\Program Files\IBM\MessageBrokersToolkit\6.0\eclipse\mqsicreatebar.exe" spawn="false" logError="true" failonerror="true">
</exec>
<echo> Done</echo>
</target>
</project> |
And here's the output:
Code: |
Buildfile: C:\eclipse-workspace\antTest\build\build.xml
run:
[echo] Ant build - Create bar
BUILD FAILED
C:\eclipse-workspace\antTest\build\build.xml:4: exec returned: 1
Total time: 6 seconds |
Notice that the build output only says that exec returned 1 and does not give any description of the error, where as if you execute the mqsicreatebar.exe from the command line without any arguments then it returns with the following output:
Code: |
C:\Program Files\IBM\MQSI\6.0>mqsicreatebar
BIP0955I Compile a broker archive file from source.
Syntax: mqsicreatebar -data workspace -b barName [-version id] [-esql21]
[-p projectName [...]] -o filePath1 [filePath2 [...]]
Command Options:
'-data workspace' workspace location (Mandatory)
'-b barName' bar file name to create or replace
'-cleanBuild' refresh the workspace projects and perform a clean build before ad
ding
resources to the broker archive. (optional)
'-version id' appends '_' and id to compiled names in the archive (optional)
'-esql21' compile ESQL for brokers version 2.1 (optional)
'-p projectName' specify projects containing files to link (optional, multiple
projects can be specified)
'-o filePath1' workspace relative path (including the project) of deployable
files to add to the broker archive. Multiple deployable files can be com
piled
in a single mqsicreatebar command. |
The code above is just an example, the problem I'm facing is that the build does not return with a decent error description when the createbar fails due to reasons such as e.g. file not found etc. and this makes debugging difficult for the developers
Could anyone suggest any reason for which the console output is not being caught by the build inspite of explicitly stating spawn="false" in the script.
Please also suggest any alternate method of catching the console output that you know. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Sep 11, 2008 2:49 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Looks like you are running a headless mqsicreatebar. Are you sure your environment has been set to allow you to run mqsicreatebar?
Remember something called mqsiprofile???? or do you run it from the broker console???
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Ashish.Shekhar |
Posted: Thu Sep 11, 2008 3:24 am Post subject: |
|
|
Newbie
Joined: 11 Sep 2008 Posts: 3
|
@fjp_saper:
Quote: |
Looks like you are running a headless mqsicreatebar. Are you sure your environment has been set to allow you to run mqsicreatebar?
Remember something called mqsiprofile???? or do you run it from the broker console??? |
1> I'm running these scripts from the Broker Toolkit
2> I don't see the relation between mqsiprofile and Console output from mqsicreatebar,
even if you run mqsicreatebar from a standard console after navigating to the location of the executable, you'll get the same output irrespective of wether or not mqsiprofile has been run.
See the following series of commands:
Code: |
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>cd "Program Files\IBM\MessageBrokersToolkit\6.0\eclipse"
C:\Program Files\IBM\MessageBrokersToolkit\6.0\eclipse>mqsicreatebar
BIP0955I Compile a broker archive file from source.
Syntax: mqsicreatebar -data workspace -b barName [-version id] [-esql21]
[-p projectName [...]] -o filePath1 [filePath2 [...]]
Command Options:
'-data workspace' workspace location (Mandatory)
'-b barName' bar file name to create or replace
'-cleanBuild' refresh the workspace projects and perform a clean build before ad
ding
resources to the broker archive. (optional)
'-version id' appends '_' and id to compiled names in the archive (optional)
'-esql21' compile ESQL for brokers version 2.1 (optional)
'-p projectName' specify projects containing files to link (optional, multiple
projects can be specified)
'-o filePath1' workspace relative path (including the project) of deployable
files to add to the broker archive. Multiple deployable files can be com
piled
in a single mqsicreatebar command. |
And plus my question is that Ant is not logging the console output not that mqsicreatebar has a problem!! |
|
Back to top |
|
 |
JLRowe |
Posted: Fri Sep 12, 2008 3:58 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
try reading the ant task documentation, you will see you can add a redirector to the exec task. |
|
Back to top |
|
 |
Ashish.Shekhar |
Posted: Fri Sep 12, 2008 4:06 am Post subject: |
|
|
Newbie
Joined: 11 Sep 2008 Posts: 3
|
Yeah dude,
I've already read the documentation but I ascertain that the redirectors will only help if you want to store the output to a file or an environment variable because the output is by default redirected to the standard console using the ant Default Logger.
Nevertheless, I still tried it (knowing it'll not work) and it didn't, the variable that you redirect the output to, still remains blank.
The problem is that the output from the process is not coming back to ant at all which should not be the case if you specify spawn="false".
Lemme know if you've got anything else that could help me. |
|
Back to top |
|
 |
sriniketana |
Posted: Fri Nov 07, 2008 4:58 am Post subject: output redirection? |
|
|
 Newbie
Joined: 07 Nov 2008 Posts: 2
|
Have somebody a solution of this redirecting problem? I have same problem with mqsicreatebar.exe in our ant script, and i'm looking for a good solution.
I tried to use "output" and "error" atributes of <exec> element, but it's failed: both files remains empty (0 byte long), I tried to use <redirect> element in the <exec> element, but it's failed too.
Now, I don't know how to redirect the output of this program.
Thank you for your help!
Sriniketana |
|
Back to top |
|
 |
sridhsri |
Posted: Sat Nov 08, 2008 4:54 pm Post subject: |
|
|
Master
Joined: 19 Jun 2008 Posts: 297
|
This worked for me...
<exec executable="${mqsi.dir}\mqsideploy" failonerror="true" logError="true" vmlauncher="false" append="true"> |
|
Back to top |
|
 |
sriniketana |
Posted: Wed Nov 12, 2008 6:24 am Post subject: output redirection |
|
|
 Newbie
Joined: 07 Nov 2008 Posts: 2
|
Yes! This was the solution!
Thank you very much!
Best regards! |
|
Back to top |
|
 |
|