Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a java application that is built by maven under Windows. It calls some REST APIs from a web server. The problem is I always get the NoSuchMethodError when I make a REST call.

I think the reason is some Java libraries do not match. But I don't know the solution.

Caused by: javax.ws.rs.ProcessingException: javax.ws.rs.core.Response$Status$Family.familyOf(I)Ljavax/ws/rs/core/Response$Status$Family;
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:233)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:655)
at org.glassfish.jersey.client.JerseyInvocation$1.call(JerseyInvocation.java:652)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:228)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:424)
at org.glassfish.jersey.client.JerseyInvocation.invoke(JerseyInvocation.java:652)
at org.glassfish.jersey.client.JerseyInvocation$Builder.method(JerseyInvocation.java:412)
at org.glassfish.jersey.client.JerseyInvocation$Builder.post(JerseyInvocation.java:321)
at com.autodesk.dm.wipdata.rest2test.WebServiceClient.authenticate(WebServiceClient.java:206)
... 3 more
Caused by: java.lang.NoSuchMethodError: javax.ws.rs.core.Response$Status$Family.familyOf(I)Ljavax/ws/rs/core/Response$Status$Family;
at org.glassfish.jersey.message.internal.Statuses$StatusImpl.<init>(Statuses.java:63)
at org.glassfish.jersey.message.internal.Statuses$StatusImpl.<init>(Statuses.java:54)
at org.glassfish.jersey.message.internal.Statuses.from(Statuses.java:93)
at org.glassfish.jersey.client.HttpUrlConnector._apply(HttpUrlConnector.java:323)
at org.glassfish.jersey.client.HttpUrlConnector.apply(HttpUrlConnector.java:227)
at org.glassfish.jersey.client.ClientRuntime.invoke(ClientRuntime.java:224)
... 13 more
Posted

Its because you have having version 6 of java in Ubuntu and version 7 of java in windows.

You can change the version of java to 6 in windows, you'll get the same error.

Version 6 of java doesn't have the method familyOf(I)
http://docs.oracle.com/javaee/6/api/javax/ws/rs/core/Response.Status.Family.html[^]

whereas version 7 have it.
http://docs.oracle.com/javaee/7/api/javax/ws/rs/core/Response.Status.Family.html[^]
 
Share this answer
 
You probably forgot to include all libraries. That happens when it works on your IDE, but not in real life.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900