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

Bug: Cannot access YAML: java.lang.NoSuchMethodError #2661

Closed
denny99 opened this issue Feb 13, 2018 · 4 comments
Closed

Bug: Cannot access YAML: java.lang.NoSuchMethodError #2661

denny99 opened this issue Feb 13, 2018 · 4 comments
Assignees

Comments

@denny99
Copy link

denny99 commented Feb 13, 2018

I am trying to use swagger-core for my JAX RS API, but when trying to access the openapi.yaml file (In my case http://localhost:8080/api/openapi.yaml) i'm getting the following error:
java.lang.NoSuchMethodError: com.google.common.collect.Sets$SetView.iterator()Lcom/google/common/collect/UnmodifiableIterator;
The API itself is working as expected. Am i missing something or is this a bug?

Technology
JEE 8
Glassfish 5
JAX-RS 2.26
Swagger-jaxrs2 2.0.0-rc4

Stacktrace
stacktrace.txt
POM.xml
pom.txt
web.xml
web.txt

@denny99
Copy link
Author

denny99 commented Feb 14, 2018

I finally found the solution.
Glassfish has its own Guava Version which is not compatible with Swagger.

To fix it:
Create a glassfish-web.xml
And add <class-loader delegate="false"/>

@denny99 denny99 closed this as completed Feb 14, 2018
@peteclark3
Copy link

@denny99 add what? Seeing this issue too...

@denny99
Copy link
Author

denny99 commented Feb 27, 2018

Weird. It seems i've forgot to add the xml code or it got deleted?
The Glassfish xml should contain this option:
<glassfish-web-app> <class-loader delegate="false"/> </glassfish-web-app>

@vikrantk365
Copy link

I'm using spring boot with jersey.
I got the same error with the latest version of guava.
I could see that older version was clearly not getting added to the classpath.
So I tried multiple versions of guava. And the version that worked was com.google.guava:guava:24.1-jre ( <= 24.1-jre).

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