Uploaded image for project: 'ActiveMQ .Net'
  1. ActiveMQ .Net
  2. AMQNET-411

NMS.Stomp: System.FormatException in the Inactivity Monitor on Windows 8 with a non US (European) Current Culture

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.3
    • Fix Version/s: 1.5.4, 1.6.0
    • Component/s: NMS, Stomp
    • Labels:
      None
    • Environment:

      Windows 8, .NET Framework 2.0, ActiveMQ 5.6 with STOMP

      Description

      I have a Windows 8 PC where the Current Culture is set to nl-BE. I'm communicating with an ActiveMQ 5.6 Server using STOMP.

      When I issue a connection.Start(), I get a ConnectionClosedException "The connection is already closed!". When I enable tracing, I get another exception before that:

      Debug: Exception received in the Inactivity Monitor: System.FormatException: Inp
      ut string was not in a correct format.
      at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffe
      r& number, NumberFormatInfo info, Boolean parseDecimal)
      at System.Number.ParseSingle(String value, NumberStyles options, NumberFormat
      Info numfmt)
      at System.Single.Parse(String s, NumberStyles style, NumberFormatInfo info)
      at System.Single.Parse(String s)
      at Apache.NMS.Stomp.Protocol.StompWireFormat.ReadConnected(StompFrame frame)
      in c:\Users\fretje\Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.N
      MS.Stomp-1.5.3-src\src\main\csharp\Protocol\StompWireFormat.cs:line 200
      at Apache.NMS.Stomp.Protocol.StompWireFormat.CreateCommand(StompFrame frame)
      in c:\Users\fretje\Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.N
      MS.Stomp-1.5.3-src\src\main\csharp\Protocol\StompWireFormat.cs:line 154
      at Apache.NMS.Stomp.Protocol.StompWireFormat.Unmarshal(BinaryReader dataIn) i
      n c:\Users\fretje\Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.NM
      S.Stomp-1.5.3-src\src\main\csharp\Protocol\StompWireFormat.cs:line 124
      at Apache.NMS.Stomp.Transport.Tcp.TcpTransport.ReadLoop() in c:\Users\fretje\
      Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.NMS.Stomp-1.5.3-src\
      src\main\csharp\Transport\Tcp\TcpTransport.cs:line 285
      Debug: Async exception with no exception listener: System.FormatException: Input
      string was not in a correct format.
      at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffe
      r& number, NumberFormatInfo info, Boolean parseDecimal)
      at System.Number.ParseSingle(String value, NumberStyles options, NumberFormat
      Info numfmt)
      at System.Single.Parse(String s, NumberStyles style, NumberFormatInfo info)
      at System.Single.Parse(String s)
      at Apache.NMS.Stomp.Protocol.StompWireFormat.ReadConnected(StompFrame frame)
      in c:\Users\fretje\Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.N
      MS.Stomp-1.5.3-src\src\main\csharp\Protocol\StompWireFormat.cs:line 200
      at Apache.NMS.Stomp.Protocol.StompWireFormat.CreateCommand(StompFrame frame)
      in c:\Users\fretje\Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.N
      MS.Stomp-1.5.3-src\src\main\csharp\Protocol\StompWireFormat.cs:line 154
      at Apache.NMS.Stomp.Protocol.StompWireFormat.Unmarshal(BinaryReader dataIn) i
      n c:\Users\fretje\Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.NM
      S.Stomp-1.5.3-src\src\main\csharp\Protocol\StompWireFormat.cs:line 124
      at Apache.NMS.Stomp.Transport.Tcp.TcpTransport.ReadLoop() in c:\Users\fretje\
      Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.NMS.Stomp-1.5.3-src\
      src\main\csharp\Transport\Tcp\TcpTransport.cs:line 285
      Apache.NMS.Stomp.ConnectionClosedException: The connection is already closed!
      at Apache.NMS.Stomp.Connection.CheckConnected() in c:\Users\fretje\Documents\
      Visual Studio 2012\Projects\win.Tapi2Stomp\Apache.NMS.Stomp-1.5.3-src\src\main\c
      sharp\Connection.cs:line 609
      at Apache.NMS.Stomp.Connection.Start() in c:\Users\fretje\Documents\Visual St
      udio 2012\Projects\win.Tapi2Stomp\Apache.NMS.Stomp-1.5.3-src\src\main\csharp\Con
      nection.cs:line 319
      at Tapi2StompClient.ActiveMQClient..ctor(String uri, String destinationQueue)
      in c:\Users\fretje\Documents\Visual Studio 2012\Projects\win.Tapi2Stomp\Tapi2St
      ompClient\ActiveMQClient.cs:line 33

      Apparently the problem is with the parsing of the version of the incoming "CONNECTED" frame, there the following code is executed:

      remoteWireFormatInfo.Version = Single.Parse(frame.RemoveProperty("version"));

      The bug is easily resolved by changing that line with:

      remoteWireFormatInfo.Version = Single.Parse(frame.RemoveProperty("version"), CultureInfo.InvariantCulture);

      I didn't have this problem on my Windows 7 PC, although it is also set on nl-BE Culture.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                tabish Timothy A. Bish
                Reporter:
                fretje Frederiek Lefebvre
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: