【问题标题】:What is causing REST API error in Acumatica 2017R2?是什么导致 Acumatica 2017R2 中的 REST API 错误?
【发布时间】: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


    【解决方案1】:

    这似乎是 .Net 框架引起的错误。

    这是门户网站上的一篇文章,详细解释了这个问题: https://portal.acumatica.com/knowledgebase/known-issue-integrations-schedulers-generic-inquiries-using-odata-may-stop-working-on-2017r2-and-2018r1-versions-after-installing-net-framework-4-7-2-build-or-the-latest-windows-update-which-cont/

    但要恢复它:

    根本原因:.Net Framework 4.7.2 版本与 Acumatica 6.1(6.10.2515 及更早版本)、Acumatica 2017R2(17.207.0029 及更早版本)和 2018R1 之间存在一个已知的兼容性问题(18.101.0039 及更早版本)。

    解决方案:该问题已在 6.10.2613 及更高版本、17.208.0034 及更高版本和 18.102.0048 及更高版本中得到修复。

    如果您在查找 .Net 版本时遇到问题,我建议您使用以下 microsoft 文档站点上的方法: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed

    【讨论】:

    • 就是这样!我的笔记本电脑最近执行了自动 Windows 更新,它必须更新了 .Net Framework 版本。升级到 Acumatica 版本 17.208.0034 解决了我的问题。感谢您的帮助。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-03-04
    • 1970-01-01
    • 2018-06-13
    • 1970-01-01
    相关资源
    最近更新 更多