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

NoSuchMethodError: org.apache.commons.lang3.StringUtils #102

Open
vaisakhprakash opened this issue Sep 4, 2018 · 3 comments
Open

NoSuchMethodError: org.apache.commons.lang3.StringUtils #102

vaisakhprakash opened this issue Sep 4, 2018 · 3 comments

Comments

@vaisakhprakash
Copy link

vaisakhprakash commented Sep 4, 2018

These are the dependencies in my POM

    <dependency>
        <groupId>io.dropwizard</groupId>
        <artifactId>dropwizard-core</artifactId>
        <version>1.3.5</version>
    </dependency>
    <dependency>
        <groupId>com.smoketurner</groupId>
        <artifactId>dropwizard-swagger</artifactId>
        <version>1.3.5-3</version>
    </dependency>
    <dependency>
        <groupId>ca.grimoire.dropwizard.cors</groupId>
        <artifactId>dropwizard-simple-cors</artifactId>
        <version>0.2.1</version>
    </dependency>
    <!--/ Dropwizard -->

    <!-- Utils -->
    <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.8.2</version>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.2</version>
        <scope>provided</scope>
    </dependency>
    <!-- /Utils -->




Getting this error. If I don't use swagger it works. Please let me know the fix.

loader
! java.lang.ClassNotFoundException: javax.servlet.jsp.JspApplicationContext
! at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
! at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
! at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
! 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 javax.servlet.jsp.JspApplicationContext
! 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:276)
! at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:240)
! at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:221)
! 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:200)
! at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
! 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:93)
! at com.labs.api.application.CascadeApplication.main(CascadeApplication.java:14)
java.lang.NoSuchMethodError: org.apache.commons.lang3.StringUtils.isNoneEmpty([Ljava/lang/CharSequence;)Z
        at io.swagger.util.ParameterProcessor$AnnotationsHelper.<init>(ParameterProcessor.java:442)
        at io.swagger.util.ParameterProcessor.applyAnnotations(ParameterProcessor.java:43)
        at io.swagger.jaxrs.Reader.getParameters(Reader.java:1069)
        at io.swagger.jaxrs.Reader.parseMethod(Reader.java:983)
        at io.swagger.jaxrs.Reader.read(Reader.java:325)
        at io.swagger.jaxrs.Reader.read(Reader.java:175)
        at io.swagger.jaxrs.config.BeanConfig.scanAndRead(BeanConfig.java:242)
        at io.swagger.jaxrs.config.BeanConfig.setScan(BeanConfig.java:221)
        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:200)
        at io.dropwizard.cli.EnvironmentCommand.run(EnvironmentCommand.java:42)
        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:93)
        at com.labs.api.application.CascadeApplication.main(CascadeApplication.java:14)
@yeronimuz
Copy link

Have the same problem. Any progress on this?

@jadams74
Copy link

I am seeing something similar however they are all warnings. There's a ton of them all simiarl to below. The common source seems to be org.reflections.Reflections. I've tried excluding org.reflections from dropwizard-swagger and specifying a different version via explicit dependency. This just started a series of rabbit holes of missing classes.

WARN  [2018-10-30 20:53:31,027] org.reflections.Reflections: could not get type for name org.osgi.framework.BundleListener from any class loader
! java.lang.ClassNotFoundException: org.osgi.framework.BundleListener
! at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
! 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 

@supamanda
Copy link

from here: https://groups.google.com/forum/#!topic/dropwizard-user/I0K4e0APudY
The reflections dependency (v0.9.11) has a bug in it - they recommend to downgrade to 0.9.10 as a workaround

havenith pushed a commit to havenith/dropwizard-swagger that referenced this issue Nov 16, 2021
Update to the correct api sorter configuration
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

No branches or pull requests

4 participants