powered by Jive Software

Rest api client java.lang.NoSuchFieldError: EXCLUDE_EMPTY

I have add the rest api client code in my project,but when new ClientConfig(),there is a wrong is java.lang.NoSuchFieldError: EXCLUDE_EMPTY;
this is my controller:
![N}%KO2CZTXKW(@P~WEQ~YF|690x189
@Controller
public class UserController {

@RequestMapping("test/user")
@ResponseBody
public UserEntities getUser(){
    AuthenticationToken authenticationToken = new AuthenticationToken("ZEXVTrCPQB2sXVFm");
    RestApiClient restApi = new RestApiClient("http://192.168.1.193",9090,authenticationToken);
    UserEntities users = restApi.getUsers();
    System.out.print(users);
    return users;
}

}
private Client createrRestClient() throws KeyManagementException, NoSuchAlgorithmException {
ClientConfig clientConfig = new ClientConfig();**//**here throw exception

	// Set connection timeout
	if (this.connectionTimeout != 0) {
		clientConfig.property(ClientProperties.CONNECT_TIMEOUT, this.connectionTimeout);
		clientConfig.property(ClientProperties.READ_TIMEOUT, this.connectionTimeout);
	}

	Client client = null;
	if (this.baseURI.startsWith("https")) {
		client = createSLLClient(clientConfig);
	} else {
		client = ClientBuilder.newClient(clientConfig);
	}

please help me

Do you have multiple versions of jersey? (client / server)

I have created a new project,add rest-api-client.jar in this new project,this project can run.but when i add rest-api-client.jar in another old project,the project also throw exception, java.lang.NoSuchFieldError: EXCLUDE_EMPTY

at org.glassfish.jersey.client.ClientConfig$State.<init>(ClientConfig.java:150)
at org.glassfish.jersey.client.ClientConfig.<init>(ClientConfig.java:468)
at org.igniterealtime.restclient.RestClient.createrRestClient(RestClient.java:246)
at org.igniterealtime.restclient.RestClient.createWebTarget(RestClient.java:204)
at org.igniterealtime.restclient.RestClient.call(RestClient.java:146)
at org.igniterealtime.restclient.RestClient.get(RestClient.java:77)
at org.igniterealtime.restclient.RestApiClient.getUsers(RestApiClient.java:68)
at cn.fengwoo.eave.controller.CooperationApiControllerTest.findCooperationType(CooperationApiControllerTest.java:15)
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:483)
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.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.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)