microsoft-authentication-library-for-java: [Bug] NoSuchMethodError (ConfidentialClientApplication$Builder.executorService): mssql-jdbc + msal4j (since v1.15.0)

Library version used

1.15.0

Java version

17.0.6

Scenario

Other - please specify

Is this a new or an existing app?

None

Issue description and reproduction steps

There is Java app connecting to MSSQL db over something called “Microsoft Entra”. After an update of msal4j from v1.14.x to v1.15.0, there the jdbc driver throws NoSuchMethodError while authenticating.

I reproduced the problem with a the below minimal code snippet

Relevant code snippets

dependencies {
    implementation("com.microsoft.sqlserver:mssql-jdbc:12.6.1.jre11")
    implementation("com.microsoft.azure:msal4j:1.15.0") // <-- the previous 1.14.3 worked well
    implementation("org.slf4j:slf4j-simple:2.0.12")
}
import com.microsoft.sqlserver.jdbc.SQLServerDataSource

fun main() {
    Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
    val ds = SQLServerDataSource()
    ds.url = "jdbc:sqlserver://ms-sql-server-host:1433;database=some-db;Authentication=ActiveDirectoryServicePrincipal"
    ds.user = "?"
    ds.setPassword("?")
    val con = ds.getConnection()
    con.close()
}

Expected behavior

No breaking change expected on minor version upgrade.

Identity provider

Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)

Regression

1.14.3

Solution and workarounds

Not to upgrade to msal4j v1.15.0 and ignore it by Renovate bot

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15

Commits related to this issue

Most upvoted comments

Hello all, sorry for the long delay on getting this fixed but version 1.16.0 has now been released to fix this issue. The methods that were moved have been restored to their original class while keeping the new ones in place, so it should be compatible with both pre- and post-1.15.0 versions.

If anyone is still getting this error or having similar issues feel free to re-open this thread or start a new one.

Hi guys,

The changes on PR #828 should hopefully fix all of these issues. Let’s wait till the fix is released and then see if the issue still reproduces.

Hi guys,

The changes on PR #828 should hopefully fix all of these issues. Let’s wait till the fix is released and then see if the issue still reproduces.

Hello @Mr-Vinti do you know how long it usually takes to be released?

Running into the same issue when upgrading our dependencies.

mssql-jdbc(12.4.2) comes with spring-boot(3.2.6) msal4j(1.15.0) comes from azure-identity(1.12.0) which comes from spring-cloud-azure-dependencies(5.12.0)

So this bug actually makes the version mapping incorrect at https://github.com/Azure/azure-sdk-for-java/wiki/Spring-Versions-Mapping

spring-boot 3.2.x is not compatible with 5.x.x when using mssql+entra id auth.

Staying with spring-cloud-azure-dependencies:5.11.0 does not have this problem