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

Illegal reflective access by com.microsoft.rest.Validator #687

Closed
esfomeado opened this issue Sep 1, 2020 · 2 comments · Fixed by #689
Closed

Illegal reflective access by com.microsoft.rest.Validator #687

esfomeado opened this issue Sep 1, 2020 · 2 comments · Fixed by #689

Comments

@esfomeado
Copy link

esfomeado commented Sep 1, 2020

Hello,

I'm using this code:


ApplicationTokenCredentials credentials = new ApplicationTokenCredentials(
		"xxx", "xxx", "xxx", AzureEnvironment.AZURE
);

ComputeManager computeManager = ComputeManager.authenticate(new RestClient.Builder()
		.withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER)
		.withResponseBuilderFactory(new AzureResponseBuilder.Factory())
		.withSerializerAdapter(new AzureJacksonAdapter())
		.withCredentials(credentials)
		.build(), "xxx");

Map<String, String> settingsMap = new HashMap<>();
settingsMap.put("commandToExecute", "ls");

VirtualMachineExtensionInner inner = new VirtualMachineExtensionInner()
		.withPublisher("Microsoft.Azure.Extensions")
		.withVirtualMachineExtensionType("CustomScript")
		.withTypeHandlerVersion("2.1")
		.withAutoUpgradeMinorVersion(true)
		.withSettings(settingsMap);

inner.withLocation(Region.US_WEST.name());

computeManager.inner().virtualMachineExtensions().createOrUpdate("resourceGroup", "xxx",
		"CustomScript", inner);

And I get this warning:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.microsoft.rest.Validator (file:/C:/Users/esfomeado/.m2/repository/com/microsoft/rest/client-runtime/1.7.5/client-runtime-1.7.5.jar) to field java.util.ArrayList.serialVersionUID
WARNING: Please consider reporting this to the maintainers of com.microsoft.rest.Validator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Related with:
Azure/azure-sdk-for-java#14480

@vinagesh
Copy link
Member

I am also getting this warning and would like to know how to get it fixed:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.microsoft.rest.Validator (file:/C:/Users/vinagesh/.m2/repository/com/microsoft/rest/client-runtime/1.7.9/client-runtime-1.7.9.jar) to field java.util.ArrayList.serialVersionUID
WARNING: Please consider reporting this to the maintainers of com.microsoft.rest.Validator
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

@jianghaolu
Copy link
Contributor

Looks like certain JDKs don't like the checks we do on Array lists in Validator class. I'll try to reproduce it first and post my findings here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants