简体   繁体   English

Azure 函数,“System.Private.CoreLib:值不能为 null。(参数‘path1’)。值不能为 null。(参数‘provider’)”

[英]Azure Functions, "System.Private.CoreLib: Value cannot be null. (Parameter 'path1'). Value cannot be null. (Parameter 'provider')"

I'm running Azure functions/core tools 3.x, in my Gradle (version 4.6) Java (JDK 1.8) project with azure functions apps.我正在运行 Azure 功能/核心工具 3.x,在我的 Gradle(版本 4.6)Java(JDK 1.8)项目中,带有 azure 功能应用程序。 I have a GET endpoint at localhost:7071 at api/devices I am trying to hit, but I keep getting errors running azureFunctionsRun.我在 localhost:7071 的 api/devices 上有一个 GET 端点,我试图访问它,但我在运行azureFunctionsRun 时不断出错。

When I run azureFunctionsPackage, it seems to work fine.当我运行 azureFunctionsPackage 时,它似乎工作正常。 When I run azureFunctionsRun, I get the error posted below.当我运行 azureFunctionsRun 时,我收到下面发布的错误。 When I used to be on azure core tools 2.x, I was apple to use the command "func start", and everything worked flawlessly.当我曾经在 azure 核心工具 2.x 上时,我很高兴使用命令“func start”,一切都完美无缺。 I have the host.json file with the boilerplate version and ExtensionBundles script and local.settings.json with a connection string for my Azure Web Jobs Storage:我有带有样板版本和 ExtensionBundles 脚本的 host.json 文件和带有连接字符串的 local.settings.json 用于我的 Azure Web 作业存储:

Azure Functions Core Tools found.
Starting running Azure Functions...
Executing command: cmd.exe /c cd /D C:\git\edge_bootstrap_ms\build\azurefunctions\edge-bootstrap-ms && func host start

              %%%%%%
             %%%%%%
        @   %%%%%%    @
      @@   %%%%%%      @@
   @@@    %%%%%%%%%%%    @@@
 @@      %%%%%%%%%%        @@
   @@         %%%%       @@
     @@      %%%       @@
       @@    %%      @@
            %%
            %

Azure Functions Core Tools (3.0.2106 Commit hash: 5431fca4f603bf9446d7dd2d5f96a43b5f69b5cb)
Function Runtime Version: 3.0.13107
[3/18/2020 8:56:57 PM] FUNCTIONS_WORKER_RUNTIME set to java. Skipping WorkerConfig for language:node
[3/18/2020 8:56:57 PM] FUNCTIONS_WORKER_RUNTIME set to java. Skipping WorkerConfig for language:powershell
[3/18/2020 8:56:57 PM] FUNCTIONS_WORKER_RUNTIME set to java. Skipping WorkerConfig for language:python
[3/18/2020 8:56:57 PM] Starting worker process:C:\Program Files\Java\jdk1.8.0_241\bin\java  -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -noverify -Djava.net.preferIPv4Stack=true -jar "C:\Users\KBRV37\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\java\azure-functions-java-worker.jar" --host 127.0.0.1 --port 61509 --workerId 9ff09cf4-42d8-4e1a-b66e-8058754fe61a --requestId 123c617a-61e1-4b3a-98d8-13b6a5eff6c1 --grpcMaxMessageLength 134217728
[3/18/2020 8:56:57 PM] C:\Program Files\Java\jdk1.8.0_241\bin\java process with Id=10984 started
[3/18/2020 8:56:57 PM] [INFO] {Application.main}: Azure Functions Java Worker  version [ 1.5.2-SNAPSHOT]
[3/18/2020 8:56:58 PM] [INFO] {MessageHandler.handle}: Message generated by "StartStream.Builder"
[3/18/2020 8:56:59 PM] Building host: startup suppressed: 'False', configuration suppressed: 'False', startup operation id: '078289ce-7cd5-4f2f-924b-40696702867a'
[3/18/2020 8:56:59 PM] Reading host configuration file 'C:\git\edge_bootstrap_ms\build\azurefunctions\edge-bootstrap-ms\host.json'
[3/18/2020 8:56:59 PM] Host configuration file read:
[3/18/2020 8:56:59 PM] {
[3/18/2020 8:56:59 PM]   "version": "2.0",
[3/18/2020 8:56:59 PM]   "extensionBundle": {
[3/18/2020 8:56:59 PM]     "id": "Microsoft.Azure.Functions.ExtensionBundle",
[3/18/2020 8:56:59 PM]     "version": "[1.*, 2.0.0)"
[3/18/2020 8:56:59 PM]   }
[3/18/2020 8:56:59 PM] }
[3/18/2020 8:56:59 PM] Reading functions metadata
[3/18/2020 8:56:59 PM] 3 functions found
[3/18/2020 8:56:59 PM] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at (null)
[3/18/2020 8:56:59 PM] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json
[3/18/2020 8:56:59 PM] A host error has occurred during startup operation '078289ce-7cd5-4f2f-924b-40696702867a'.
[3/18/2020 8:56:59 PM] System.Private.CoreLib: Value cannot be null. (Parameter 'path1').
Value cannot be null. (Parameter 'provider')
Application is shutting down...
[3/18/2020 8:56:59 PM] Initialization cancellation requested by runtime.
[3/18/2020 8:56:59 PM] Shutting down language worker channels for runtime:java
[3/18/2020 8:56:59 PM] Stopping host...
[3/18/2020 8:56:59 PM] Host shutdown completed.
:azureFunctionsRun FAILED
1 actionable task: 1 executed

FAILURE: Build failed with an exception.

Host.json:主机.json:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[1.*, 3.0.0)"
  }
}

local.settings.json: local.settings.json:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=myAzureAccountName;AccountKey=myAzureAccountKeyString==",
    "FUNCTIONS_WORKER_RUNTIME": "java"
  }
}

I was missing the configurations values in 'local.setting.json' which i was using in the constructor of my DI services.我在 DI 服务的构造函数中使用的“local.setting.json”中缺少配置值。 By adding those values fixed my problem.通过添加这些值解决了我的问题。 hope your would be too.希望你也是。

I was able to fix this by uninstalling the coretools 3.x and reinstalling.我能够通过卸载 coretools 3.x 并重新安装来解决这个问题。 Or like I said in this post, if you are lazy, you can click that extensionsbundle link that shows up in the console when the azurefunctinosrun fails, and it will work right after your run azurefunctions again.或者就像我在这篇文章中所说的那样,如果您很懒惰,可以单击 azurefunctinosrun 失败时显示在控制台中的 extensionsbundle 链接,它会在您再次运行 azurefunctions 后立即工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Function 应用程序无法运行显示此错误值不能是 null。 java 中的(参数“提供者”) - Azure Function app Not able to run showing this error Value cannot be null. (Parameter 'provider') in java Azure function IoTHub:错误索引方法值不能是 null。 (参数“连接字符串”) - Azure function IoTHub: Error indexing method Value cannot be null. (Parameter 'connectionString') DB错误= ORA-01407:无法更新(“ XXX”。“ XXX”。“ VALUE”)为NULL。 - DB Error=ORA-01407: cannot update (“XXX”.“XXX”.“VALUE”) to NULL. 主键值不能为null。 领域 - Primary key value must not be null. Realm 无法将属性“ innerHTML”设置为null。 AJAX问题(java) - Cannot set property 'innerHTML' of null. Issue with AJAX (java) Spring Boot - created_at 不能为空。 春季JPA - Spring Boot - created_at cannot be null. Spring JPA java.lang.RuntimeException:布局不能为空。 调用 setLayout - java.lang.RuntimeException: Layout cannot be null. Call setLayout 存在可选的长参数但不能转换为空值 - Optional long parameter is present but cannot be translated into a null value 可选的长参数'id'存在但不能转换为空值 - Optional long parameter 'id' is present but cannot be translated into a null value FindFragmentByTag返回null。 - FindFragmentByTag returns null.
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM