1

Hi when I try to send POST request using jersey-client[org.glassfish.jersey.core 2.22.1] I got following error. So I read this Question and REST JAX-RS javax.ws.rs.ProcessingException: so I don't have used [jsr311-api] dependency.but I have added this dependency to my client. These are the client dependencies(not all deps).

<dependency>
    <groupId>javax.ws.rs</groupId>
    <artifactId>javax.ws.rs-api</artifactId>
    <version>2.0.1</version>
</dependency>
<dependency>
   <groupId>org.glassfish.jersey.core</groupId>
   <artifactId>jersey-client</artifactId>
   <version>2.22.1</version>
</dependency>

And these are the server side dependencies

    <dependency>
        <groupId>javax.ws.rs</groupId>
        <artifactId>javax.ws.rs-api</artifactId>
        <version>2.0.1</version>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http-jetty</artifactId>
        <version>3.1.5</version>
    </dependency>

And this is the error.

[javax.ws.rs.ProcessingException: java.lang.NoSuchMethodError: javax.ws.rs.core.Response$Status$Family.familyOf(I)Ljavax/ws/rs/core/Response$Status$Family;

I know this is issue with dependency version mismatch .Can anyone tell me how to resole this problem.

Community
  • 1
  • 1
Sajith Vijesekara
  • 1,324
  • 2
  • 17
  • 52
  • Post _all_ your dependencies, and explain from where you are running your code, and the environment. This is definitely a version mismatch, so with this information we can help you find out where the bad version is coming from. – Paul Samsotha Mar 08 '16 at 11:25
  • Thanks for your response i will update question. – Sajith Vijesekara Mar 08 '16 at 11:32
  • If these are your only dependencies, they alone would not cause the error. It might be your server environment and _its_ classpath – Paul Samsotha Mar 08 '16 at 11:52
  • Can you check the dependency hierarchy in eclipse and see if there is any other jar which is using an older version or incompatible version of jaxrs? This could be because some dependent jar or project included uses an older version as well. This is how I solved an older version JAX-RS problem. http://stackoverflow.com/a/35655313/1925997 – Kishore Bandi Mar 08 '16 at 11:59
  • Thanks for your reply i have checked dependency tree and there is no other javax.ws dependency in the list. – Sajith Vijesekara Mar 08 '16 at 12:02
  • @Sajithv How you have manage to solve this issue? – deen Apr 10 '18 at 08:59

0 Answers0