Author |
Message
|
coding_monkey |
Posted: Wed Mar 29, 2006 5:26 am Post subject: Message Broker v6: mqsicreatebar not working from Ant |
|
|
Newbie
Joined: 29 Mar 2006 Posts: 6
|
Summary:
The call to mqsicreatebar from Ant returns an error saying "PolicyClassLoader could not find policy com.ibm.jxesupport.JxeClassLoaderPolicy". Does anybody know how to fix this?
Detailed description of problem:
In MB v5 I had an Ant target set up which performed an mqsicreatebar in order to build my bars as part of the application build process. The working target is shown below:
Code: |
<target name="parameterised.buildbar">
<echo message="Processing build for ${ant.project.name}"/>
<java classname="org.eclipse.core.launcher.Main" classpath="${wbimb.home}/eclipse/startup.jar" fork="true">
<arg value="-noupdate"/>
<arg value="-os"/>
<arg value="win32"/>
<arg value="-ws"/>
<arg value="win32"/>
<arg value="-arch"/>
<arg value="x86"/>
<arg value="-application"/>
<arg value="com.ibm.etools.mft.bar.cmdline.mqsicreatebar"/>
<arg value="-data"/>
<arg value="${workspaces.dir}"/>
<arg value="-b"/>
<arg value="${workspaces.dir}/bars/${wbimb.project.name}.bar"/>
<arg value="-o"/>
<arg value="${param.msgset.or.flow.01}"/>
<arg value="${param.msgset.or.flow.02}"/>
<arg value="${param.msgset.or.flow.03}"/>
<arg value="${param.msgset.or.flow.04}"/>
<arg value="${param.msgset.or.flow.05}"/>
</java>
<echo message="Completed processing build for ${ant.project.name}"/>
</target> |
Now we have moved to Message Broker v6 and I am trying to use the same target to build my bars. Due to some classpath problems in v6 I have had to add ${toolkit.home}/ibtoolkit/eclipse/plugins/com.ibm.etools.mft.esql.lang_6.0.0/plugin.jar to the traget but other than that everything is the same as that of v5:
Code: |
<target name="parameterised.buildbar">
<echo message="Processing build for ${ant.project.name}"/>
<java classname="org.eclipse.core.launcher.Main" fork="true">
<classpath>
<pathelement location="${toolkit.home}/eclipse/startup.jar"/>
<pathelement location="${wbimb.home}/ibtoolkit/eclipse/plugins/com.ibm.etools.mft.esql.lang_6.0.0/plugin.jar"/>
</classpath>
<arg value="-noupdate"/>
<arg value="-os"/>
<arg value="win32"/>
<arg value="-ws"/>
<arg value="win32"/>
<arg value="-arch"/>
<arg value="x86"/>
<arg value="-application"/>
<arg value="com.ibm.etools.mft.bar.cmdline.mqsicreatebar"/>
<arg value="-data"/>
<arg value="${workspaces.dir}"/>
<arg value="-b"/>
<arg value="${workspaces.dir}/bars/${wbimb.project.name}.bar"/>
<arg value="-o"/>
<arg value="${param.msgset.or.flow.01}"/>
<arg value="${param.msgset.or.flow.02}"/>
<arg value="${param.msgset.or.flow.03}"/>
<arg value="${param.msgset.or.flow.04}"/>
<arg value="${param.msgset.or.flow.05}"/>
<arg value="${param.msgset.or.flow.06}"/>
<arg value="${param.msgset.or.flow.07}"/>
<arg value="${param.msgset.or.flow.08}"/>
<arg value="${param.msgset.or.flow.09}"/>
<arg value="${param.msgset.or.flow.10}"/>
<arg value="${param.msgset.or.flow.11}"/>
<arg value="${param.msgset.or.flow.12}"/>
</java>
<echo message="Completed processing build for ${ant.project.name}"/>
</target> |
Unfortunately it doesn't work. When I run the target I get the following output:
Code: |
parameterised.buildbar:
[echo] Processing build for IB Programme
[java] Executing 'C:\j2sdk1.4.2_10\jre\bin\java.exe' with arguments:
[java] '-classpath'
[java] 'C:\Program Files\IBM\MessageBrokersToolkit\6.0\eclipse\startup.jar;C:\Program Files\IBM\MessageBrokersToolkit\6.0\ibtoolkit\eclipse\plugins\com.ibm.etools.mft.esql.lang_6.0.0\plugin.jar'
[java] 'org.eclipse.core.launcher.Main'
[java] '-noupdate'
[java] '-os'
[java] 'win32'
[java] '-ws'
[java] 'win32'
[java] '-arch'
[java] 'x86'
[java] '-application'
[java] 'com.ibm.etools.mft.bar.cmdline.mqsicreatebar'
[java] '-data'
[java] 'E:/Work/BuildWorkspace'
[java] '-b'
[java] 'E:/Work/BuildWorkspace/bars/rfq.bar'
[java] '-o'
[java] 'flow1.msgflow'
[java] 'flow2.msgflow'
[java] ''
[java]
[java] The ' characters around the executable and arguments are
[java] not part of the command.
[java] PolicyClassLoader could not find policy com.ibm.jxesupport.JxeClassLoaderPolicy
[java] Java Result: 13
[echo] Completed processing build for IB Programme |
Does anybody know what the "PolicyClassLoader could not find policy com.ibm.jxesupport.JxeClassLoaderPolicy" is and how to fix it?
Even better does anybody have a working MB v6 Ant task to build bars using mqsicreatebar?
Thanks _________________ - scott |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 29, 2006 6:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
V6 has a fairly large change in environmental support for running the commands - it's why there is now a "command console", to ensure that all the right things are set.
I'm also very confused as to why you decided to launch mqsicreatebar as a java class like that, I'd think you would use an exec task instead - since mqsicreatebar is an executeable command.
In other words, I think you're going at this the hard way rather than the easy way. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
coding_monkey |
Posted: Wed Mar 29, 2006 7:12 am Post subject: |
|
|
Newbie
Joined: 29 Mar 2006 Posts: 6
|
jefflowrey wrote: |
V6 has a fairly large change in environmental support for running the commands - it's why there is now a "command console", to ensure that all the right things are set.
I'm also very confused as to why you decided to launch mqsicreatebar as a java class like that, I'd think you would use an exec task instead - since mqsicreatebar is an executeable command.
In other words, I think you're going at this the hard way rather than the easy way. |
Yeah, I agree my way is the hard way. I have just managed to build the bar using the command console which is excellent.
Does anyone know how to call the mqsicreatebar command from within Ant using the exec task? The reason I ask is that the mqsicreatebar command is not available from a normal windows DOS prompt so I need to know which things to add to the PATH in order for the command to be callable and then I can use Ant to call it from the exec task.
Thanks _________________ - scott |
|
Back to top |
|
 |
fschofer |
Posted: Wed Mar 29, 2006 7:24 am Post subject: |
|
|
 Knight
Joined: 02 Jul 2001 Posts: 524 Location: Mainz, Germany
|
Hi,
take a look at the mqsiprofile.cmd which is called when opening the "command console".
This should help you to set the environment to call mqsi commands.
Greetings
Frank |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Mar 29, 2006 7:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I think if you look at the shortcut for the Command Console, then you can incorporate that into your exec command. Basically, all it does is run the Windows command prompt but tell it to include the mqsiprofile.cmd.
On unix, you would say exec=". <mqsi_install>/mqsiprofile;" and then pass mqsicreatebar as the first <arg>. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
coding_monkey |
Posted: Thu Mar 30, 2006 3:44 am Post subject: Got it!! |
|
|
Newbie
Joined: 29 Mar 2006 Posts: 6
|
fschofer wrote: |
Hi,
take a look at the mqsiprofile.cmd which is called when opening the "command console".
This should help you to set the environment to call mqsi commands.
Greetings
Frank |
Thanks for your help, all. I have now got it working correctly using the following Ant traget:
Code: |
<target name="parameterised.buildbar">
<echo message="Processing build for ${ant.project.name}"/>
<exec executable="${toolkit.home}\eclipse\mqsicreatebar.exe" spawn="true">
<arg value="-data"/>
<arg value="${workspaces.dir}"/>
<arg value="-b"/>
<arg value="${workspaces.dir}/bars/${wbimb.project.name}.bar"/>
<arg value="-o"/>
<arg value="${param.msgset.or.flow.01}"/>
<arg value="${param.msgset.or.flow.02}"/>
</exec>
<echo message="Completed processing build for ${ant.project.name}"/>
</target> |
Hopefully this might come in handy for someone else looking to do this same thing.
Cheers
Scott _________________ - scott |
|
Back to top |
|
 |
skol |
Posted: Wed Apr 05, 2006 11:28 am Post subject: How about stdout/stderr? |
|
|
Apprentice
Joined: 05 Apr 2006 Posts: 38
|
I have also had success with using the exec task, but have one issue that I was wondering if you also see. We use exec without spawn="true", and have also added error="xxx.log" and failonerror="true". The issue is, if mqsicreatebar ends with a bad return code for some legitimate reason, no stderr text gets written to xxx.log (it is always 0 bytes). When the ant script fails this way, I have to manually run the mqsicreatebar command line to see the error messages. Have you had any luck seeing errors from mqsicreatebar in the ANT script? _________________ Steve |
|
Back to top |
|
 |
coding_monkey |
Posted: Wed Apr 05, 2006 1:08 pm Post subject: Re: How about stdout/stderr? |
|
|
Newbie
Joined: 29 Mar 2006 Posts: 6
|
skol wrote: |
I have also had success with using the exec task, but have one issue that I was wondering if you also see. We use exec without spawn="true", and have also added error="xxx.log" and failonerror="true". The issue is, if mqsicreatebar ends with a bad return code for some legitimate reason, no stderr text gets written to xxx.log (it is always 0 bytes). When the ant script fails this way, I have to manually run the mqsicreatebar command line to see the error messages. Have you had any luck seeing errors from mqsicreatebar in the ANT script? |
I have also changed it to spawn="false".
Unfortunately my next question was going to be how on earth do I capture failrues in mqsicreatebar? At present if there are errors it simply finishes creating the bar without the compiled message flows and gives no error messages.
I was going to start playing with the failonerror and other attributes so if anyone knows how to do this please let us know?
Sorry I can't help at present skol. I will update if I find a solution. If you subsequently find a way please keep me informed?
Thanks _________________ - scott |
|
Back to top |
|
 |
skol |
Posted: Wed Apr 05, 2006 1:16 pm Post subject: |
|
|
Apprentice
Joined: 05 Apr 2006 Posts: 38
|
Cool. I'm going to test outputProperty and errorProperty tomorrow to see if for some reason the specified ANT properties do get set at run time, even though I can't seem to get file-based output. That way we could do conditionals on the property values, or echo them, or whatever else in the ANT script.
failonerror does seem to work correctly with mqsicreatebar - the challenge I continue to have is that when it fails, mqsicreatebar sometimes does not make it easy to see why it failed.
I'll keep you posted, and will appreciate any info you may see too. Thanks! _________________ Steve |
|
Back to top |
|
 |
mlafleur |
Posted: Fri Apr 07, 2006 5:05 am Post subject: |
|
|
Acolyte
Joined: 19 Feb 2004 Posts: 73
|
Add the vmlauncher="false" attribute to your exec tag. |
|
Back to top |
|
 |
skol |
Posted: Fri Apr 07, 2006 1:03 pm Post subject: |
|
|
Apprentice
Joined: 05 Apr 2006 Posts: 38
|
Thank you! Error stuff displays just fine now with vmlauncher=false. _________________ Steve |
|
Back to top |
|
 |
|