MQ

 View Only
Expand all | Collapse all

404 Error in IIS for .net 6 applicqion while using IBM MQ

  • 1.  404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Mon February 26, 2024 12:32 PM

    Hi,

    I am using IBM MQ nuget package IBMXMSDotnetClient 9.3.4.1 (XMS.net). Visual Studio 2022 and .Net 6.

    My application is running fine in Visual Studio 2022 and as a Console application. However after launching the swagger in IIS I am getting below error - 

    I am not using any MQClient.ini as its not required by application.

    Application '/LM/W3SVC/6/ROOT' with physical root 'C:\inetpub\wwwroot\.Project.API\' hit unexpected managed exception, exception code = '0xe0434352'. First 30KB characters of captured stdout and stderr logs:
    'dspmqver' is not recognized as an internal or external command,
    operable program or batch file.
    Unhandled exception. System.IO.FileNotFoundException: Error reading the  directory.
       at System.IO.FileSystemWatcher.StartRaisingEvents()
       at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
       at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
    at IBM.WMQ.MQClientCfg.CheckForMqclientIniFileChanges()
       at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
       at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
       at IBM.XMS.Client.WMQ.Common.WmqPropertyHandler..ctor()
     at IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory.InitialiseWMQConnectionFactory()
       at IBM.XMS.Client.WMQ.Factories.WmqConnectionFactory..ctor(XmsPropertyContext props)
       at IBM.XMS.Client.WMQ.Factories.WmqFactoryFactory.CreateProviderConnectionFactory(XmsPropertyContext properties)
       at IBM.XMS.Client.Impl.XmsConnectionFactoryImpl.SetProviderFactory()
       at IBM.XMS.Admin.Objects.MQConnectionFactory..ctor()
    at IBM.XMS.Admin.Objects.WmqXmsFactory.CreateConnectionFactory()
       at IBM.XMS.Client.Impl.XmsFactoryFactoryImpl.CreateConnectionFactory()
       at Gates.Crew.Backend.Services.DI.Extensions.AddIBMQueueIntegrationServices(IServiceCollection services, IConfiguration configuration) in 

    The apppool is set to Runtime - No managed code

    Any help appreciated.



    ------------------------------
    Shoeb Mirza
    ------------------------------


  • 2.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    IBM Champion
    Posted Tue February 27, 2024 02:47 PM

    > 'dspmqver' is not recognized as an internal or external command,

    Did you install the MQ Client software on that server? If so, when running under IIS, does the application have permission to access the executables of MQ?

    later

    Roger



    ------------------------------
    Roger Lacroix
    CTO
    Capitalware Inc.
    London ON Canada
    https://capitalware.com
    ------------------------------



  • 3.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Wed February 28, 2024 01:07 PM
    Edited by Andres Parada Fri March 01, 2024 02:18 PM

    Ensure that the IBM MQ client is properly installed on the server running IIS. Verify that the environment variables are set correctly, including PATH. Confirm that necessary DLLs are accessible by the application. Check if MQClient.ini is required despite stating otherwise. Ensure proper permissions for the application to access required directories. Review configuration settings for any discrepancies between the console application and IIS deployment. Apart from this, when I click on winch's post in this website, I often see this 404 error. But this link often times when I click on this link after some time or after a day, this 404 error has ended. I have come to know that this error is caused by the website and not by Google.



    ------------------------------
    moere bscc
    ------------------------------



  • 4.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Wed February 28, 2024 02:19 PM

    Use the setmqenv command to initialize the current command environment before executing IBM MQ related commands



    ------------------------------
    Bob
    ------------------------------



  • 5.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Thu March 07, 2024 08:22 AM
    IBM MQ is installed and IIS user has full access to it

    Still same error





  • 6.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Thu March 07, 2024 02:09 PM
    C:\> dir /b /s C:\setmqenv.cmd is giving error - File Not Found



    ------------------------------
    Shoeb Mirza
    ------------------------------



  • 7.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    IBM Champion
    Posted Thu March 07, 2024 04:30 PM

    IBM MQ is installed and IIS user has full access to it

    C:\> dir /b /s C:\setmqenv.cmd is giving error - File Not Found

    Ok. That says you don't have MQ installed on your C: drive. You say MQ is installed then which drive did you or the MQAdmin install MQ on?

    Here's my setup where IBM MQ v9.3 is installed on my D: drive.

    C:\>dir /b /s C:\setmqenv.cmd
    File Not Found

    C:\>dir /b /s D:\setmqenv.cmd
    D:\Program Files\IBM\MQ\bin\setmqenv.cmd

    If your goal is simply to run the dspmqver command then why don't you just add the MQ bin or bin64 directory to the System's PATH environment variable. To run the 64-bit version of dspmqver, just add the path to bin64 PATH environment variable and in my case it would be "D:\Program Files\IBM\MQ\bin64".

    i.e.

    C:\>dir /b /s D:\dspmqver.exe
    D:\Program Files\IBM\MQ\bin\dspmqver.exe
    D:\Program Files\IBM\MQ\bin64\dspmqver.exe

    later

    Roger



    ------------------------------
    Roger Lacroix
    CTO
    Capitalware Inc.
    London ON Canada
    https://capitalware.com
    ------------------------------



  • 8.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Fri March 08, 2024 11:31 AM

    Is MQ installed on the C: drive?  From the output generated by this command, I would suspect not.

    C:\> dir /b /s C:\setmqenv.cmd

    If, for example, it is on the D: drive, replace the C: in the dir command with the drive letter where MQ is installed.  If you aren't sure, you can provide multiple drive letters on the dir command.  For example:

    C:\> dir /b /s C:\setmqenv.cmd D:\setmqenv.cmd E:\setmqenv.cmd F:\setmqenv.cmd

    You can specify as many drive letters as exist on your system.  You will get a "File not found" message for each drive letter where the setmqenv.cmd file is not present.



    ------------------------------
    Bob
    ------------------------------



  • 9.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Tue March 12, 2024 11:46 PM

    Hi Bob,

    both setmqenv and dspmqver are working. I am not getting any bit found error. Now it's giving error as 

    System.IO.FileNotFoundException: Error reading the  directory.
       at System.IO.FileSystemWatcher.StartRaisingEvents()
       at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
       at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
    at IBM.WMQ.MQClientCfg.CheckForMqclientIniFileChanges()
       at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
       at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
       at



    ------------------------------
    Shoeb Mirza
    ------------------------------



  • 10.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    IBM Champion
    Posted Fri March 08, 2024 02:36 PM

    Hello Shoeb Mirza,

    Shoeb Mirza sent me a private message with the following:

    IBM MQ is installed at below location - However I don't see bin or bin64 or client.ini file. Please help. In my code I am using nuget package 9.3.4.1 of IBM MQ. In visual studio my code is working and I can post message successfully.

    Plus a screenshot of his MQ Explorer directory tree.

    First off, MQ Explorer is not IBM MQ Server or Client install. MQ Explorer is an MQAdmin tool to create/alter/delete MQ objects.

    I, plus another person, asked you if you installed the IBM MQ Client. You said yes it was but clearly it is not installed. You downloaded a single DLL (IBMXMSDotnetClient 9.3.4.1) from NuGet. That is NOT the IBM MQ Client. Your code is trying to run/execute dspmqver program. If you checked where you put the DLL then you would have seen that it was missing.

    If you didn't know what we were referring to when we asked you about IBM MQ Client being installed then you should have said you didn't understand what we were referring to.

    The IBM MQ Client v9.3 can be downloaded from: https://ibm.biz/mq93clients

    The latest release of IBM MQ Client is v9.3.5.0, and for Windows 64, you need to select the one labelled "9.3.5.0-IBM-MQC-Win64 ". You will download it then run the installer to install it. Now you will have the IBM MQ Client installed which includes the program dspmqver.

    later

    Roger



    ------------------------------
    Roger Lacroix
    CTO
    Capitalware Inc.
    London ON Canada
    https://capitalware.com
    ------------------------------



  • 11.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Sat March 09, 2024 02:06 AM

    I can fire dspmqver.exe now. Howeve the IIS error still exist. I have set path in environment variables as well



    ------------------------------
    Shoeb Mirza
    ------------------------------



  • 12.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Tue March 12, 2024 03:15 PM

    There is a .FDC file created with below message - 

    ----- amqxfdcp.c : 1075 -------------------------------------------------------
    03/11/24 10:09:25 - Process(2252.1) Program(dspmqver.exe)
                          Host(EKCDEVAPP1) Installation(Installation)
                          VRMF(9.3.5.0)
                          Time(2024-03-11T06:09:25.618Z)
                          ArithInsert1(1073766681) ArithInsert2(20)
     CommentInsert1(User name too long : (Arith1) > (Arith2))
                          CommentInsert2(C:\ProgramData\IBM\MQ\errors\AMQ2252.0.FDC)
                          CommentInsert3(XC274150)
     
    I could not find anything for this Probe - XC274150
    Any help appreciated
     
    AMQ6119S: An internal IBM MQ error has occurred (User name too long : (Arith1)
    > (Arith2))
     
    EXPLANATION:
    MQ detected an unexpected error when calling the operating system. The MQ error
    recording routine has been called. An FFST containing diagnostic data has been
    written to 'C:\ProgramData\IBM\MQ\errors\AMQ2252.0.FDC' with probe 'XC274150'.
    ACTION:



    ------------------------------
    Shoeb Mirza
    ------------------------------



  • 13.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Mon March 11, 2024 04:42 AM

    I have installed the package again and can fire below commands - 

    Installation path:

    Environment Variables :

    Path:

    mqclient.ini is created by setup at C:\Program Files\IBM\MQ\samp\mqclient.ini

    with below values - 

    Also, I have given full access to IUSR and application user.

    I did IIS reset and browsed, Still getting same error - What is it with mcclient.ini? what location is expected here?

    FileNotFoundException: Error reading the directory.
    System.IO.FileSystemWatcher.StartRaisingEvents()
    System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
    System.IO.FileSystemWatcher.set_EnableRaisingEvents(bool value)
    IBM.WMQ.MQClientCfg.CheckForMqclientIniFileChanges()

    As mentioned in the beginning, all my settings to connect to MQ are under appsettings.json

    "Hostname": 
    "Port":
    "ChannelName":     
    "QueueManagerName":
    "ProducerQueueName": 
    "MessageReadTimeOut":
    "MessageWriteTimeOut": 
    @Roger Lacroix Please post to the main group if its private.



    ------------------------------
    Shoeb Mirza
    ------------------------------



  • 14.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    Posted Mon March 11, 2024 09:50 PM

    I have installed the package again and can fire below commands - 

    Installation path:

    Environment Variables :

    Path: 

    mqclient.ini is created by setup atC:\Program Files\IBM\MQ\samp\mqclient.ini

    with below values - 

    Also, I have given full access to IUSR and application user.

    I did IIS reset and browsed, Still getting same error - What is it with mcclient.ini? what location is expected here? Should I place dspmqver at a different location?

    FileNotFoundException: Error reading the directory.
    System.IO.FileSystemWatcher.StartRaisingEvents()
    System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
    System.IO.FileSystemWatcher.set_EnableRaisingEvents(bool value)
    IBM.WMQ.MQClientCfg.CheckForMqclientIniFileChanges()

    As mentioned in the beginning, all my settings to connect to MQ are underappsettings.json

    "Hostname": 
    "Port":
    "ChannelName":     
    "QueueManagerName":
    "ProducerQueueName": 
    "MessageReadTimeOut":
    "MessageWriteTimeOut": 






  • 15.  RE: 404 Error in IIS for .net 6 applicqion while using IBM MQ

    IBM Champion
    Posted Wed March 13, 2024 06:04 AM

    As you seem to be using mqclient.ini, please make sure that you are set to be using MQAUTHENTICATION_USE_MQCSP or the equivalent for .NET.

    Depending on the package there was some obscure note that said if the authentication is not made via the MQCSP method the userid could get truncated at (don't remember if it was 8 or 12). I've seen it happen in Java where you were not able to authenticate the user id as it got truncated. In non MQCSP mode the password may also get truncated (i believe if longer as 16 chars?)

    Hope it helps.



    ------------------------------
    Francois Brandelik
    ------------------------------