Azure函数,“ System.Private.CoreLib:值不能为null。 (参数“ path1”)。值不能为空。 (参数“提供者”)”

问题描述 投票:0回答:1

我正在使用Azure函数应用程序在我的Gradle(版本4.6)Java(JDK 1.8)项目中运行Azure函数/核心工具3.x。我尝试在api / devices上的localhost:7071处有一个GET端点,但是在运行azureFunctionsRun。

时,我不断收到错误消息

当我运行azureFunctionsPackage时,它似乎工作正常。当我运行azureFunctionsRun时,出现以下错误。当我以前使用过azure核心工具2.x时,我是苹果公司使用命令“ func start”,并且一切正常。我有带有样板版本和ExtensionBundles脚本的host.json文件,以及带有Azure Web Jobs Storage连接字符串的local.settings.json:

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:

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

local.settings.json:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName=myAzureAccountName;AccountKey=myAzureAccountKeyString==",
    "FUNCTIONS_WORKER_RUNTIME": "java"
  }
}
java http gradle azure-functions endpoint
1个回答
0
投票

我能够通过卸载coretools 3.x并重新安装来解决此问题。或就像我在这篇博文中所说的,如果您很懒,可以单击azurefunctinosrun失败时控制台上显示的extensionsbundle链接,并且该链接将在再次运行azurefunctions之后立即起作用。

© www.soinside.com 2019 - 2024. All rights reserved.