在本地开发环境中使用Acumatica内部版本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状态代码。
到目前为止我已经尝试过的事情:
有什么想法吗?
堆栈跟踪以供参考:
{
"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()"
}
答案 0 :(得分: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 docs网站上使用该方法: https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed