ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Message Broker v6: mqsicreatebar not working from Ant

Post new topic  Reply to topic
 Message Broker v6: mqsicreatebar not working from Ant « View previous topic :: View next topic » 
Author Message
coding_monkey
PostPosted: Wed Mar 29, 2006 5:26 am    Post subject: Message Broker v6: mqsicreatebar not working from Ant Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Wed Mar 29, 2006 6:21 am    Post subject: Reply with quote

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
View user's profile Send private message
coding_monkey
PostPosted: Wed Mar 29, 2006 7:12 am    Post subject: Reply with quote

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
View user's profile Send private message
fschofer
PostPosted: Wed Mar 29, 2006 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Wed Mar 29, 2006 7:25 am    Post subject: Reply with quote

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
View user's profile Send private message
coding_monkey
PostPosted: Thu Mar 30, 2006 3:44 am    Post subject: Got it!! Reply with quote

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
View user's profile Send private message
skol
PostPosted: Wed Apr 05, 2006 11:28 am    Post subject: How about stdout/stderr? Reply with quote

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
View user's profile Send private message
coding_monkey
PostPosted: Wed Apr 05, 2006 1:08 pm    Post subject: Re: How about stdout/stderr? Reply with quote

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
View user's profile Send private message
skol
PostPosted: Wed Apr 05, 2006 1:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
mlafleur
PostPosted: Fri Apr 07, 2006 5:05 am    Post subject: Reply with quote

Acolyte

Joined: 19 Feb 2004
Posts: 73

Add the vmlauncher="false" attribute to your exec tag.
Back to top
View user's profile Send private message
skol
PostPosted: Fri Apr 07, 2006 1:03 pm    Post subject: Reply with quote

Apprentice

Joined: 05 Apr 2006
Posts: 38

Thank you! Error stuff displays just fine now with vmlauncher=false.
_________________
Steve
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Message Broker v6: mqsicreatebar not working from Ant
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.