I am using 7x (7.5 mq client amqmdnet.dll) via .net and using MQPutMessageOptions and MQGetMessageOptions, this code works fine with mq 7.5 ibm client, however
IBM link
says 7x mq client will be backward compatible with 6x, when i try to connect, i get this error (am in a windows 7 64-bit OS).
System.TypeInitializationException: The type initializer for 'IBM.WMQ.MQQueueManager' threw an exception. ---> System.TypeInitializationException: The type initializer for 'IBM.WMQ.CommonServices' threw an exception. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at IBM.WMQ.CommonServices..cctor()
--- End of inner exception stack trace ---
at IBM.WMQ.CommonServices.TraceEnabled()
at IBM.WMQ.MQBase..ctor()
at IBM.WMQ.Nmqi.NmqiEnvironment..ctor(NmqiPropertyHandler nmqiPropertyHandler)
at IBM.WMQ.Nmqi.NmqiFactory.GetInstance(NmqiPropertyHandler properties)
at IBM.WMQ.MQQueueManager..cctor()
The line that throws the above error is :
MQQueueManager mqQMgr = new MQQueueManager("My queue manager" , "my channel name" ,"my connection name");
PS: the above line with the same params work fine in 7.5 mq client , but fails when a 6x (for ex: 6.0.2.5 mq client is installed, i have done 'typical' installation (full installation of 6x mq client).
Any idea how to make it work with 6.0.2.5?
Yes, that link is correct. What the link is saying if you have MQ v7.5 client installed, you will be able to work with MQ v6.0 queue manager running on a remote machine. But what you are trying appears to be different. You appear to have compiled the application with MQ v7.5 client but trying to run it on MQ v6.0.x client. This will not work.
Related
I'm trying to call a gRPC service built using ASP.NET Core on .NET 5 from a Xamarin.Forms application.
I'm using Grpc.AspNetCore 2.35.0 on the server side and Grpc.Net.Client 2.35.0 within the app library (.NETStandard 2.1).
When trying to call a service from the client, I get an exception:
Exception caught: MyException: An unknown error happened
---> Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Error starting gRPC call. HttpRequestException: The SSL connection could not be established, see inner exception. AuthenticationException: Authentication failed, see inner exception. TlsException: CertificateUnknown", DebugException="System.Net.Http.HttpRequestException: The SSL connection could not be established, see inner exception.
---> System.Security.Authentication.AuthenticationException: Authentication failed, see inner exception.
---> Mono.Security.Interface.TlsException: CertificateUnknown
at Mono.AppleTls.AppleTlsContext.EvaluateTrust () [0x000bf] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/System/Mono.AppleTls/AppleTlsContext.cs:306
[… SNIP …]
I assume this has to do with the self signed certificate. I'm using the generated dev certificate created using dotnet dev-certs https tool.
I tried to add a custom handler to the created channel as suggested here:
GrpcChannel.ForAddress("https://localhost:5001", new GrpcChannelOptions
{
HttpHandler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback =
HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
}
});
And also the other suggestion:
AppContext.SetSwitch(
"System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
GrpcChannel.ForAddress("http://localhost:5000");
But both approaches result in another exception (presumably because this will use an older HttpClientHandler implementation that doesn't support HTTP/2.0):
Exception caught: MyException: An unknown error happened
---> Grpc.Core.RpcException: Status(StatusCode="Internal", Detail="Request protocol 'HTTP/1.1' is not supported.")
I also tried to circumvent the self-signed certificate by creating a custom CA plus certificate and installing that root certificate in the iOS simulator. But the same result occurred. I'm not sure if it would have made a difference on Android, because I was not able to install the root certificate on the emulator.
How can I use gRPC with Xamarin.Forms against a development server?
I've fixed he above exception changing my implementation to match this : https://techblog.livongo.com/implementing-grpc-in-a-xamarin-mobile-project/ block.
In more details:
I've added references to Grpc.Core, Grpc.Tools, Grpc.Net.Common, Grpc.Net.Client, Grpc.Core.Api;
I've added this code when creating the Channel:
var credentials = CallCredentials.FromInterceptor((context, metadata) => Task.CompletedTask);
return new Channel("<your domai>:<port>", ChannelCredentials.Create(new SslCredentials(), credentials));
We have a WCF .Net installation that has been working for years connecting to WebSphere MQ. When we switched to Windows 2016, we have been encountering some connectivity issues. The threads from the WCF application will connect and stay connected for about 5min and then they die. We can see the connections via the MQ browser, but consistently around 5-6min they all die. Was working fine on Windows 2012. If it was permissions I wouldn't expect any connections.
Client: 8.0.0.10 (latest version doesn't seem to help)
Lots of communication exceptions.
Errors from WCF log:
WCFCH0306E: An error occurred while attempting to receive data from endpoint 'jms:/queue?destination=**Redacted server etc here**&persistent=2&initialContextFactory=com.ibm.mq.jms.Nojndi'
The operation could not be completed.
Review the linked exception for further details.
The method MQBACK failed.
A WebSphere MQ call failed.
Please see the linked exception for more information.</Message><StackTrace> at IBM.XMS.Client.Impl.XmsSessionImpl.Dispose(Boolean disposing)
at IBM.XMS.Client.Impl.XmsSessionImpl.Close()
at IBM.XMS.WCF.XmsSessionResource.RemoveReference(Boolean throwExceptions)
at IBM.XMS.WCF.XmsConnectionManager.Close(Boolean throwExceptions)
at IBM.XMS.WCF.XmsChannelListener`1.CloseInternal(Boolean throwExceptions)</StackTrace><ExceptionString>IBM.XMS.IllegalStateException: The method MQBACK failed.
A WebSphere MQ call failed.
Please see the linked exception for more information.
at IBM.XMS.Client.Impl.XmsSessionImpl.Dispose(Boolean disposing)
at IBM.XMS.Client.Impl.XmsSessionImpl.Close()
at IBM.XMS.WCF.XmsSessionResource.RemoveReference(Boolean throwExceptions)
at IBM.XMS.WCF.XmsConnectionManager.Close(Boolean throwExceptions)
at IBM.XMS.WCF.XmsChannelListener`1.CloseInternal(Boolean throwExceptions)
Linked Exception : CompCode: 2, Reason: 2009
We are connecting to a specific website using a TLS connection. We are enforcing TLS 1.2 as the only allowed protocol in the client code. In about 99% of all cases connection setup is OK and shows no errors. However from time to time we receive the following exception:
System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The buffers supplied to a function was too small
--- End of inner exception stack trace ---
at System.Net.Security.SslState.EndProcessAuthentication(IAsyncResult result)
at Fw.Connections.Ssl.Private.ClientInstance.AuthenticateClientCallback(IAsyncResult result);
We have tested the remote server with SSL labs and we receive an A+ with no failures or problems reported, it's not a server under our control so the remote environment is not very well known.. We have tested the client code on Windows server 2012 (datacenter) and Windows7 clients. Both show the error from time to time. Is this a known bug in the .NET framework?
I was connecting to RabbitMQ with easynetQ driver without any issues when all of a sudden. I started getting this error
System.ArgumentException occurred
Message: Exception thrown: 'System.ArgumentException' in System.dll
Additional information: None of the discovered or specified addresses match the socket address family.
Why am i not able to find the rabbit mq server all of a sudden. What would be the root cause of this issue. No network configuration has changed.
Turns out I had the Break on exception setting turned on leading me to believe that the exception was coming through my code. The driver connects to the rabbitmq after the error is thrown.
I'm experiencing an exception upon construction of a UdpClient object, specifying the IPv4 family. This is only occuring on one Windows 7 64-bit machine, other machines with the same OS are working fine.
The precise exception is:
System.Net.Sockets.SocketException (0x80004005): An invalid argument was supplied
at System.Net.Sockets.Socket..ctor(AddressFamily addressFamily, SocketType socketType, ProtocolType protocolType)
at System.Net.Sockets.UdpClient.createClientSocket()
SocketException.ErrorCode is WSAEINVAL 10022, InvalidArgument.
The code that's throwing this exception:
this.udpClient = new UdpClient(AddressFamily.InterNetwork);
Can anyone explain what this exception is telling me? How can IPv4 be an invalid argument for a new UDP client?
UPDATE: This is only occurring when running the application from a network drive. Running it locally does not cause this exception.
The docs advise you to check SocketException::ErrorCode in this instance. What's the value of that? Should be instructive. The Family param is fine, I would think, or you would get ArgumentException.
If you receive a SocketException, use
SocketException::ErrorCode to obtain
the specific error code. Once you have
obtained this code, you can refer to
the Windows Sockets version 2 API
error code documentation in MSDN for a
detailed description of the error.
0x80004005 is an access denied, you do not have rights to create a socket, maybe your firewall?
Or your socket is in use, have you killed the program without terminating the socket?