首页 > 其他分享 >【Azure Developer】com.azure:azure-identity jar包版本从1.2.0 升级到1.12.2 版本之后报错

【Azure Developer】com.azure:azure-identity jar包版本从1.2.0 升级到1.12.2 版本之后报错

时间:2024-10-15 20:11:34浏览次数:15  
标签:aad msal4j Builder 报错 版本 azure com microsoft

问题描述

com.azure:azure-identity jar包版本从1.2.0 升级到1.12.2 版本之后报错,错误信息如下:

An attempt was made to call a method that does not exist. The attempt was made from the following location:    com.azure.identity.implementation.IdentityClientBase.getConfidentialClient(IdentityClientBase.java:235)The following method did not exist:    com.microsoft.aad.msal4j.ConfidentialClientApplication$Builder.logPii(Z)Lcom/microsoft/aad/msal4j/AbstractApplicationBase$Builder;The calling method's class, com.azure.identity.implementation.IdentityClientBase, was loaded from the following location:    jar:file:/C:/java/soft/gradle-7.4.2-bin/gradle-7.4.2/caches/modules-2/files-2.1/com.azure/azure-identity/1.12.2/e12bc63202063589f68318bd5a1b4d1a8ae88fb6/azure-identity-1.12.2.jar!/com/azure/identity/implementation/IdentityClientBase.classThe called method's class, com.microsoft.aad.msal4j.ConfidentialClientApplication$Builder, is available from the following locations:    jar:file:/C:/java/soft/gradle-7.4.2-bin/gradle-7.4.2/caches/modules-2/files-2.1/com.microsoft.azure/msal4j/1.11.0/38df9693f67ea1f01f35ebbe9411f0760c9ac77f/msal4j-1.11.0.jar!/com/microsoft/aad/msal4j/ConfidentialClientApplication$Builder.classThe called method's class hierarchy was loaded from the following locations:    com.microsoft.aad.msal4j.ConfidentialClientApplication.Builder: file:/C:/java/soft/gradle-7.4.2-bin/gradle-7.4.2/caches/modules-2/files-2.1/com.microsoft.azure/msal4j/1.11.0/38df9693f67ea1f01f35ebbe9411f0760c9ac77f/msal4j-1.11.0.jar    com.microsoft.aad.msal4j.AbstractClientApplicationBase.Builder: file:/C:/java/soft/gradle-7.4.2-bin/gradle-7.4.2/caches/modules-2/files-2.1/com.microsoft.azure/msal4j/1.11.0/38df9693f67ea1f01f35ebbe9411f0760c9ac77f/msal4j-1.11.0.jarAction:Correct the classpath of your application so that it contains compatible versions of the classes com.azure.identity.implementation.IdentityClientBase and com.microsoft.aad.msal4j.ConfidentialClientApplication$Builder

 

错误分析

应用日志显示存在依赖管理错误导致的method not found 报错。

  • The following method did not exist:    com.microsoft.aad.msal4j.ConfidentialClientApplication$Builder.logPii(Z)Lcom/microsoft/aad/msal4j/AbstractApplicationBase$Builder;
  • The called method's class hierarchy was loaded from the following locations:    com.microsoft.aad.msal4j.ConfidentialClientApplication.Builder: file:/C:/java/soft/gradle-7.4.2-bin/gradle-7.4.2/caches/modules-2/files-2.1/com.microsoft.azure/msal4j/1.11.0/38df9693f67ea1f01f35ebbe9411f0760c9ac77f/msal4j-1.11.0.jar

需要调整class path以确保能读取到正确的依赖包。

Correct the classpath of your application so that it contains compatible versions of the classes com.azure.identity.implementation.IdentityClientBase and com.microsoft.aad.msal4j.ConfidentialClientApplication$Builder

综合以上,错误的原因是项目依赖中可能存在了多个版本的msal4j。当前解析出的msal4j-1.11.0.jar与升级后的azure-identity-1.12.2不兼容。

 

 

标签:aad,msal4j,Builder,报错,版本,azure,com,microsoft
From: https://www.cnblogs.com/lulight/p/18468339

相关文章

  • Docker部署最新版本EMQX服务,上干货不废话
    1.拉取emqx镜像:dockerpullemqx/emqx:latest 显示如上即代表拉取成功2.使用dockerimages 查看镜像 4.启动emqx服务dockerrun-d-v/etc/localtime:/etc/localtime:ro-p18083:18083-p1883:1883-p8083:8083emqx/emqx:latest 说明已经成功启动5.去......
  • 国产麒麟操作系统离线一键升级openssh版本
       根据等保测评结果,一般服务器都需要升级openssh版本和openssl版本,由于2个不同软件之间版本相互有关联,分开下载不知道下载哪个版本才合适,经过本人亲测,在一台服务器跑通后,直接同时4台服务器操作,3分钟内把另外4台服务器的所有关于openssh漏洞的问题都解决了。下面是相应的执......