0
I have a java swing application where I get a list of data from a webservice. When I run this by netbeans it does it right, now when I jar to send it to the client, the application just doesn’t make the request, it hangs. Follows the class:
public class Rest {
public void get() {
Client client = Client.create();
WebResource webResource = client
.resource("...");
ClientResponse response = webResource.accept("application/json")
.get(ClientResponse.class);
if (response.getStatus()
!= 200) {
throw new RuntimeException("Failed : HTTP error code : "
+ response.getStatus());
}
String[] result = new String[2];
String output = response.getEntity(String.class);
result[0] = String.valueOf(response.getStatus());
System.err.println(result[1]);
JsonParser parser = new JsonParser();
JsonObject obj = parser.parse(output).getAsJsonObject();
Gson gson = new Gson();
Arquivo arquivo = gson.fromJson(obj, Arquivo.class);
}
}
and here and where my boot calls
private void bt_listaActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
new Rest().get();
}
No error? Have you tried running the jar through a windows command terminal?
– user28595
well that!!! , I just executed ! it’s not bringing dependency !
– Felipe Souza