You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Frederiek Lefebvre (JIRA)" <ji...@apache.org> on 2013/02/08 11:57:12 UTC

[jira] [Created] (AMQNET-411) System.FormatException in the Inactivity Monitor on Windos 8 with a non US (European) Current Culture

Frederiek Lefebvre created AMQNET-411:
-----------------------------------------

             Summary: System.FormatException in the Inactivity Monitor on Windos 8 with a non US (European) Current Culture
                 Key: AMQNET-411
                 URL: https://issues.apache.org/jira/browse/AMQNET-411
             Project: ActiveMQ .Net
          Issue Type: Bug
          Components: NMS, Stomp
    Affects Versions: 1.5.3
         Environment: Windows 8, .NET Framework 2.0, ActiveMQ 5.6 with STOMP
            Reporter: Frederiek Lefebvre
            Assignee: Jim Gomes


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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira