【发布时间】:2018-10-19 21:44:32
【问题描述】:
我在本地开发环境中使用 Acumatica build 17.207.0029 中的 REST API 时收到以下错误。
500 内部服务器错误
对象引用未设置为对象的实例。
无论我尝试使用哪个端点,都会发生此异常。失败的端点示例:
GET /entity/Default/17.200.001/Customer?$expand=MainContact/Address&$filter=MainContact/Email+eq+'johnny@appleseed.com'&$top=1
GET /entity/Default/17.200.001/SalesOrder/$adHocSchema
GET /entity/Default/17.200.001/Shipment/000001?$expand=Packages
所有这些 REST 调用之前都运行良好。 (我正在使用 Postman 来测试调用。)登录/注销 POST 调用似乎工作正常,并按预期返回 204 No Content 状态代码。
到目前为止我尝试过的事情:
- 删除了所有自定义项
- 使用 Acumatica ERP 配置应用程序修复了数据库
有什么想法吗?
堆栈跟踪供参考:
{
"message": "An error has occurred.",
"exceptionMessage": "Object reference not set to an instance of an object.",
"exceptionType": "System.NullReferenceException",
"stackTrace": " at PX.Data.Process.PXScreenProcessor.HackEtwTrace(Boolean s)\r\n at PX.Data.Process.PXScreenProcessor.Process(String uri, IPrincipal user, AsyncCallback cb, Action`1 initContext)\r\n at PX.Api.ScreenUtils.GetScreenInfoWithoutHttpContext(String screenID)\r\n at PX.Api.ContractBased.EntityExportContextBuilder..ctor(String version, String name, IMetadataProvider metadataProvider, IEntityMappingKeyService entityMappingKeyService, EntityImpl entity, Func`2 screenInfoGetter, ISystemContract systemContract, Boolean returnFullEntities, PXGraph graph)\r\n at PX.Api.ContractBased.EntityService.GetCustomFieldsSchema(ISystemContract systemContract, String version, String name, EntityImpl entity)\r\n at PX.Api.ContractBased.Soap.SoapFacadeBase.GetCustomFieldSchemaImpl(Entity entity)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}
【问题讨论】:
标签: acumatica