Page 1 of 1

Exception: System.NullReferenceException

Posted: Wed Oct 03, 2012 2:06 pm
by canibam
Hi,

there is no any problem when i send several messages using inetlabSmpp dll. The problem is when i try to send a massive message list using the same method in a loop, it couses the application pool to be disabled. when i check the event log, i realized that the error i posted below was been thrown for many times . I would appriciate it if anyone could help me with this problem.

thx.

Error:

An unhandled exception occurred and the process was terminated.

Process ID: 4620

Exception: System.NullReferenceException

Message: Object reference not set to an instance of an object.

StackTrace: at System.Web.HttpApplication.ThreadContext.Enter(Boolean setImpersonationContext)
at System.Web.HttpApplication.OnThreadEnterPrivate(Boolean setImpersonationContext)
at System.Web.AspNetSynchronizationContext.CallCallbackPossiblyUnderLock(SendOrPostCallback callback, Object state)
at System.Web.AspNetSynchronizationContext.CallCallback(SendOrPostCallback callback, Object state)
at Inetlab.SMPP.Common.SmppClientBase.tXdQoxqOkH()
at Inetlab.SMPP.Common.SmppClientBase.Disconnect()
at Inetlab.SMPP.Common.SmppClientBase.usm16WP60(IAsyncResult )
at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Net.ContextAwareResult.Complete(IntPtr userToken)
at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr userToken)
at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

Re: Exception: System.NullReferenceException

Posted: Thu Oct 04, 2012 6:18 pm
by alt
Hi canibam,

This could be an exception in evDisconnected event handler.
Or you need to disable ability to run events in main thread where client is created.

Code: Select all

client.RaiseEventsInMainThread = false;
This code above forces client to raise events in the worker thread.

Re: Exception: System.NullReferenceException

Posted: Tue Jan 19, 2016 6:58 am
by evancroby
Hope this will help you.....NullReferenceException

Evan