Closed GoogleCodeExporter closed 9 years ago
This information is not enough.
Open VisualStudio: Debug - Exceptions - NullReferenceException.
Compile in DEBUG mode and RUN.
And wait NullReferenceException which shows all stack traces and null variable.
Original comment by hepha...@gmail.com
on 9 Feb 2012 at 2:44
Hi Ethem, I believe it's line 640 throws an exception. Let's check the
GetTickets method.
Original comment by freezing...@gmail.com
on 17 Feb 2012 at 10:20
Original comment by freezing...@gmail.com
on 17 Feb 2012 at 10:20
This issue was closed by revision 991572a3b88e.
Original comment by freezing...@gmail.com
on 17 Feb 2012 at 10:34
Done, please check out from the master branch
Original comment by freezing...@gmail.com
on 17 Feb 2012 at 10:40
I implemented a fix that I've been running on our production system for a few
days without problems now. I'll post it here as well on Monday.
Original comment by viljoe...@gmail.com
on 17 Feb 2012 at 10:42
Thanks!
Original comment by freezing...@gmail.com
on 17 Feb 2012 at 10:51
NullReference is in GetTickets(). Propably, in token (token.AppliesTo,
token.RequestedSecurityToken, token.Lifetime.Created, token.Lifetime.Expires).
GetTickets(e.Result, securService, msnticket):
e.result is not null, look stacktrace; we are in GetTickets().
NSMessageHandler.cs:719: You can see onError is not null.
Please revert. Otherwise we can't never find the bug.
Original comment by hepha...@gmail.com
on 17 Feb 2012 at 11:10
No need to reverse, you can debug it by listening AutehticationError, I believe
the problem arise because of network connection problem (The token request
failed by connection timeout) so e.Result is null. I will leave this issue
opened before the reporter post his fix.
Original comment by freezing...@gmail.com
on 18 Feb 2012 at 12:21
Connection and auth errors handled by e.Error.
If e.Result is not null, the response is OK(200). This is async rule.
Ok leave opened. I am sure, the NullReferenceException is in GetTickets().
Original comment by hepha...@gmail.com
on 18 Feb 2012 at 12:47
[deleted comment]
OK, I checked. The changes we made to the library were just to check for an
Exception when calling GetTickets as follows:
#region MXit Modification
try
{
#endregion
GetTickets(e.Result, securService, msnticket);
#region MXit Modification
}
catch (Exception getTicketsException)
{
if (onError == null)
{
throw new Exception("Error in GetTickets", getTicketsException);
}
else
{
onError(this, new ExceptionEventArgs(getTicketsException));
}
}
#endregion
The strange thing is, I don't seem to find any error messages containing
GetTickets in our logs.
The only errors I'm getting are the following:
1)
2012-02-13 16:00:41,250 [ERROR] 22488
MXit.ChatGateway.ViaMsnpSharp.MsnGatewaySession - Msn_ServiceOperationFailed:
UserSession = MXit.ChatGateway.ViaMsnpSharp.MsnGatewaySession
{
CreateTimestamp = 2012-02-13 15:40:33.523
UserId = m17900198002
IsLoggedIn = False
GatewayAccount = MXit.ChatGateway.GatewayAccountDetails
{
UserId = m17900198002
GatewayContactType = MsnGateway
LoginName = Djprince@hotmail.co.za
AutoLogin = True
}
GatewayBuddies = 0
{
}
SavedGatewayBuddyAliases= MXit.ChatGateway.GatewayBuddyAliases
{
UserId = m17900198002
GatewayContactType = MsnGateway
BuddyAliases = 0
{
}
}
DebugUserMessagesAreEnabled= False
}
Sender = MSNPSharp.ContactService
Exception = System.Web.Services.Protocols.SoapException: Full sync required.
Details: Client has too old a copy for us to do a delta sync.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.InvokeAsyncCallback(IAsyncResult result)
2)
2012-02-13 21:06:47,560 [ERROR] msn_gateway.session_tasks.001
MXit.Threading.QueuedTaskThreadPool`1[[MXit.ChatGateway.GatewaySession,
MXit.ChatGateway, Version=3.1.8.0, Culture=neutral, PublicKeyToken=null]] -
InvokeTaskCallback: An error occurred while invoking a task's callback function.
ThreadPool =
MXit.Threading.QueuedTaskThreadPool`1[MXit.ChatGateway.GatewaySession]
{
Name = msn_gateway.session_tasks
TaskQueueCount = 0
ThreadCount = 5 [AutoAdjust = False]
TasksInProgress = 3 (+316414, -316411, +12/sec, -12/sec)
ThreadCountAutoAdjusts = 0 (0/hour)
}
Callback =
MXit.Threading.ExecuteTaskDelegate`1[MXit.ChatGateway.GatewaySession]
Context = MXit.ChatGateway.ViaMsnpSharp.MsnGatewaySession
{
CreateTimestamp = 2012-02-13 21:06:47.560
UserId = m30686235002
IsLoggedIn = False
GatewayAccount = MXit.ChatGateway.GatewayAccountDetails
{
UserId = m30686235002
GatewayContactType = MsnGateway
LoginName =
Password =
AutoLogin = True
}
GatewayBuddies = 0
{
}
SavedGatewayBuddyAliases= MXit.ChatGateway.GatewayBuddyAliases
{
UserId = m30686235002
GatewayContactType = MsnGateway
BuddyAliases = 0
{
}
}
DebugUserMessagesAreEnabled= False
}
Exception = MSNPSharp.MSNPSharpException: The specified account is empty
at MSNPSharp.Messenger.Connect()
at MXit.ChatGateway.ViaMsnpSharp.MsnGatewaySession.InitiateLogin() in C:\dev\mxit\core_cs\services\chat_gateway\trunk\MXit.ChatGateway.ViaMsnpSharp\MsnGatewaySession.cs:line 350
at MXit.Threading.QueuedTaskThreadPool`1.InvokeTaskCallback(ThreadPoolTask`1 task)
Original comment by viljoe...@gmail.com
on 20 Feb 2012 at 11:00
This is your fault.
LoginName seems empty. It must be an email address.
You must set messenger.Credentials.Account before connect.
Please try MSNPSHARP_50_STABLE branch. If the problem still exists re-open this
issue.
Original comment by hepha...@gmail.com
on 20 Feb 2012 at 11:24
Agreed. I'll try version 5.0.1.
Original comment by viljoe...@gmail.com
on 20 Feb 2012 at 11:31
Original issue reported on code.google.com by
viljoe...@gmail.com
on 9 Feb 2012 at 10:09