Uploaded image for project: 'WildFly Arquillian'
  1. WildFly Arquillian
  2. WFARQ-201

Missing transitive slf4j dependency

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 5.1.0.Beta10, 5.1.0.Final
    • None
    • None

      The org.wildfly.security:wildfly-elytron-auth-util dependency, transitive from org.wildfly.core:wildfly-protocol, has a dependency on org.apache.sshd:sshd-common which in turn has a dependency on org.slf4j:slf4j-api. In the BOM, the org.slf4j:* dependencies are excluded from the org.wildfly.core:wildfly-protocol dependency. This leads to a java.lang.ClassNotFoundException for org.slf4j.LoggerFactory if a test suite does not have an explicit dependency on slg4j.

      This was specifically found in the wildfly-testing-tools dependency:

      java.util.ServiceConfigurationError: java.nio.file.spi.FileSystemProvider: Provider org.apache.sshd.common.file.root.RootedFileSystemProvider could not be instantiated
      	at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:582)
      	at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:804)
      	at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:722)
      	at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1395)
      	at java.base/java.nio.file.spi.FileSystemProvider.loadInstalledProviders(FileSystemProvider.java:155)
      	at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:205)
      	at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:202)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at java.base/java.nio.file.spi.FileSystemProvider.installedProviders(FileSystemProvider.java:202)
      	at io.smallrye.common.classloader.ClassPathUtils.<clinit>(ClassPathUtils.java:114)
      	at io.smallrye.config.AbstractLocationConfigSourceLoader.tryClassPath(AbstractLocationConfigSourceLoader.java:141)
      	at io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:104)
      	at io.smallrye.config.AbstractLocationConfigSourceLoader.loadConfigSources(AbstractLocationConfigSourceLoader.java:87)
      	at io.smallrye.config.PropertiesConfigSourceLoader$InClassPath.getConfigSources(PropertiesConfigSourceLoader.java:47)
      	at io.smallrye.config.PropertiesConfigSourceLoader.inClassPath(PropertiesConfigSourceLoader.java:33)
      	at io.smallrye.config.SmallRyeConfigBuilder.getPropertiesSources(SmallRyeConfigBuilder.java:217)
      	at io.smallrye.config.SmallRyeConfigBuilder.getDefaultSources(SmallRyeConfigBuilder.java:200)
      	at io.smallrye.config.SmallRyeConfig$ConfigSources.buildSources(SmallRyeConfig.java:840)
      	at io.smallrye.config.SmallRyeConfig$ConfigSources.<init>(SmallRyeConfig.java:767)
      	at io.smallrye.config.SmallRyeConfig.<init>(SmallRyeConfig.java:86)
      	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:736)
      	at io.smallrye.config.SmallRyeConfigFactory$Default.getConfigFor(SmallRyeConfigFactory.java:63)
      	at io.smallrye.config.SmallRyeConfigProviderResolver.getConfig(SmallRyeConfigProviderResolver.java:78)
      	at io.smallrye.config.SmallRyeConfigProviderResolver.getConfig(SmallRyeConfigProviderResolver.java:66)
      	at org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:85)
      	at org.jboss.resteasy.microprofile.config.ConfigConfiguration.<init>(ConfigConfiguration.java:36)
      	at org.jboss.resteasy.microprofile.config.ConfigConfigurationFactory.getConfiguration(ConfigConfigurationFactory.java:32)
      	at org.jboss.resteasy.plugins.providers.RegisterBuiltin$5.run(RegisterBuiltin.java:178)
      	at org.jboss.resteasy.plugins.providers.RegisterBuiltin$5.run(RegisterBuiltin.java:175)
      	at java.base/java.security.AccessController.doPrivileged(Native Method)
      	at org.jboss.resteasy.plugins.providers.RegisterBuiltin.isGZipEnabled(RegisterBuiltin.java:175)
      	at org.jboss.resteasy.plugins.providers.RegisterBuiltin.<clinit>(RegisterBuiltin.java:37)
      	at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.getProviderFactory(ResteasyClientBuilderImpl.java:357)
      	at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.build(ResteasyClientBuilderImpl.java:373)
      	at org.jboss.resteasy.client.jaxrs.internal.ResteasyClientBuilderImpl.build(ResteasyClientBuilderImpl.java:48)
      	at jakarta.ws.rs.client.ClientBuilder.newClient(ClientBuilder.java:86)
      	at org.jboss.resteasy.microprofile.test.config.ConfigSourceOverrideOrdinalServletTest.before(ConfigSourceOverrideOrdinalServletTest.java:77)
      	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      	at org.jboss.arquillian.junit5.ArquillianExtension.interceptBeforeAllMethod(ArquillianExtension.java:144)
      	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
      	Suppressed: java.lang.NullPointerException
      		at org.jboss.resteasy.microprofile.test.config.ConfigSourceOverrideOrdinalServletTest.after(ConfigSourceOverrideOrdinalServletTest.java:82)
      		at java.base/java.lang.reflect.Method.invoke(Method.java:566)
      		at org.jboss.arquillian.junit5.ArquillianExtension.interceptAfterAllMethod(ArquillianExtension.java:154)
      		at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
      		at java.base/java.util.Collections$UnmodifiableCollection.forEach(Collections.java:1085)
      		... 1 more
      Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
      	at org.apache.sshd.common.file.root.RootedFileSystemProvider.<init>(RootedFileSystemProvider.java:79)
      	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
      	at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:780)
      	... 38 more
      Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
      	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
      	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
      	... 41 more
      

      It appears that some of the wildfly-arquillian modules have an explicit dependency on org.slf4j:slf4j-api for this reason. We should review this and determine if this is the correct solution or simply allowing the transitive dependency is the correct solution. I tend to lean towards the latter as wildfly-arquillian itself does not use slf4j.

              jperkins-rhn James Perkins
              jperkins-rhn James Perkins
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: