我使用 kusto.Ingest 版本 2.5.1 并收到此错误:
*ERROR*| [Timer-985]| com.microsoft.azure.kusto.ingest.ResourceManager| Error in refreshIngestionAuthToken.| com.microsoft.azure.kusto.ingest.exceptions.IngestionServiceException: Error refreshing IngestionAuthToken
at com.microsoft.azure.kusto.ingest.ResourceManager.refreshIngestionAuthToken(ResourceManager.java:199)
at com.microsoft.azure.kusto.ingest.ResourceManager.access$500(ResourceManager.java:22)
at com.microsoft.azure.kusto.ingest.ResourceManager$1RefreshIngestionAuthTokenTask.run(ResourceManager.java:102)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: com.microsoft.azure.kusto.data.exceptions.DataServiceException: Error acquiring ApplicationAccessToken
at com.microsoft.azure.kusto.data.auth.ConfidentialAppTokenProviderBase.acquireNewAccessToken(ConfidentialAppTokenProviderBase.java:32)
at com.microsoft.azure.kusto.data.auth.MsalTokenProviderBase.acquireAccessToken(MsalTokenProviderBase.java:46)
at com.microsoft.azure.kusto.data.ClientImpl.initHeaders(ClientImpl.java:196)
at com.microsoft.azure.kusto.data.ClientImpl.executeToJsonResult(ClientImpl.java:135)
at com.microsoft.azure.kusto.data.ClientImpl.execute(ClientImpl.java:76)
at com.microsoft.azure.kusto.data.ClientImpl.execute(ClientImpl.java:71)
at com.microsoft.azure.kusto.data.ClientImpl.execute(ClientImpl.java:66)
at com.microsoft.azure.kusto.ingest.ResourceManager.refreshIngestionAuthToken(ResourceManager.java:190)
... 4 common frames omitted
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class com.microsoft.aad.msal4j.JsonHelper
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357)
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1928)
at com.microsoft.azure.kusto.data.auth.ConfidentialAppTokenProviderBase.acquireNewAccessToken(ConfidentialAppTokenProviderBase.java:30)
错误是说
JsonHelper
中的 msal4j
类无法初始化。根据其文档,Kusto.Ingest 2.5.1
正在使用Kusto.Data 2.5.1
,而Kusto.Data 2.5.1
默认使用msal4j 1.9.1
。但是,在 msal4j 1.9.1 中的 JsonHelper 中,JsonHelper 类没有初始化方法。所以我将其升级到版本1.11.1,这样就存在了initialize方法:
private JsonHelper() {
}
但是,我仍然从上面得到同样的错误。以下是我检查的步骤:
msal4j
位于 1.11.2、kusto.data
位于 2.5.1、kusto.ingest
位于 2.5.1我错过了什么吗?
仅供参考,
masl4j
1.11.2源代码:https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/v1.11.2/src/main/java/com/microsoft/aad/msal4j /JsonHelper.java
msal4j
1.9.1 源代码:https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/v1.9.1/src/main/java/com/microsoft/aad/msal4j /JsonHelper.java
请检查您的依赖项并检查此答案,它看起来与您的问题类似使用 AD 密码身份验证连接到 SQL Server 时无法初始化类 com.microsoft.aad.msal4j.JsonHelper