Ignite thin client auto reconnect doesn't work - c#

Configuration on a single machine:
I have single server node
<ignite xmlns="http://ignite.apache.org/schema/dotnet/IgniteConfigurationSection" gridName="myGrid1">
<clientConnectorConfiguration port="10800"/>
<discoverySpi type="TcpDiscoverySpi" localPort='48500' localPortRange='1'>
<ipFinder type="TcpDiscoveryStaticIpFinder">
<endpoints>
<string>127.0.0.1:48500</string>
</endpoints>
</ipFinder>
</discoverySpi>
<communicationSpi type='TcpCommunicationSpi' localPort='48100' />
And thin client node:
Ignition.StartClient(new IgniteClientConfiguration { Host = "127.0.0.1", Port = 10800})
So I'm trying to make a next test:
1) shutdown server node
2) start server node againg
3) check connection from client node to server node
The problem is after 2 step when I call method
ignite.GetCache<long,Entity>("cacheName").TryGet(id, out item)
I get an exception
System.IO.IOException: Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.
---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size
at Apache.Ignite.Core.Impl.Client.ClientSocket.SendRequest(RequestMessage& reqMsg) at Apache.Ignite.Core.Impl.Client.ClientSocket.DoOutInOp[T](ClientOp opId, Action1 writeAction, Func2 readFunc, Func3 errorFunc) at Apache.Ignite.Core.Impl.Client.Cache.CacheClient2.DoOutInOp[T](ClientOp opId, Action1 writeAction, Func2 readFunc
at Apache.Ignite.Core.Impl.Client.Cache.CacheClient`2.TryGet(TK key, TV& value)

I am afraid that automatic reconnect is not supported by .Net thin client.
From the source code, Client is created once right away, which does Handshake once right away. There's no reconnect code in sight. There is an issue filed about Failover feature in Apache Ignite JIRA: not just reconnect, but try different node addresses.
This means you will have to check for disconnects and reconnect manually.

Related

System.IO.IOException: Connection timed out In Mailkit

I used MailKit.Net.Imap to read email in my mail box.
Sometimes I get an exception like that I shared below
System.IO.IOException: Connection timed out ---> System.Net.Sockets.SocketException (110): Connection timed out at MailKit.Net.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 count) --- End of inner exception stack trace ---
Is there any suggistion to solve this problem?
ImapClient client;
client = new ImapClient();
client.Timeout= (int)TimeSpan.FromMinutes(1).TotalMilliseconds;
Also, I can use timeout property of Imap, this can help me to solve this problem?
You have 2 options:
Increase the timeout using the ImapClient.Timeout property. (That said, 1 minute is less than the default timeout which is 2 minutes)
As Max points out in the comments below, properly handle exceptions and retry (which often will require reconnecting the ImapClient).

Connecting to a device on the local network over TCP *sometimes* fails with "No Route To Host" socket error

I'm making an Android app (using Unity and C#) which needs to connect over TCP to a different app running on another device (using the .NET System.Net.Sockets.TcpClient and TcpListener classes). The way this works is the host app broadcasts a UDP packet giving info on its local IP (192.168.x.x) and its TCP listening port. Upon receiving the UDP packet, the Android app attempts to connect to the TCP endpoint given. Most of the time (~80%), this works perfectly and the two devices establish a valid TCP connection. Sometimes though, the Android app receives the UDP packet, tries to connect over TCP but a "No Route To Host" socket error shows up instead; even trying again upon receiving the next UDP packet fails.
I'm suspecting that this is to do with the router creating different subnets. I'm not very familiar with networking code, so I'm not sure how to forward the TCP request over to a different subnet of the local network. What's weird is that the UDP packet is always received no matter what; and most of the time, the TCP request will fail for 10 minutes straight then start working again like nothing happened.
public async Task<bool> ConnectToHost(IPEndPoint endpoint) {
try {
TcpClient client = new TcpClient();
client.NoDelay = true;
IPAddress ipv4 = endpoint.Address;
Debug.Log("IPv4: " + ipv4);
await client.ConnectAsync(ipv4, endpoint.Port); // <--- this call throws the SocketException
Debug.Log("Connected.");
// ...
return true;
}catch(SocketException se) {
Debug.LogError("[TCPClient] Socket Exception (" + se.ErrorCode + "), cannot connect to host: " + se.ToString(), this);
}catch(Exception e) {
Debug.LogError("[TCPClient] Error, cannot connect to host: " + e.ToString(), this);
}
return false;//Could not connect
}
The ConnectAsync() call fails on the client side, giving the following SocketException (error code 10065, WSAEHOSTUNREACH); on server side, no trace of the message is ever seen.
05-29 13:31:54.591: I/Unity(24587): IPv4: 192.168.1.21
05-29 13:31:54.591: I/Unity(24587):
05-29 13:31:54.591: I/Unity(24587): (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
05-29 13:31:58.103: E/Unity(24587): [TCPClient] Socket Exception (10065), cannot connect to host: System.Net.Sockets.SocketException (0x80004005): No route to host
05-29 13:31:58.103: E/Unity(24587): at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException () [0x00014] in <9eab73f5583e4ab3921ff80e74ccdb29>:0
05-29 13:31:58.103: E/Unity(24587): at System.Net.Sockets.Socket.EndConnect (System.IAsyncResult asyncResult) [0x0002c] in <9eab73f5583e4ab3921ff80e74ccdb29>:0
05-29 13:31:58.103: E/Unity(24587): at System.Net.Sockets.TcpClient.EndConnect (System.IAsyncResult asyncResult) [0x0000c] in <9eab73f5583e4ab3921ff80e74ccdb29>:0
05-29 13:31:58.103: E/Unity(24587): at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (System.IAsyncResult iar, System.Func`2[T,TResult] endFunction, System.Action`1[T] endAction, System.Threading.Tasks.Task`1[TResult] promise, System.Boolean requiresSynchronization) [0x00019] in <a6266edc72ee4a578659208aefcdd5e1>:0

How to troubleshoot random error while sending email from ASP.NET website

I send emails from ASP.NET (4.0) website:
SmtpClient mySMTPClient = new SmtpClient();
mySMTPClient.UseDefaultCredentials = false;
mySMTPClient.Host = "email.privateemail.com";
mySMTPClient.Port = 465; //I also tried 587 and none of them
mySMTPClient.Credentials = new System.Net.NetworkCredential("contact#xxxxxx.com", "xxxxxxxxxx");
mySMTPClient.EnableSsl = true;
mySMTPClient.DeliveryMethod = SmtpDeliveryMethod.Network;
mySMTPClient.Send(email);
I send a dozen of emails / day and not in batch or in loop. Only about half of them are sent. The other fail with error:
ERROR MESSAGE: Failure sending mail.
INNER EXCEPTION: System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.DelegatedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.BufferedReadStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
at System.Net.Mail.SmtpConnection.GetConnection(ServicePoint servicePoint)
at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
The failing emails are random. I don't have a pattern.
Windows server 2008 SP2 build 6002
Firewall PfSense - engineer says rules are configured properly, otherwise all emails would fail.
3rd part email provider: they say everything is configured properly with them and they cannot make any modification on their side anyways.
I am not a network engineer and I don't have one. My question is, what do I do to find the root cause so I can address it?
By now I tried Process Monitor but it doesn't help me (or I don't know how to look).
I found several articles on this problem, none help me by now as their solutions don't apply to my context (I tried some with no success).
Thank you
This is an issue with NameCheap, I'm sick and tired of their email service, they won't fix it, my code runs fine on Gmail and Hotmail but every now and then fails when using NameCheap's SMTP server with " Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."

Entity Framework Model With Children in WCF Service works only once

To start off explaining, I have a model called VitalSign and one called VitalSignValues.
In my VitalSign model I have this code:
[ForeignKey("IdVitalSign")]
public virtual ICollection<VitalSignValue> VitalSignValues { get; set; }
In my VitalSignValue model:
public Guid IdVitalSign { get; set; }
And I got a default manager with basic functions like getAll(), ...
The project contains multiple web services and they all work fine, except for this one (VitalSignService). When I run the service, even with the WCF Test Client and I test the getAll function, it works.
The problem is that the getAll function only works like once, when I try to call the function again I suddenly get this error:
An error occurred while receiving the HTTP response to http://localhost/webservice/VitalSignService.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.
I tried to check the trace logs, but for some reason the only information it gives me is:
ASP.Net hosted compilation
AppDomain unloading
Here is the error log (although it doesn't really contain good information for me)
Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at IVitalSignService.GetAllVitalSigns()
at VitalSignServiceClient.GetAllVitalSigns()
Inner Exception:
The underlying connection was closed: An unexpected error occurred on a receive.
at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
Inner Exception:
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead)
Inner Exception:
An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
EDIT:
Here is some more information:
In my application, I call this function:
var client = new VitalSignServiceClient();
_vitalSigns = client.GetAllVitalSignsWithValues().ToList();
client.Close();
Inside of my service, I got this function:
public ICollection<VitalSign> GetAllVitalSignsWithValues()
{
return _vitalSignManager.GetAll("VitalSignValues");
}
In my generic manager, this happens:
public ICollection<TObject> GetAll(params string[] navigationProperties)
{
var query = Context.Set<TObject>().AsQueryable();
foreach (string navigationProperty in navigationProperties)
query = query.Include(navigationProperty);
var list = query.ToList<TObject>();
return list;
}
When I try to find the problem through debugging, it does go into the service, into the generic manager and it does get the VitalSigns, it's just the moment where the client retrieves the data from the web service that the error occurs and everything fails.
Also remember that all of this actually works (but only 1 out of 10 times, so probably only when the server refreshed it or something)
SOLVED: Removed the "virtual" in front of the IList
I don't like the way you're closing/disposing your WCF proxies and EF contexts. Looking for trouble there. Look into "using" like below. I would also recommend you don't use a static EF context. Again looking for trouble by doing this. (LinqToSql declare and instantiate DataContext best practice?). Third, I know it's tempting to make a generic repository that does everything but this ends up being more work than it's worth. For testing, performance and maintainability purposes, make your API calls specific.
Try:
using(var client = new VitalSignServiceClient()
{
_vitalSigns = client.GetAllVitalSignsWithValues().ToList();
}
public ICollection<VitalSign> GetAllVitalSigns()
{
using(ctx = new YourContext())
{
// do stuff
}
}

XMS - how to restore connection to WebSphere SIBus after network outage

I'm connecting to a JMS queue. The queue is hosted by WebSphere Application Server (version 8.0.0.5), using SIBus.
I have a simple program to reproduce some problematic behavior, it is written in C# and uses XMS (IBM's .NET API) to connect to the queue. Note: I obtained the IBM.XMS dlls from here: MQC71: WebSphere MQ V7.1 Clients
The scenario is this:
run the program (use an empty queue, so it sits waiting on a blocking Receive call)
disconnect network (unplug ethernet)
after a few minutes, the Receive call throws an exception
the program attempts to connect anew
this fails due to the network being down
...let it loop a bit to verify this error keeps occurring
restore the network (plug in ethernet)
the same error continues to occur (verified with WireShark that no network traffic occurs during the connectionFactory.CreateConnection() call)
So, the question is: why does the CreateConnection() call do nothing (does not send any packets) but fail?
using IBM.XMS;
using System;
namespace SimpleTest
{
class Program
{
static void Main(string[] args)
{
while (true)
{
try
{
string queueURI = "queue://your.details.GoHereDearReader";
string providerEndpoint = "1.2.3.4:1234";
string targetTransportChain = "InboundBasicMessaging";
string busName = "some_bus_name";
XMSFactoryFactory factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WPM);
IConnectionFactory connectionFactory = factoryFactory.CreateConnectionFactory();
connectionFactory.SetStringProperty(XMSC.WPM_PROVIDER_ENDPOINTS, providerEndpoint);
connectionFactory.SetStringProperty(XMSC.WPM_TARGET_TRANSPORT_CHAIN, targetTransportChain);
connectionFactory.SetStringProperty(XMSC.WPM_BUS_NAME, busName);
Log("Connecting...");
using (var connection = connectionFactory.CreateConnection())
{
using (var session = connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge))
{
using (var destination = session.CreateQueue(queueURI))
{
destination.SetIntProperty(XMSC.DELIVERY_MODE, XMSC.DELIVERY_NOT_PERSISTENT);
connection.Start();
using (IMessageConsumer consumer = session.CreateConsumer(destination))
{
Log("Receiving...");
IMessage recvMsg = consumer.Receive();
Log("recvMsg:" + recvMsg);
}
}
}
}
}
catch (Exception e)
{
Log(e.ToString());
}
Log("Sleeping some before consuming more...");
System.Threading.Thread.Sleep(10 * 1000);
}//while
}//Main
static void Log(string text)
{
Console.WriteLine(DateTime.UtcNow.ToString("HH:mm:ss.fff") + "-------------------------- " + text);
}
}
}
And some output:
16:38:19.483-------------------------- Connecting...
16:38:19.936-------------------------- Receiving...
16:43:31.952-------------------------- IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0022
EXCEPTION_RECEIVED_CWSIA0022.explanation
EXCEPTION_RECEIVED_CWSIA0022.useraction
at IBM.XMS.Impl.Connection.Dispose(Boolean disposing)
at IBM.XMS.Impl.Connection.Dispose()
at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 43
Linked Exception : IBM.XMS.SIB.JFAP.JFapConversationClosedException: Exception of type 'IBM.XMS.SIB.JFAP.JFapConversationClosedException' was thrown.
at IBM.XMS.SIB.JFAP.ConversationImpl.Send(IByteBuffer[] data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint, IReceiveListener recvListener, ISendListener sendListener, Object state)
at IBM.XMS.SIB.JFAP.ConversationImpl.RequestReplyExchange(IByteBuffer[] data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint)
at IBM.XMS.SIB.JFAP.ConversationImpl.RequestReplyExchange(IByteBuffer data, JFAPSegmentType segmentType, UInt16 requestNumber, IoPriority priority, Boolean pooledBufferHint)
at IBM.XMS.SIB.Comms.Client.JFAPCommunicator.RequestReplyExchange(IByteBuffer data, JFAPSegmentType sendSegType, MessagePriority priority, Boolean canPoolOnReceive)
at IBM.XMS.SIB.Comms.Client.ConnectionProxy.Close()
at IBM.XMS.Impl.Connection.Dispose(Boolean disposing)
16:43:31.952-------------------------- Sleeping some before consuming more...
16:43:41.967-------------------------- Connecting...
Exception : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.43.41.967444.txt
Exception : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
--- End of inner exception stack trace ---
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.43.41.983044.txt
16:43:41.983-------------------------- IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26
Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted 1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
--- End of inner exception stack trace ---
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:43:41.983-------------------------- Sleeping some before consuming more...
16:43:51.998-------------------------- Connecting...
Exception : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.43.51.998262.txt
Exception : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
--- End of inner exception stack trace ---
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.43.51.998262.txt
16:43:51.998-------------------------- IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26
Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted 1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
--- End of inner exception stack trace ---
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:43:51.998-------------------------- Sleeping some before consuming more...
16:44:02.013-------------------------- Connecting...
Exception : System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
FFDC to xmsffdc8416_2013.03.08T10.44.02.013479.txt
Exception : IBM.XMS.Formats.MFP.MessageEncodeFailedException: Exception of type 'IBM.XMS.Formats.MFP.MessageEncodeFailedException' was thrown. ---> System.InvalidOperationException: UniqueLinkObject no seen on handshake.
at IBM.XMS.Formats.MFP.SIB.SchemaManager.SendSchemas(ICommsConnection connection, JMFSchema[] schemas)
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
--- End of inner exception stack trace ---
at IBM.XMS.Formats.MFP.SIB.JsMsgObject.Encode(Object connection)
at IBM.XMS.Formats.MFP.SIB.TrmFirstContactMessageImpl.Encode(Object connection)
at IBM.XMS.SIB.Trm.ClientBootstrapHandler.Connect(IClientConnection clientConnection)
FFDC to xmsffdc8416_2013.03.08T10.44.02.013479.txt
16:44:02.013-------------------------- IBM.XMS.XMSException: EXCEPTION_RECEIVED_CWSIA0241
EXCEPTION_RECEIVED_CWSIA0241.explanation
EXCEPTION_RECEIVED_CWSIA0241.useraction
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection()
at SimpleTest.Program.Main(String[] args) in c:\Users\Administrator\Documents\Visual Studio Projects\TestJMSDequeue\SimpleTest\Program.cs:line 26
Linked Exception : IBM.XMS.Core.SIResourceException: CWSIT0006E: It is not possible to connect to bus your_bus_name_here because the following bootstrap servers could not be contacted 1.2.3.4:1234:BootstrapBasicMessaging and the following bootstrap servers returned an error condition . See previous messages for the reason for each bootstrap server failure.
The client cannot connect to the bus. This situation may be due to configuration problems, network problems or it may be that none of the required bootstrap servers or messaging engines are currently available.
Ensure that the network is working correctly and that the required bootstrap servers and messaging engines are available. ---> IBM.XMS.Core.SIConnectionLostException: Exception of type 'IBM.XMS.Core.SIConnectionLostException' was thrown.
at IBM.XMS.SIB.Comms.Client.ClientSideConnection.Connect(ConnectionProperties cp, IClientComponentHandshake cch, SICoreConnectionProperties siProps)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
--- End of inner exception stack trace ---
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.Bootstrap(Credentials credentials, SICoreConnectionProperties connectionProperties, ClientAttachProperties cap)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactoryImpl.CreateConnection(Credentials credentials, SICoreConnectionProperties connectionProperties)
at IBM.XMS.SIB.Trm.TrmSICoreConnectionFactory.CreateConnection(String username, String password, SICoreConnectionProperties connectionProperties)
at IBM.XMS.Impl.ConnectionFactory.CreateConnection(String userName, String password)
16:44:02.013-------------------------- Sleeping some before consuming more...
Note that in the above output I unplugged the network shortly after "Receiving..." and plugged it in again at 16:43:52, but the errors continued after that until I killed the program.
It reads like the ConnectionFactory does not reset it's state properly when the network becomes available again.
I have scoured the reference manual for any hint of a reset function on the factory - but havn't found one.
I would try this however: Move the GetInstance(...) and createConnectionFactory() out of the loop, as well as the SetStringProperty() lines.
If that doesn't work I cannot see why your client would not work.
Have you considered if this is a problem with the server? Which ethernet cable did you unplug? the one connected to the client or the server? If it was the server, does the same problem occur when you unplug the client cable?
If you restart the program, will it work then?
I know this is an old post, but maybe it will be still helpful.
You receive this error after you created 65.535 connections. It doesn't matter if you close the connection / dispose the object.
I see the following solutions:
1.) You can either create a connection once and reuse the connection for all your operations on the queue, until the connection breaks. Then you have to do a reconnect. (yes that's bad and against the common patterns. I wouldn't advice to do this)
2.) There is a bugfix for the version 8.0.0.6 available. EDIT: APAR #(IJ01244)
I don't know yet when it will included into future releases.
I guess you can contact the IBM support and refer to this PMR ID to receive an updated version of the IBM.XMS.SIB.dll
Hope this helps.

Categories

Resources