Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 1613 invoked from network); 29 May 2009 20:19:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 May 2009 20:19:01 -0000 Received: (qmail 8267 invoked by uid 500); 29 May 2009 20:19:13 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 8210 invoked by uid 500); 29 May 2009 20:19:13 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 8200 invoked by uid 99); 29 May 2009 20:19:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2009 20:19:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2009 20:19:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 721CD234C1ED for ; Fri, 29 May 2009 13:18:51 -0700 (PDT) Message-ID: <2108209347.1243628331464.JavaMail.jira@brutus> Date: Fri, 29 May 2009 13:18:51 -0700 (PDT) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQNET-152) Infinit exception at reconnect on Mono with failover transport. In-Reply-To: <803320818.1237458042780.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQNET-152?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51990#action_51990 ] Timothy Bish commented on AMQNET-152: ------------------------------------- I'm able to reproduce this with Mono 2.2 and 2.4 using the latest trunk code. I had to replace the Console.ReadKey with Console.Readline so that the program would stop exiting early on me while trying to kill the broker ( Mono seemed to interpret my mouse clicks as keypress events ). The code seems to behave ok if you startup without a broker running and connect once you start the broker. If you startup with a broker running and then kill and restart the broker the reported error occurs. > Infinit exception at reconnect on Mono with failover transport. > --------------------------------------------------------------- > > Key: AMQNET-152 > URL: https://issues.apache.org/activemq/browse/AMQNET-152 > Project: ActiveMQ .Net > Issue Type: Bug > Components: ActiveMQ Client > Environment: Mono 1.9.1 framework on both Windows/Linux system. > Reporter: Tomasz Wiczling > Assignee: Jim Gomes > Fix For: 1.1 > > > I'm testing failover transport on Mono. > I've downloaded latest revision of ActiveMQ .Net project (rev. 752559). > I've made tests on: > - both Windows and Linux > - Mono 1.9.1 and Mono 2.0 > - ActiveMQ 5.1 and ActiveMQ 5.2 > All test ended with an exception. > I wrote simple program that was listening on topic. > namespace IssueExample > { > internal class ConsoleTracer : ITrace > { > public bool IsDebugEnabled { get { return true; } } > public bool IsInfoEnabled { get { return true; } } > public bool IsWarnEnabled { get { return true; } } > public bool IsErrorEnabled { get { return true; } } > public bool IsFatalEnabled { get { return true; } } > public void Debug(string message) { Console.WriteLine("DEBUG:" + message); } > public void Info(string message) { Console.WriteLine("INFO:" + message); } > public void Warn(string message) { Console.WriteLine("WARN:" + message); } > public void Error(string message) { Console.WriteLine("ERROR:" + message); } > public void Fatal(string message) { Console.WriteLine("FATAL:" + message); } > } > class Program > { > public static void Main(string[] args) > { > if (args.Length < 2) > { > Console.WriteLine("USAGE: IssueExample "); > return; > } > Tracer.Trace = new ConsoleTracer(); > IConnectionFactory factory = new ConnectionFactory(args[0]); > IConnection connection = factory.CreateConnection(); > ISession session = connection.CreateSession(); > IDestination destination = session.GetTopic(args[1]); > IMessageConsumer consumer = session.CreateConsumer(destination); > consumer.Listener += onMessage; > connection.Start(); > Console.WriteLine("Successfully connected to Topic '" + args[1] + "' on '" + args[0] + "' - waiting Any Key to be pressed"); > Console.ReadKey(); > consumer.Close(); > connection.Dispose(); > Console.WriteLine("Connected and Disconnected successfully toTopic '" + args[1] + "' on '" + args[0] + "' - Press any key to terminate program."); > Console.ReadKey(); > } > private static void onMessage(IMessage msg) > { > Console.WriteLine("\tRECEIVING: " + msg); > } > } > } > The test was made with execution: > # mono IssueExample.exe failover:(tcp://localhost:61616) test.topic > Program works fine till the test of reconnection. > While the program is running I restart the AMQ server. > For a while I get loop of: > (...) > DEBUG:Waiting 1280 ms before attempting connection. > DEBUG:Attempting connect to: tcp://localhost:61616/ > DEBUG:Opening socket to: localhost on port: 61616 > DEBUG:Connect fail to: tcp://localhost:61616/, reason: System.Net.Sockets.SocketException: Connection refused > at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remote_end) [0x00000] > at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.Connect (System.String host, Int32 port) [0x00000] > at Apache.NMS.ActiveMQ.Transport.Tcp.TcpTransportFactory.CompositeConnect (System.Uri location) [0x00000] > at Apache.NMS.ActiveMQ.Transport.TransportFactory.CompositeConnect (System.Uri location) [0x00000] > at Apache.NMS.ActiveMQ.Transport.Failover.FailoverTransport.doReconnect () [0x00000] > (...) > And it is OK, but ... > When server resumes work, I get: > (...) > DEBUG:Waiting 20480 ms before attempting connection. > DEBUG:Parsing type: 2 with: Apache.NMS.ActiveMQ.OpenWire.V2.BrokerInfoMarshaller > DEBUG:Parsing type: 30 with: Apache.NMS.ActiveMQ.OpenWire.V2.ResponseMarshaller > ERROR:Unknown response ID: 0 for response: Response[ CorrelationId=1 ] > DEBUG:Parsing type: 10 with: Apache.NMS.ActiveMQ.OpenWire.V2.KeepAliveInfoMarshaller > INFO:Keep alive message received. > INFO:Waiting for transport to reconnect. > DEBUG:Attempting connect to: tcp://localhost:61616/ > DEBUG:Opening socket to: localhost on port: 61616 > DEBUG:Parsing type: 1 with: Apache.NMS.ActiveMQ.OpenWire.V1.WireFormatInfoMarshaller > DEBUG:Connect fail to: tcp://localhost:61616/, reason: System.InvalidCastException: Cannot cast from source type to destination type. > at System.Collections.Generic.Dictionary`2+ValueCollection[Apache.NMS.ActiveMQ.Commands.SessionId,Apache.NMS.ActiveMQ.State.SessionState].System.Collections.ICollection.CopyTo (System.Array array, Int32 index) [0x00000] > at System.Collections.ArrayList.InsertRange (Int32 index, ICollection c) [0x00000] > at System.Collections.ArrayList.AddRange (ICollection c) [0x00000] > at System.Collections.ArrayList..ctor (ICollection c) [0x00000] > at Apache.NMS.ActiveMQ.State.SynchronizedCollection`1[Apache.NMS.ActiveMQ.State.SessionState]..ctor (ICollection c) [0x00000] > at Apache.NMS.ActiveMQ.State.SynchronizedDictionary`2[Apache.NMS.ActiveMQ.Commands.SessionId,Apache.NMS.ActiveMQ.State.SessionState].get_Values () [0x00000] > at Apache.NMS.ActiveMQ.State.ConnectionState.get_SessionStates () [0x00000] > at Apache.NMS.ActiveMQ.State.ConnectionStateTracker.DoRestoreSessions (ITransport transport, Apache.NMS.ActiveMQ.State.ConnectionState connectionState) [0x00000] > at Apache.NMS.ActiveMQ.State.ConnectionStateTracker.DoRestore (ITransport transport) [0x00000] > at Apache.NMS.ActiveMQ.Transport.Failover.FailoverTransport.restoreTransport (ITransport t) [0x00000] > at Apache.NMS.ActiveMQ.Transport.Failover.FailoverTransport.doReconnect () [0x00000] > (...) > And this is permanent state. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.