Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QUERY] java.lang.IllegalAccessError: tried to access class reactor.core.publisher.FluxReplay$ReplaySubscription from class reactor.core.publisher.ReplayProcessor #15580

Closed
abmo-x opened this issue Sep 24, 2020 · 5 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. KeyVault Synapse

Comments

@abmo-x
Copy link

abmo-x commented Sep 24, 2020

Query/Question
Error initilaizing key vault client with access token. running into below error

Why is this not a Bug or a feature Request?
Running into this issue ONLY when running on Azure Synapse. Works fine locally.

20/09/24 00:54:55 ERROR ApplicationMaster: User class threw exception: java.lang.IllegalAccessError: tried to access class reactor.core.publisher.FluxReplay$ReplaySubscription from class reactor.core.publisher.ReplayProcessor
java.lang.IllegalAccessError: tried to access class reactor.core.publisher.FluxReplay$ReplaySubscription from class reactor.core.publisher.ReplayProcessor
	at reactor.core.publisher.ReplayProcessor.<clinit>(ReplayProcessor.java:303)
	at com.azure.security.keyvault.secrets.implementation.ScopeTokenCache.<init>(ScopeTokenCache.java:21)
	at com.azure.security.keyvault.secrets.implementation.KeyVaultCredentialPolicy.<init>(KeyVaultCredentialPolicy.java:41)
	at com.azure.security.keyvault.secrets.SecretClientBuilder.buildAsyncClient(SecretClientBuilder.java:153)
	at com.azure.security.keyvault.secrets.SecretClientBuilder.buildClient(SecretClientBuilder.java:104)

I am initializing the client as:

new SecretClientBuilder()
                    .vaultUrl(keyVaultUrl.toString())
                    .credential(tokenRequestContext -> Mono.just(accessToken))
                    .buildClient();

Setup (please complete the following information if applicable):

  • OS: Windows
  • IDE : IntelliJ
  • Java version: 1.8
  • com.azure azure-security-keyvault-secrets 4.2.1
@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 24, 2020
@abmo-x abmo-x changed the title java.lang.IllegalAccessError: tried to access class reactor.core.publisher.FluxReplay$ReplaySubscription from class reactor.core.publisher.ReplayProcessor [QUERY] java.lang.IllegalAccessError: tried to access class reactor.core.publisher.FluxReplay$ReplaySubscription from class reactor.core.publisher.ReplayProcessor Sep 24, 2020
@joshfree joshfree added Client This issue points to a problem in the data-plane of the library. KeyVault labels Sep 24, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Sep 24, 2020
@joshfree
Copy link
Member

Thanks for filing this issue @abmo-x. @vcolin7 could you please follow up?

/cc @jianghaolu as this relates to Azure Synapse

@vcolin7
Copy link
Member

vcolin7 commented Sep 24, 2020

No problem, I will look into this.

@vcolin7 vcolin7 added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Sep 24, 2020
@abmo-x
Copy link
Author

abmo-x commented Sep 25, 2020

@vcolin7

I tried to get a token directly and ran into the same error from identity client:

Caused by: java.lang.IllegalAccessError: tried to access class reactor.core.publisher.FluxReplay$ReplaySubscription from class reactor.core.publisher.ReplayProcessor
	at reactor.core.publisher.ReplayProcessor.<clinit>(ReplayProcessor.java:303)
	at com.azure.identity.implementation.SynchronizedAccessor.<init>(SynchronizedAccessor.java:21)
	at com.azure.identity.implementation.IdentityClient.<init>(IdentityClient.java:154)
	at com.azure.identity.implementation.IdentityClientBuilder.build(IdentityClientBuilder.java:99)
	at com.azure.identity.ClientSecretCredential.<init>(ClientSecretCredential.java:50)
	at com.azure.identity.ClientSecretCredentialBuilder.build(ClientSecretCredentialBuilder.java:62)
ClientSecretCredential clientSecretCredential = new ClientSecretCredentialBuilder()
                .clientId(aadAppId)
                .clientSecret(aadAppSecret)
                .tenantId(tenantId)
                .build();
        Mono<AccessToken> token = clientSecretCredential.getToken(new TokenRequestContext().addScopes(scope));
        AccessToken accessToken = token.block(Duration.of(1, ChronoUnit.MINUTES));

@abmo-x
Copy link
Author

abmo-x commented Sep 25, 2020

@vcolin7

I was able to resolve the issue by relocating azure sdk and reactor dependencies in my shaded jar as:

<relocation>
                                    <pattern>com.azure</pattern>
                                    <shadedPattern>dqs.com.azure</shadedPattern>
                                </relocation>
                                <relocation>
                                    <pattern>reactor</pattern>
                                    <shadedPattern>dqs.reactor</shadedPattern>
                                </relocation>

The error was very confusing and i was not able to guess that a version conflict was causing it.

@abmo-x abmo-x closed this as completed Sep 25, 2020
@vcolin7
Copy link
Member

vcolin7 commented Sep 28, 2020

Hi @abmo-x, I'm glad you were able to find a solution. Usually when an IllegalAccessError shows up it's because the class used at runtime is different than the one used at compile time, and the runtime code does not allow access to a given method or parameter (e.g. it's private or package-private). It makes sense that two different versions of the code were in conflict there. Just as a reference for anyone that encounters this issue, here's a similar one on StackOverflow.

openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-java that referenced this issue Aug 11, 2021
Web ant94 2021 02 01 attempt 2 (Azure#15548)

* Adds base for updating Microsoft.Web from version stable/2021-01-15 to version 2021-02-01

* Updates readme

* Updates API version in new specs and examples

* Changes for api-version 2012-02-01 (Azure#15545)

* Address PR comments - AppServiceCertificateOrders (Azure#15561)

* Changes for api-version 2012-02-01

* Address PR comments - AppServiceCertificatesOrder

* Fix spelling issue

* Fix summary+description for GET siteseal

* Add reseller to custom words

* Make DedicatedHostCount R/W (Azure#15580)

Co-authored-by: Chris Chen <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. KeyVault Synapse
Projects
None yet
Development

No branches or pull requests

3 participants