我正在尝试使用代理框架构建一个简单的resteasy客户机。我得到一个错误,“无法示例化resteasyclientbuilder类型”。这是客户机类。
package com.RestClient.Clients;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
import com.RestClient.Models.Student;
public class ClientClass {
ResteasyClient client;
ResteasyWebTarget base_target,student_target;
ClientInterface proxy;
public ClientClass() {
client = new ResteasyClientBuilder().build();<---------error
base_target = client.target(UriBuilder.fromPath("http://localhost:8080/demorest/webresources/"));
student_target = base_target.path("students");
}
public int registerStudent(Student s) {
Response res = proxy.createStudent(s);
return res.getStatus();
}
}
我在学习这个教程。
暂无答案!
目前还没有任何答案,快来回答吧!