【问题标题】:Simple GET failing with Acumatica APIAcumatica API 的简单 GET 失败
【发布时间】:2018-08-08 05:04:42
【问题描述】:

我一直在吃杂项。 Acumatica API 的问题,它有时可以工作,有时会抛出错误。我决定删除数据库并重新安装我的站点并重新开始。完成此操作后,现在我只是对 StockItem 端点进行简单的登录 POST 和 GET,但出现错误(见下文)。我已经尝试过多次重新安装。未安装任何自定义。

{
    "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) in F:\\Bld2\\AC-FULL2017R204-JOB1\\sources\\NetTools\\PX.Api.ContractBased\\EntityExportContextBuilder.cs:line 73\r\n
   at PX.Api.ContractBased.EntityService.GetList(ISystemContract systemContract, String version, String name, EntityImpl entity, Boolean returnFullEntities, CbOperationContext operationContext, Boolean ignoreValueFields, PXGraph graph) in F:\\Bld2\\AC-FULL2017R204-JOB1\\sources\\NetTools\\PX.Api.ContractBased\\EntityService.cs:line 82\r\n
   at PX.Api.ContractBased.Soap.SoapFacadeBase.GetListImpl(Entity entity, Boolean returnFullEntities) in F:\\Bld2\\AC-FULL2017R204-JOB1\\sources\\NetTools\\PX.Api.ContractBased\\Soap\\SoapFacadeBase.cs:line 83\r\n
   at PX.Api.ContractBased.SystemContracts.V2.RestController.GetList(String objectName, String select, String filter, String expand, String custom, Nullable`1 skip, Nullable`1 top) in F:\\Bld2\\AC-FULL2017R204-JOB1\\sources\\NetTools\\PX.Api.ContractBased\\SystemContracts\\V2\\RestController.cs:line 247\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()"
    }

登录:

http://localhost/AcumaticaERP/entity/auth/login

获取:

http://localhost/AcumaticaERP/entity/Default/6.00.001/StockItem

除了 StockItem 之外的其他端点也会失败并出现相同的错误。我什至重新启动了我的电脑,但同样的错误。任何想法发生了什么或如何解决?

【问题讨论】:

  • 您使用的是什么版本的 Acumatica,以及您的计算机上安装的 .Net Framework 版本是什么?
  • 构建 17.204.0019。看起来框架是 17.209.0028。
  • .Net 框架与 Acumatica 无关,因此版本应该看起来像 4.61 或 4.7.x。
  • 对不起,我看错了你的问题。 .NET 4.7.1
  • 您可以尝试安装一个版本为 17.200.0034 的网站,看看问题是否仍然存在?

标签: api acumatica


【解决方案1】:

此问题是由 Microsoft 对 .Net Framework 库的一些修改引起的。安装后很难将其删除,并且会导致 Acumatica 中的某些功能出现问题。一旦 Acumatica 意识到这个问题,他们就会更正它,因此取决于您使用的 Acumatica 版本,它可能工作或不工作。

应用修复的版本是:

  • 2017R2:17.208.0034
  • 2018R1:18.102.0048

如果您有 Acumatica 门户的帐户,您甚至可以查看那里发布的文章:

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/

【讨论】:

  • 这很可能是问题,因为安装 17.210 解决了它。
猜你喜欢
  • 1970-01-01
  • 2021-11-27
  • 1970-01-01
  • 2016-09-23
  • 2019-10-19
  • 1970-01-01
  • 2018-06-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多