You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by "Richard Downer (JIRA)" <ji...@apache.org> on 2015/07/01 01:43:05 UTC

[jira] [Created] (BROOKLYN-154) NoSuchMethodError: javax.ws.rs.core.Response.close()V

Richard Downer created BROOKLYN-154:
---------------------------------------

             Summary: NoSuchMethodError: javax.ws.rs.core.Response.close()V
                 Key: BROOKLYN-154
                 URL: https://issues.apache.org/jira/browse/BROOKLYN-154
             Project: Brooklyn
          Issue Type: Bug
    Affects Versions: 0.7.0-SNAPSHOT
            Reporter: Richard Downer


While attempting to use brooklyn-rest-client in my project, I came across this error:

ava.lang.NoSuchMethodError: javax.ws.rs.core.Response.close()V
	at brooklyn.util.http.BuiltResponsePreservingError.copyResponseAndClose(BuiltResponsePreservingError.java:65) ~[brooklyn-rest-client-0.7.0-SNAPSHOT.jar:0.7.0-SNAPSHOT]
	at brooklyn.rest.client.BrooklynApi$1.invoke(BrooklynApi.java:135) ~[brooklyn-rest-client-0.7.0-SNAPSHOT.jar:0.7.0-SNAPSHOT]
	at com.sun.proxy.$Proxy75.createFromYaml(Unknown Source) ~[na:na]

On examining the problem, the implementation of javax.ws.rs.core.Response that was being picked up did indeed *not* have a close() method.

I examined the dependencies of the brooklyn-rest-client module. It turns out that there are *three* dependencies that provide javax.ws.rs.core.Response:

  * javax.ws.rs:jsr311-api:jar:1.1.1:compile
  * com.sun.jersey:jersey-core:jar:1.18.1:compile
  * org.jboss.resteasy:jaxrs-api:jar:3.0.8.Final:compile

Of these, only the last one provides a close() method - the other two are both much smaller classes. So this project has transitive dependencies that are mutually exclusive!

It seems that in many cases the JVM is putting the last one in the right place to enable this class to compile and execute. But in some cases at runtime the wrong one appears in its place and causes runtime errors like this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)