question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Excessive WARN log noise in 0.9.11

See original GitHub issue

Version 0.9.11 generates a ton of noise in the logs, but only when used in a Fat Jar, such as:

WARN  [2018-11-07 09:47:39,252] org.reflections.Reflections: could not get type for name org.junit.runners.BlockJUnit4ClassRunner from any class loader
! java.lang.ClassNotFoundException: org.junit.runners.BlockJUnit4ClassRunner
! at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
! at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
! at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

I’m using the gradle plugin to build a shadow jar (fat jar) id "com.github.johnrengelman.shadow" version "4.0.2"

See also https://groups.google.com/forum/#!topic/dropwizard-user/I0K4e0APudY for another take

Downgrading to 0.9.10 avoids these excessive log messages. dropwizard-swagger uses this as a transitive dependency. Here’s a workaround for gradle:

ext {
        dropwizardVersion = "1.3.7"
        orgReflectionsVersion = "0.9.10"
}
....
dependencies {
....
    compile("com.smoketurner:dropwizard-swagger:${dropwizardVersion}-1") {
        // version 0.9.11 generates tons of noise in WARN logs about types it can't find:  https://groups.google.com/forum/#!topic/dropwizard-user/I0K4e0APudY
        exclude(group: "org.reflections")
    }
    compile "org.reflections:reflections:${orgReflectionsVersion}"
....
}

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

2reactions
darewreck54commented, May 2, 2020

If I downgrade to 0.9.10, I’ll get the following error

INFO  [2020-05-02 16:53:18,442] io.dropwizard.assets.AssetsBundle: Registering AssetBundle with name: swagger-oauth2-connect for path /oauth2-redirect.html/*
java.lang.NoSuchMethodError: org.reflections.util.ConfigurationBuilder.setExpandSuperTypes(Z)Lorg/reflections/util/ConfigurationBuilder;
        at io.swagger.jaxrs.config.BeanConfig.classes(BeanConfig.java:284)
        at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:250)
        at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:231)
        at io.federecio.dropwizard.swagger.SwaggerBundleConfiguration.build(SwaggerBundleConfiguration.java:318)
        at io.federecio.dropwizard.swagger.SwaggerBundle.run(SwaggerBundle.java:80)
        at io.federecio.dropwizard.swagger.SwaggerBundle.run(SwaggerBundle.java:46)
        at io.dropwizard.setup.Bootstrap.run(Bootstrap.java:199)
        at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
        at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
        at io.dropwizard.cli.Cli.run(Cli.java:78)

This is with a gradle of

    compile("io.dropwizard:dropwizard-core:2.0.6") {
        exclude group: "org.reflections", module: "reflections"
    }
    compile group: 'com.smoketurner', name: 'dropwizard-swagger', version: '2.0.0-1'
    compile group: 'io.swagger.core.v3', name: 'swagger-core', version: '2.1.2'
    compile group: 'ru.vyarus', name: 'dropwizard-guicey', version: '5.0.1'
    compile group: 'com.google.inject', name: 'guice', version: '4.2.3'
    implementation('org.reflections:reflections:0.9.10') {
        force = true
    }

If I use either 0.9.11 or 0.9.12, I get the following error:

NFO  [2020-05-02 16:27:49,677] org.reflections.Reflections: Reflections took 3310 ms to scan 1 urls, producing 46190 keys and 93336 values 
WARN  [2020-05-02 16:27:49,699] org.reflections.Reflections: could not get type for name org.zeroturnaround.javarebel.ClassEventListener from any class loader
! java.lang.ClassNotFoundException: org.zeroturnaround.javarebel.ClassEventListener
! at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
! at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
! at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
! at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
! at org.reflections.ReflectionUtils.forName(ReflectionUtils.java:388)
! ... 14 common frames omitted
! Causing: org.reflections.ReflectionsException: could not get type for name org.zeroturnaround.javarebel.ClassEventListener
! at org.reflections.ReflectionUtils.forName(ReflectionUtils.java:390)
! at org.reflections.Reflections.expandSuperTypes(Reflections.java:381)
! at org.reflections.Reflections.<init>(Reflections.java:126)
! at io.swagger.jaxrs.config.BeanConfig.classes(BeanConfig.java:288)
! at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:250)
! at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:231)
! at io.federecio.dropwizard.swagger.SwaggerBundleConfiguration.build(SwaggerBundleConfiguration.java:318)
! at io.federecio.dropwizard.swagger.SwaggerBundle.run(SwaggerBundle.java:80)
! at io.federecio.dropwizard.swagger.SwaggerBundle.run(SwaggerBundle.java:46)
! at io.dropwizard.setup.Bootstrap.run(Bootstrap.java:199)
! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
! at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
! at io.dropwizard.cli.Cli.run(Cli.java:78)
! at io.dropwizard.Application.run(Application.java:94)
! at 
WARN  [2020-05-02 16:27:49,702] org.reflections.Reflections: could not get type for name groovy.lang.Closure from any class loader
! java.lang.ClassNotFoundException: groovy.lang.Closure
! at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
! at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
! at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
! at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
! at org.reflections.ReflectionUtils.forName(ReflectionUtils.java:388)

I also tried excluding guice and findbugs from the reflectionand still the same error:

    compile("org.reflections:reflections:0.9.10") {
        // version 0.9.11 generates tons of noise in WARN logs about types it can't find:  https://groups.google.com/forum/#!topic/dropwizard-user/I0K4e0APudY
        exclude(group: "com.google.guava")
        exclude(group: "com.google.code.findbugs")
    }

error;

java.lang.NoSuchMethodError: org.reflections.util.ConfigurationBuilder.setExpandSuperTypes(Z)Lorg/reflections/util/ConfigurationBuilder;
        at io.swagger.jaxrs.config.BeanConfig.classes(BeanConfig.java:284)
        at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:250)
        at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:231)
        at io.federecio.dropwizard.swagger.SwaggerBundleConfiguration.build(SwaggerBundleConfiguration.java:318)
        at io.federecio.dropwizard.swagger.SwaggerBundle.run(SwaggerBundle.java:80)
        at io.federecio.dropwizard.swagger.SwaggerBundle.run(SwaggerBundle.java:46)
        at io.dropwizard.setup.Bootstrap.run(Bootstrap.java:199)
        at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:43)
        at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:87)
        at io.dropwizard.cli.Cli.run(Cli.java:78)
        at io.dropwizard.Application.run(Application.java:94)

Any help appreciated Thanks, Derek

1reaction
tatianajisellecommented, Jun 16, 2020

came to say im getting the same thing. Its something to do with the version of DropWizard (im using 2.0.10) and the version of the Swagger bundle (2.0.0) and conflicting reflections packages.

When i drop to these version i see no errors: <dropwizard.version>1.3.8</dropwizard.version> <dropwizard-swagger.version>1.3.7-1</dropwizard-swagger.version>

Read more comments on GitHub >

github_iconTop Results From Across the Web

Faq - DeSmuME Wiki
DeSmuME FAQ 0.9.11. This FAQ holds a list of many commonly asked questions about DeSmuME. If you need information about an older version, ......
Read more >
User guide
The (*) sign appearing after the layer's name means that registration data is already available for this layer. When processing images, ...
Read more >
PA Temperature, Radioactive Tracer, and Noise Logging for ...
Mechanical integrity problems both related and not-related to injection can be investigated using the three logging tools: radioactive tracer, noise and ...
Read more >
Build neutrinolabs/pulseaudio-module-xrdp package for epel7
Solution: As far as you have F31 installed, you can install this RPM : ## WARNING ## NOT A FEDORA RPM NOR AV...
Read more >
Bug #1254872 “libvirtError: Timed out during operation
Setup openstack cluster with heavy VM turnover and querying. ... export LIBVIRT_LOG_OUTPUTS=1:file:/var/log/libvirt/nova-cpu.log".
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found