0

We are using the channel definition file to get the hostname and channel based on queue manager name.

But sometimes we are seeing the below error, is there any solution for this.

This is maybe due to multiple threads trying to access at the same time?

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException

at System.Runtime.InteropServices.Marshal.PtrToStructureHelper(IntPtr, System.Object, Boolean)

Details:

  1. What kind of CCDT file is it? Binary or JSON? -Binary

  2. Is your .NET application running in managed or non-managed mode? -Managed

  3. What version of the MQ Client software are you using? -9.2.0.6

  4. What release of MQ created the CCDT file? -8.x

  5. How did you set the information for your program to use the CCDT file? - Set using command: setx MQCHLLIB C:\test\ /M setx MQCHLTAB cctdtest.TAB /M

  6. Show us the C# code that creates the parameters and newing of the MQQueueManager class enter code here

var connectionProperties = new Hashtable(); 
connectionProperties.Add(MQC.TRANSPORT_PROPERTY,  MQC.TRANSPORT_MQSERIES_MANAGED);
//In case of network issues - reconnect to same queue manager
if (!string.IsNullOrEmpty(MQHostName))  
{                          
  connectionProperties.Add(MQC.CONNECT_OPTIONS_PROPERTY, MQC.MQCNO_RECONNECT_Q_MGR);                                
  connectionProperties.Add(MQC.CONNECTION_NAME_PROPERTY, String.Format("{0}({1})", MQHostName, MQPort));
}
//Start Creating Inbound connection for reading the messages.
if (MQQueueNameIn != null && MQQueueNameIn.Length > 0)
{
  queueManagerIn = new MQQueueManager(MQManagerName, connectionProperties);                    
  queueIn = queueManagerIn.AccessQueue(MQQueueNameIn, MQC.MQOO_BROWSE + MQC.MQOO_INPUT_SHARED + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INQUIRE);
}

3
  • @Roger: did you get a chance to look into the details?
    – b_patil
    Nov 18 at 5:35
  • @JoshMc: Can you please help?
    – b_patil
    Nov 18 at 5:38
  • Experts, please help me.
    – b_patil
    Nov 21 at 16:49

1 Answer 1

0

You need to provide a lot more information. Update your question with the answers from the following questions:

  • What kind of CCDT file is it? Binary or JSON?
  • Is your .NET application running in managed or non-managed mode?
  • What version of the MQ Client software are you using? Give all 4 digits. i.e. 9.3.0.2
  • What release of MQ created the CCDT file?
  • Show us the C# code that creates the parameters and newing of the MQQueueManager class.
6
  • I added the details in the question.
    – b_patil
    Nov 17 at 6:56
  • Please help me.
    – b_patil
    Nov 21 at 16:50
  • How did you set the information for your program to use the CCDT file? Update your question with the information. Did you test the same CCDT with the MQ-supplied sample program like amqsputc or amqsgetc using the environment variables MQCHLLIB and MQCHLTAB? If so, did it work?
    – Roger
    Nov 22 at 0:58
  • Updated the question. It works fine sometime and sometime it throws error.
    – b_patil
    Nov 22 at 6:24
  • What do you mean? What throws an error? The MQ samples or your own code? Please be more descriptive in your responses.
    – Roger
    Nov 22 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.