Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

UserIdentifier is null #2423


User avatar
0
cangunaydin created

Hello, I am using Angular 2 with .Net Core Project. After a long time, in the server side i am getting this error.

ERROR 2017-02-05 12:18:16,574 [4    ] Mvc.ExceptionHandling.AbpExceptionFilter - Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at ByteBrick.MagicInfoConfig.Friendships.Cache.UserFriendsCache.GetCacheItem(UserIdentifier userIdentifier) in D:\dev\vs\dotnetcore\MagicInfoConfig\Server\src\ByteBrick.MagicInfoConfig.Core\Friendships\Cache\UserFriendsCache.cs:line 44
   at Castle.Proxies.Invocations.UserFriendsCache_GetCacheItem.InvokeMethodOnTarget()
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Abp.Domain.Uow.UnitOfWorkInterceptor.PerformSyncUow(IInvocation invocation, UnitOfWorkOptions options)
   at Castle.DynamicProxy.AbstractInvocation.Proceed()
   at Castle.Proxies.UserFriendsCacheProxy.GetCacheItem(UserIdentifier userIdentifier)
   at ByteBrick.MagicInfoConfig.Chat.ChatAppService.GetUserChatFriendsWithSettings() in D:\dev\vs\dotnetcore\MagicInfoConfig\Server\src\ByteBrick.MagicInfoConfig.Application\Chat\ChatAppService.cs:line 41
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__27.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextActionFilterAsync>d__25.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeNextExceptionFilterAsync>d__24.MoveNext()

Is it because my session is ended after a while? cause userIdentifier object is posted to the server side from the client as null value.


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Probably, this is because ChatAppService does not have AbpAuthorize attribute. We will also add it. Can you try with that ?