Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBM MQ Redistributable C Client Not working after manually configure - windows machine #189

Open
dhaka2071 opened this issue Dec 2, 2024 · 19 comments

Comments

@dhaka2071
Copy link

I am trying to install ibmmq 2.1.2 but not download lib automatically. npm recommend configuring manually. I did configure but it is not working. still get same error. I follow this link: https://www.ibm.com/docs/en/ibm-mq/9.2?topic=windows-installing-mq-client

Please help to me that, it is bug or else.

@chughts
Copy link

chughts commented Dec 2, 2024

You have two issues.

  1. The postinstall step is not detecting that you have already downloaded and configured the client. Which most likely means that you haven't set / propagated the relevant environment variables that would allow the postinstall to discover the client.
  2. You have a firewall that is preventing the postinstall from downloading the redistributable client.

@dhaka2071
Copy link
Author

@chughts
Thanks for your reply. I found it's successfully configured. Please check attachment.
configureENV

I follow this link: https://www.ibm.com/docs/en/ibm-mq/9.4?topic=windows-redistributable-clients

@chughts
Copy link

chughts commented Dec 2, 2024

Reading through the postinstall.js file and the readme it looks like you need to set the environment variable MQIJS_NOREDIST to any value, prior to the npm install.

@dhaka2071
Copy link
Author

@chughts
Yes. you are correct. I set MQIJS_NOREDIST= in .npmrc file and it's working. I am not sure that process is correct or else?. In production how to use if i use docker file. Thanks.

@chughts
Copy link

chughts commented Dec 2, 2024

If you are using a Dockerfile, then I would recommend that you allow the npm install process to download the linux redistributable client. There is a sample Dockerfile in the samples directory of this repo, that you can base on.

https://github.com/ibm-messaging/mq-mqi-nodejs/blob/1a66943362ddf7650d508bc5e4e3ff44a95b4f7a/samples/Dockerfile

There is also one in the dev-patterns repo - https://github.com/ibm-messaging/mq-dev-patterns/blob/master/ibm-messaging-mq-cloud-showcase-app/backend/Dockerfile

You may, however, need to set HTTPS_PROXY to allow the download to succeed. The README describes how to configure the proxy.

@dhaka2071
Copy link
Author

dhaka2071 commented Dec 3, 2024

@chughts
I am sorry, I am new in ibmmq. Could you please help me to configure bellow statement. How to configure ?

https://www.ibm.com/docs/en/ibm-mq/9.4?topic=windows-redistributable-clients

Classpath changes
The classpath used by dspmqver, setmqenv, and crtmqenv commands adds the com.ibm.mq.allclient.jar and com.ibm.mq.jakarta.client.jar to the environment, immediately following the com.ibm.mq.jar, and com.ibm.mqjms.jar.

I am getting exception while try to > npm start

Cannot find MQ C library.
System appears to be: win32[x64]
Has the MQ C client been installed?
Have you run setmqenv?

I need example value for this param both win and linux

CLASSPATH
INCLUDE
LIB
MANPATH
MQ_DATA_PATH
MQ_ENV_MODE
MQ_FILE_PATH
MQ_JAVA_INSTALL_PATH
MQ_JAVA_DATA_PATH
MQ_JAVA_LIB_PATH
MQ_JAVA_JVM_FLAG
MQ_JRE_PATH
PATH

@chughts
Copy link

chughts commented Dec 3, 2024

Most of those are Java settings, so not needed for your node.js app.

You will need to add the MQ client bin and lib64 directories to your windows PATH. Running setmqenv will do that for you in the current shell.

I recommend that these settings are applied before the npm install step, so you might need to clear out node_modules.

@dhaka2071
Copy link
Author

@chughts
npm install is working but while i try to start project i got this message:

Cannot find MQ C library.
System appears to be: win32[x64]
Has the MQ C client been installed?
Have you run setmqenv?

@chughts
Copy link

chughts commented Dec 3, 2024

Have you run setmqenv ?

@dhaka2071
Copy link
Author

PS C:> setmqenv
Usage: setmqenv (-m QMgrName| -n InstallationName | -p Path | -r | -s)
[-j 2.0|3.0] [-x 32|64]

Set up the environment for use with IBM MQ.

-j Set the environment for the specified JMS version - 2.0 (default) or 3.0.
-m Set the environment for the specified queue manager.
-n Set the environment for the specified installation.
-p Set the environment for the installation located in the specified path.
-r Remove IBM MQ from the environment.
-s Set the environment for the installation that this command comes from.
-x Set a 32-bit or 64-bit environment.

@chughts
Copy link

chughts commented Dec 3, 2024

So, no you haven't run setmqenv
Run setmqenv -s

In the shell that you want to run the node.js app.
If you close the terminal, then you have to run setmqenv -s again.

@dhaka2071
Copy link
Author

dhaka2071 commented Dec 3, 2024

PS C:> setmqenv -s
PS C:> setmqenv -s
PS C:> npm start

Cannot find MQ C library.
System appears to be: win32[x64]
Has the MQ C client been installed?
Have you run setmqenv?

C:\node_modules\ibmmq\lib\mqi.js:287
throw err;
^
{ message: 'Win32 error 126' }

@chughts
Copy link

chughts commented Dec 3, 2024

I think you need to :

  1. Shouldn't be necessary, but a corrupted cache is a bad cache. Run npm cache clean
  2. Clean out node_modules
  3. Run setmqenv -s
  4. Check that the path has been updated, by running echo %PATH%
  5. Run npm install
  6. Run npm start

If it still fails, then list your %PATH% here.

@dhaka2071
Copy link
Author

Path:

C:\Program Files\Adaptiva\AdaptivaClient\bin\x32;
C:\Program Files\Adaptiva\AdaptivaClient\bin\x64;
C:\Program Files\Microsoft VS Code\bin;
C:\Program Files\PowerShell\7;C:\Program Files\nodejs;
C:\Users\dhk\MQC-Redist\bin;
C:\Users\dhk\MQC-Redist;
C:\Users\dhk\AppData\Local\Microsoft\WindowsApps;
C:\Users\dhk\AppData\Local\Programs\Git\cmd;
C:\Users\dhk\AppData\Roaming\npm;

@chughts
Copy link

chughts commented Dec 3, 2024

What is in C:\Users\dhk\MQC-Redist\bin ?

@dhaka2071
Copy link
Author

MQC Client bin location

@chughts
Copy link

chughts commented Dec 3, 2024

contents please.
plus contents of C:\Users\dhk\MQC-Redist\lib64

@dhaka2071
Copy link
Author

hi @chughts

I didn't found lib64

image

@chughts
Copy link

chughts commented Dec 4, 2024

amongst other files, your bin directory should contain.

amqcgskv.exe
amqcmema.dll
amqicdir.exe
amqidsec.bat
amqltmcc.dll
amqmadcn.dll
amqmdmsg.dll
amqmdnac.dll
amqmdnet.dll
amqmdnetstd.dll
amqmdnm.dll
amqmdnsp.dll
amqmdxcs.dll
amqmtmgc.dll
amqmtsxatmc.dll
amqmxmsstd.dll
amqrmqia.dll
amqsgetc.exe
amqsputc.exe
amqxcs2.dll
amqxms0n.dll
amqxzu.dll
ccdt_schema.json
crtmqcvx.exe
crtmqenv.exe
dmpmqcfg.exe
dspmqrte.exe
dspmqver.exe
dspxmsver.exe
endmqdnm.exe
endmqtrc.exe
ffstsummary.exe
genmqpkg.cmd
mqcc1415.dll
mqcc4swi.dll
mqccics4.dll
mqcxa.dll
mqdc.dll
mqe.dll
mqecs.dll
mqic.dll
mqic32.dll
mqic32xa.dll
mqiccb.dll
mqiccb32.dll
mqiccbb.dll
mqicxa.dll
mqm.dll
mqrc.exe
mqutx.dll
mqz.dll
mqzsd.dll
runmqakm.exe
runmqdlq.exe
runmqdnm.exe
runmqras.cmd
runmqsc.exe
runmqtmc.exe
setmqenv.cmd
strmqtrc.exe

If it does then providing that there is nothing in

C:\Program Files\Adaptiva\AdaptivaClient\bin\x32;
C:\Program Files\Adaptiva\AdaptivaClient\bin\x64;
C:\Program Files\Microsoft VS Code\bin;
C:\Program Files\PowerShell\7;C:\Program Files\nodejs;

that is interfering then the path is set correctly. In which case I can only guess that a bad install / build has been cached. So you should carry out a clean build, with a cleaned out cache, and force the usage of bin64 over bin -

rmdir node_modules /s /q
npm cache clean
setmqenv -s -x 64
npm install
npm start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants