Skip to content

google-cloud-nio-jar shadow jar service providers are too shady #4403

Description

@lbergelson

Environment details

  • OS: OSX High Sierra
  • Java version: 1.8
  • google-cloud-java version(s): v0.77.0, v0.78.0

There's a new shading bug in the google-cloud-nio-0.77.0-alpha-shaded.jar which makes it unusable.

The changes in #4305 fixed the shading of several service providers but accidentally shaded the META-INF/services/java.nio.file.spi.FileSystemProvider file as well.

This makes the jar unusable because the FileSystemProvider can't be instantiated. It needs to be excluded from the shading.

Stacktrace

An example stack trace.

java.util.ServiceConfigurationError: java.nio.file.spi.FileSystemProvider: Provider shaded.cloud_nio.com.shaded.cloud_nio.google.cloud.storage.contrib.nio.CloudStorageFileSystemProvider not found

	at java.util.ServiceLoader.fail(ServiceLoader.java:239)
	at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	at java.nio.file.spi.FileSystemProvider.loadInstalledProviders(FileSystemProvider.java:119)
	at java.nio.file.spi.FileSystemProvider.access$000(FileSystemProvider.java:77)
	at java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:169)
	at java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:166)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.nio.file.spi.FileSystemProvider.installedProviders(FileSystemProvider.java:166)
	at com.google.common.jimfs.JimfsFileSystems.getSystemJimfsProvider(JimfsFileSystems.java:45)
	at com.google.common.jimfs.JimfsFileSystems.<clinit>(JimfsFileSystems.java:42)
	at com.google.common.jimfs.Jimfs.newFileSystem(Jimfs.java:145)
	at com.google.common.jimfs.Jimfs.newFileSystem(Jimfs.java:131)
	at com.google.common.jimfs.Jimfs.newFileSystem(Jimfs.java:117)
	at org.broadinstitute.hellbender.utils.io.IOUtilsUnitTest.setUp(IOUtilsUnitTest.java:37)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
	at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224)
	at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146)
	at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)
	at org.testng.TestRunner.privateRun(TestRunner.java:744)
	at org.testng.TestRunner.run(TestRunner.java:602)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
	at org.testng.SuiteRunner.run(SuiteRunner.java:289)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
	at org.testng.TestNG.runSuites(TestNG.java:1144)
	at org.testng.TestNG.run(TestNG.java:1115)
	at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:73)
	at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:123)

Activity

  1. jean-philippe-martin commented on Jan 23, 2019

    @jean-philippe-martin

    I can confirm, I see this bug too.

  2. jean-philippe-martin commented on Jan 24, 2019

    @jean-philippe-martin

    It appears this is due to bug 237 in the Maven shader plugin. I'll see if updating to a newer version fixes it and push the fix.

  3. added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    and removed
    triage meI really want to be triaged.
    on Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions