You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by sparky2708 <da...@columbia.edu> on 2007/02/01 15:49:11 UTC

Re: C#/.NET implementation see problem but don't know how to fix it

Did some more debugging and narrowed down the problem:

in WireFormatNegotiator the "command" is sometimes "Null" -- not sure why it
happens or how to fix it except to protect the following statement:

   protected override void OnCommand(ITransport sender, Command command)
        {
            if ( command.GetDataStructureType() ==
WireFormatInfo.ID_WireFormatInfo )
            ...
        }

Complete error message:

System.NullReferenceException: Object reference not set to an instance of an
object.
   at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport sender,
Command command) in
D:\activemq-dotnet\activemq-dotnet\src\main\csharp\ActiveMQ\Transport\WireFormatNegotiator.cs:line
75
   at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop() in
D:\activemq-dotnet\activemq-dotnet\src\main\csharp\ActiveMQ\Transport\Tcp\TcpTransport.cs:line
146



sparky2708 wrote:
> 
> Could there be something wrong with the C#/.NET release in the HEAD of
> SVN? Shouldn't there be some stable tag or branch that I need to check
> out?
> 
> 
> sparky2708 wrote:
>> 
>> A few days ago I checked out the latest C#/.NET code using svn as per the
>> instructions on the website. I built the code without any problems but am
>> now trying to run it in VS2005. From the debugger it looks like the error
>> occurs when I call _connection.Start()  Here is my code:
>> 
>> private IConnection _connection;
>> private string JMS_URL = "tcp://localhost:61616";
>> 
>> public MessageManager() {
>>         IConnectionFactory connectionFactory = new ConnectionFactory(new
>> Uri(JMS_URL));
>>         _connection = connectionFactory.CreateConnection();
>>         _connection.ExceptionListener += new
>> ExceptionListener(_connection_ExceptionListener);
>>         _connection.Start();
>> }
>> 
>>  void _connection_ExceptionListener(Exception exception)
>>     {
>>         Console.WriteLine("Received Exception from JMS: " + exception);
>>     }
>> 	
>> 
>> 
>> 
>> In the console window I get:
>> 
>> Received Exception from JMS: System.NullReferenceException: Object
>> reference not
>>  set to an instance of an object.
>>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport
>> sender, Comma
>> nd command)
>>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop()
>> Received Exception from JMS: System.NullReferenceException: Object
>> reference not
>>  set to an instance of an object.
>>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport
>> sender, Comma
>> nd command)
>>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop()
>> Received Exception from JMS: System.NullReferenceException: Object
>> reference not
>>  set to an instance of an object.
>>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport
>> sender, Comma
>> nd command)
>>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop()
>> Received Exception from JMS: System.NullReferenceException: Object
>> reference not
>>  set to an instance of an object.
>>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport
>> sender, Comma
>> nd command)
>>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop()
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/C--.NET-implementation-CRASHES-on-Connection-Startup-tf3151856.html#a8749505
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: C#/.NET implementation see problem but don't know how to fix it

Posted by sparky2708 <da...@columbia.edu>.
Protecting it doesn't work. This is probably some part of the protocol so I
can't just make that change. Ok, I guess at this point I am stuck.


sparky2708 wrote:
> 
> Did some more debugging and narrowed down the problem:
> 
> in WireFormatNegotiator the "command" is sometimes "Null" -- not sure why
> it happens or how to fix it except to protect the following statement:
> 
>    protected override void OnCommand(ITransport sender, Command command)
>         {
>             if ( command.GetDataStructureType() ==
> WireFormatInfo.ID_WireFormatInfo )
>             ...
>         }
> 
> Complete error message:
> 
> System.NullReferenceException: Object reference not set to an instance of
> an object.
>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport sender,
> Command command) in
> D:\activemq-dotnet\activemq-dotnet\src\main\csharp\ActiveMQ\Transport\WireFormatNegotiator.cs:line
> 75
>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop() in
> D:\activemq-dotnet\activemq-dotnet\src\main\csharp\ActiveMQ\Transport\Tcp\TcpTransport.cs:line
> 146
> 
> 
> 
> sparky2708 wrote:
>> 
>> Could there be something wrong with the C#/.NET release in the HEAD of
>> SVN? Shouldn't there be some stable tag or branch that I need to check
>> out?
>> 
>> 
>> sparky2708 wrote:
>>> 
>>> A few days ago I checked out the latest C#/.NET code using svn as per
>>> the instructions on the website. I built the code without any problems
>>> but am now trying to run it in VS2005. From the debugger it looks like
>>> the error occurs when I call _connection.Start()  Here is my code:
>>> 
>>> private IConnection _connection;
>>> private string JMS_URL = "tcp://localhost:61616";
>>> 
>>> public MessageManager() {
>>>         IConnectionFactory connectionFactory = new ConnectionFactory(new
>>> Uri(JMS_URL));
>>>         _connection = connectionFactory.CreateConnection();
>>>         _connection.ExceptionListener += new
>>> ExceptionListener(_connection_ExceptionListener);
>>>         _connection.Start();
>>> }
>>> 
>>>  void _connection_ExceptionListener(Exception exception)
>>>     {
>>>         Console.WriteLine("Received Exception from JMS: " + exception);
>>>     }
>>> 	
>>> 
>>> 
>>> 
>>> In the console window I get:
>>> 
>>> Received Exception from JMS: System.NullReferenceException: Object
>>> reference not
>>>  set to an instance of an object.
>>>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport
>>> sender, Comma
>>> nd command)
>>>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop()
>>> Received Exception from JMS: System.NullReferenceException: Object
>>> reference not
>>>  set to an instance of an object.
>>>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport
>>> sender, Comma
>>> nd command)
>>>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop()
>>> Received Exception from JMS: System.NullReferenceException: Object
>>> reference not
>>>  set to an instance of an object.
>>>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport
>>> sender, Comma
>>> nd command)
>>>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop()
>>> Received Exception from JMS: System.NullReferenceException: Object
>>> reference not
>>>  set to an instance of an object.
>>>    at ActiveMQ.Transport.WireFormatNegotiator.OnCommand(ITransport
>>> sender, Comma
>>> nd command)
>>>    at ActiveMQ.Transport.Tcp.TcpTransport.ReadLoop()
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/PLEASE-HELP-ASAP%3A-C--.NET-implementation-CRASHES-on-Connection-Startup-tf3151856.html#a8749752
Sent from the ActiveMQ - User mailing list archive at Nabble.com.