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 IndexWebSphere Message Broker Supportmqsideploy error on jenkins from ant script

Post new topicReply to topic
mqsideploy error on jenkins from ant script View previous topic :: View next topic
Author Message
shubham_rajput
PostPosted: Tue Aug 29, 2017 3:07 am Post subject: mqsideploy error on jenkins from ant script Reply with quote

Newbie

Joined: 29 Aug 2017
Posts: 4

I am trying to deploy my bar file using the following "build.xml" code:
Code:

<target name="mqsideploy.deploybar" depends="mqsicreatebar.buildbar">
    <echo message="Deploying Broker Archive file: ${bar.name} " />
    <exec executable="${runtime.dir}\mymqsideployscript.bat" spawn="false" logError="true"
vmlauncher="false" failonerror="true" append="true">
      <arg value="${Brokername}" />
      <arg value="-e" />
      <arg value="${execution.group}" />
      <arg value="-a" />
      <arg value="${workspaces.dir}\${appln.name}\${appln.name}.bar" />
    </exec>
    <echo message="Completed building Broker Archive file - ${bar.name} " />
  </target>


I have also modified mqsideployscript.bat to mymqsideployscript.bat to call mqsiprofile.cmd. The modified mymqsideployscript.bat looks like this:
Code:

@echo off
setlocal
CALL "C:\Program Files (x86)\IBM\MQSI\9.0.0.3\bin\mqsiprofile.cmd"
set PRODUCT_PATH=%~dp0..

if %1""=="" goto noparam

SET parm8=%8
SET parm9=%9
SHIFT /8
SET parm10=%9
SHIFT /8
SET parm11=%9
SHIFT /8
SET parm12=%9
SHIFT /8
SET parm13=%9
SHIFT /8
SET parm14=%9
SHIFT /8
SET parm15=%9
SHIFT /8
SET parm16=%9
SHIFT /8
SET parm17=%9
SHIFT /8
SET parm18=%9
SHIFT /8
SET parm19=%9
SHIFT /8
SET parm20=%9

@echo mqsisetmqenv

"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy %1 %2 %3 %4 %5 %6 %7 %parm8% %parm9% %parm10% %parm11% %parm12% %parm13% %parm14% %parm15% %parm16% %parm17% %parm18% %parm19% %parm20%
goto end

:noparam

"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy -?

:end
endlocal


I am using IIBV9.0.0.3 and Jdk 1.8.
When I run the build on Jenkins the deployment fails with the following error:

Code:

mqsideploy.deploybar:
     [exec]
     [exec] MQSI 9.0.0.3
     [exec] C:\Program Files (x86)\IBM\MQSI\9.0.0.3
     [exec]
     [exec] mqsisetmqenv
     [exec] BIP4516S: Failed to find all the required WebSphere MQ java classes. Class 'com.ibm.mq.MQException' not found in CLASSPATH 'C:\Program Files (x86)\IBM\MQSI\9.0.0.3\messages;C:\Program Files (x86)\IBM\MQSI\9.0.0.3\classes;C:\Program Files (x86)\IBM\MQSI\9.0.0.3\classes\ConfigManagerProxy.jar;C:\Program Files (x86)\IBM\MQSI\9.0.0.3\classes\brokerutil.jar;C:\ProgramData\Application Data\IBM\MQSI\common\wsrr'.
     [exec]
     [exec] Not all the WebSphere MQ jars are installed on this machine. Message Broker requires that WebSphere MQ for Java is installed to work correctly.
     [exec]
     [exec] Make sure that all the correct WebSphere MQ components are installed and that the CLASSPATH correctly contains the WebSphere MQ jar files.

Now I am confuse whether this problemis due to Java version or some other thing. A little help is really appreciated.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Aug 29, 2017 3:55 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17384

Call won't do it, I think.

I believe, without having done any research at all, that Windows CALL runs the command in a separate shell?

Or is that start?

Regardless, you need to make sure that the mqsisetenv is applied to the current shell inside your batch file.

Since you're having issues wiith MQ jars, you might run the relevant mq profie command as well.

Unless I"m wrong.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
shubham_rajput
PostPosted: Tue Aug 29, 2017 4:43 am Post subject: Added calling to mqsisetmqenv Reply with quote

Newbie

Joined: 29 Aug 2017
Posts: 4

I tried modifying the mymqsideployscript.bat by making a call to mqsisetmqenv too:
Code:

SHIFT /8
SET parm19=%9
SHIFT /8
SET parm20=%9

@call mqsisetmqenv
@call "C:\Program Files (x86)\IBM\MQSI\9.0.0.3\bin\mqsiprofile.cmd"

"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy %1 %2 %3 %4 %5 %6 %7 %parm8% %parm9% %parm10% %parm11% %parm12% %parm13% %parm14% %parm15% %parm16% %parm17% %parm18% %parm19% %parm20%
goto end

:noparam

and now it throws this error in Jenkins
Code:

 [exec] MQSI 9.0.0.3
     [exec] 'mqsisetmqenv' is not recognized as an internal or external command,
     [exec] operable program or batch file.
     [exec] C:\Program Files (x86)\IBM\MQSI\9.0.0.3
     [exec]
     [exec] BIP4516S: Failed to find all the required WebSphere MQ java classes. Class 'com.ibm.mq.MQException' not found in CLASSPATH 'C:\Program Files (x86)\IBM\MQSI\9.0.0.3\messages;C:\Program Files (x86)\IBM\MQSI\9.0.0.3\classes;C:\Program Files (x86)\IBM\MQSI\9.0.0.3\classes\ConfigManagerProxy.jar;C:\Program Files (x86)\IBM\MQSI\9.0.0.3\classes\brokerutil.jar;C:\ProgramData\Application Data\IBM\MQSI\common\wsrr'.
     [exec]
     [exec] Not all the WebSphere MQ jars are installed on this machine. Message Broker requires that WebSphere MQ for Java is installed to work correctly
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Aug 29, 2017 5:04 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17384

Try removing the call entirely. So just

mqsisetmqenv.cmd (.cmd?)
mqsiprofile.cmd

Unless I'm wrong, that should add things to the current shell.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
shubham_rajput
PostPosted: Tue Aug 29, 2017 5:14 am Post subject: Error coming after removing call Reply with quote

Newbie

Joined: 29 Aug 2017
Posts: 4

I tried removing call:
Code:

SET parm19=%9
SHIFT /8
SET parm20=%9

mqsisetmqenv.bat
mqsiprofile.cmd

"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy %1 %2 %3 %4 %5 %6 %7 %parm8% %parm9% %parm10% %parm11% %parm12% %parm13% %parm14% %parm15% %parm16% %parm17% %parm18% %parm19% %parm20%
goto end


It ends in showing error of not an internal or external command
Code:

mqsideploy.deploybar:
     [echo] Deploying Broker Archive file: D:\Ebics-phase1\EBICS_PHASE1\EBICS_PHASE1.bar
     [exec] 'mqsisetmqenv' is not recognized as an internal or external command,
     [exec] operable program or batch file.
     [exec] 'mqsiprofile.cmd' is not recognized as an internal or external command,
     [exec] operable program or batch file.
     [exec] The system cannot find the path specified.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Aug 29, 2017 5:34 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17384

use the full path.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
shubham_rajput
PostPosted: Tue Aug 29, 2017 9:01 pm Post subject: Error still coming after specifying the full path Reply with quote

Newbie

Joined: 29 Aug 2017
Posts: 4

Tried giving full path
Code:
SET parm19=%9
SHIFT /8
SET parm20=%9

"C:\Program Files (x86)\IBM\MQSI\9.0.0.3\bin\mqsisetmqenv.bat"
"C:\Program Files (x86)\IBM\MQSI\9.0.0.3\bin\mqsiprofile.cmd"

"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy %1 %2 %3 %4 %5 %6 %7 %parm8% %parm9% %parm10% %parm11% %parm12% %parm13% %parm14% %parm15% %parm16% %parm17% %parm18% %parm19% %parm20%
goto end


And again error comes
Code:
mqsideploy.deploybar:
     [exec] 'mqsifindmqpath' is not recognized as an internal or external command,
     [exec] operable program or batch file.
     [exec] set was unexpected at this time.


I tried opening the mqsisetmqenv.bat and there is a line of code in there and because of that mqsifindmqpath is not recognosed error is coming. The code of mqsisetmqenv is:
Code:
@echo off
SHIFT /0
FOR /f "tokens=*" %%i in ('mqsifindmqpath %* ') do SET MQSI_MQ_DIRECTORY=%%i
set MQSI_MQ_DIRECTORY=%MQSI_MQ_DIRECTORY%##
set MQSI_MQ_DIRECTORY=%MQSI_MQ_DIRECTORY: ##=%
set "MQSI_MQ_SETMQENV_CMD=%MQSI_MQ_DIRECTORY%\bin\setmqenv.cmd"

IF EXIST "%MQSI_MQ_SETMQENV_CMD%" @call "%MQSI_MQ_SETMQENV_CMD%" -s -x %MQSI_PROCESSOR_ARCHITECTURE%

IF %MQSI_PROCESSOR_ARCHITECTURE%==64 set "PATH=%MQ_JAVA_INSTALL_PATH%\lib64;%PATH%"
IF %MQSI_PROCESSOR_ARCHITECTURE%==32 set "PATH=%MQ_JAVA_INSTALL_PATH%\lib;%PATH%"
set CLASSPATH=%MQ_JAVA_INSTALL_PATH%\lib\com.ibm.mq.jar;%MQ_JAVA_INSTALL_PATH%\lib\com.ibm.mqjms.jar;%MQ_JAVA_INSTALL_PATH%\lib\connector.jar;%MQ_JAVA_INSTALL_PATH%\lib\com.ibm.mq.pcf.jar;%MQ_JAVA_INSTALL_PATH%\lib\com.ibm.mq.jmqi.jar;%MQ_JAVA_INSTALL_PATH%\lib\com.ibm.mq.headers.jar;%MQ_JAVA_INSTALL_PATH%\lib\com.ibm.mq.commonservices.jar;%CLASSPATH%


I also tried giving the path of mqsisetmqenv.bat and mqsiprofile.cmd without quotes it results in the error of unrecognised internal or external command

After some time I tried with modified code as
Code:
SHIFT /8
SET parm20=%9

@echo mqsisetmqenv
"C:\Program Files (x86)\IBM\MQSI\9.0.0.3\bin\mqsiprofile.cmd"

"%MQSI_JREPATH%\bin\java" com.ibm.broker.config.util.Deploy %1 %2 %3 %4 %5 %6 %7 %parm8% %parm9% %parm10% %parm11% %parm12% %parm13% %parm14% %parm15% %parm16% %parm17% %parm18% %parm19% %parm20%
goto end


It does not result in any error but still the bar file does not get deployed
Code:

mqsideploy.deploybar:
     [exec] mqsisetmqenv
     [exec]
     [exec] MQSI 9.0.0.3
     [exec] C:\Program Files (x86)\IBM\MQSI\9.0.0.3
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 30, 2017 3:57 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17384

Try running the setmqenv before the mqsiprofile...
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 30, 2017 4:22 am Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19246
Location: LI,NY

mqjeff wrote:
Try running the setmqenv before the mqsiprofile...

Shouldn't the setmqenv be run as part of the mqsiprofile?
See the part in setting up a command line environment
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Aug 30, 2017 4:27 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17384

fjb_saper wrote:
mqjeff wrote:
Try running the setmqenv before the mqsiprofile...

Shouldn't the setmqenv be run as part of the mqsiprofile?


mqjeff wrote:
Unless I"m wrong.

_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Wed Aug 30, 2017 4:44 am Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19246
Location: LI,NY

AFAIK there is not much sense in running setmqenv with V9 (at least early versions)
What you really have to do is cater for what is being called in the mqsisetmqenv.cmd.
If an environment variable is being used there you better cater for setting it beforehand... That might happen in a batch file called by mqsiprofile...

What I remember is mqsiprofile setting my environment to the version of MQ set in the file called by mqsiprofile depending on the value of the broker release... (because I set up my batchfile to do so)...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Wed Aug 30, 2017 5:24 am Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17384

Also what I recall using ant was that it was easier to run ant inside a shell that already had the mq env/mqsi env defined in it, rather than trying to do it within the ant file.
_________________
Read, Think, Try, Repeat
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker Supportmqsideploy error on jenkins from ant script
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.