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: javax.ws.rs.core.Response.close()V during execution #222

Closed
mhradek opened this issue Jul 7, 2017 · 2 comments
Closed

Comments

@mhradek
Copy link

mhradek commented Jul 7, 2017

Attempting to run a JUnit test I'm getting a NoSuchMethodError: javax.ws.rs.core.Response.close()V error. Looking into it, it seems like there are some deviations in the difference packages providing the Response object.

https://issues.apache.org/jira/browse/BROOKLYN-154

While a different project, the above explains the issue in more details. Essentially, I'm trying to integrate and then test the cfg4j-consul module similarly to the way the example is stood up.

java.lang.NoSuchMethodError: javax.ws.rs.core.Response.close()V at com.orbitz.consul.AgentClient.ping(AgentClient.java:77) at com.orbitz.consul.Consul.<init>(Consul.java:73) at com.orbitz.consul.Consul.<init>(Consul.java:24) at com.orbitz.consul.Consul$Builder.build(Consul.java:337) at org.cfg4j.source.consul.ConsulConfigurationSource.init(ConsulConfigurationSource.java:101) at org.cfg4j.provider.ConfigurationProviderBuilder.build(ConfigurationProviderBuilder.java:142) at com.test.studio.common.configuration.ConfigBeans.testConfigurationProvider(ConfigBeans.java:59) at com.test.studio.common.configuration.MemcachedConfigTest.test(MemcachedConfigTest.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

@mhradek
Copy link
Author

mhradek commented Jul 7, 2017

This is the result of a dependency conflict deep within Spring (org.springframework.cloud:spring-cloud-starter-consul-all:jar:1.2.1.RELEASE -> javax.ws.rs:jsr311-api:jar:1.1.1:runtime) and then this module.

@mhradek mhradek closed this as completed Jul 7, 2017
@mhradek
Copy link
Author

mhradek commented Jul 7, 2017

For posterity, the solution was to exclude the outdated dependecy allowing this module's inclusion to be used like so:

  <dependency>
      <groupId>org.springframework.cloud</groupId>
      <artifactId>spring-cloud-starter-consul-all</artifactId>
      	  <exclusions>
  	        <exclusion> 
      			<groupId>javax.ws.rs</groupId>
      			<artifactId>jsr311-api</artifactId>
  	        </exclusion>
  	   </exclusions>
  </dependency>

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

1 participant