After upgrading the Azure SDK version to 1.7.0, authentication code failed with "java.lang.NoClassDefFoundError: com/microsoft/azure/management/batchai/implementation/BatchAIManager"
我的验证码是
/ ** *默认构造函数。 * / public Azure(){
try {
credentials = new ApplicationTokenCredentials(Config.AzureclientId_admin, Config.AzuretenantId_admin,
Config.Azuresecret_admin, AzureEnvironment.AZURE);
azure = com.microsoft.azure.management.Azure.authenticate(credentials)
.withSubscription(Config.AzuresubscriptionId_admin);
} catch (Exception ex) {
Log.Message("Unable to create the Azure object", LogLevel.ERROR);
ex.printStackTrace();
}
}
答案 0 :(得分:0)
这看起来是maven问题。依赖项已下载并在.m2目录中显示,但未在Eclipse Maven依赖项中加载。我从.m2中删除了azure目录并再次编译它解决了问题。