Example usage for com.fasterxml.jackson.databind.exc UnrecognizedPropertyException printStackTrace

List of usage examples for com.fasterxml.jackson.databind.exc UnrecognizedPropertyException printStackTrace

Introduction

In this page you can find the example usage for com.fasterxml.jackson.databind.exc UnrecognizedPropertyException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:facturacion.restClient.TokenFacturacionRest.java

public static TokenFacturacion getUploadTokenFacturacion(String ci_ruc) {
    try {/*w  ww.  j  a va2 s .c  o  m*/
        WebTarget webTarget = Uri.uriUploadTokenFacturacion(ci_ruc);
        Invocation.Builder invocationBuilder = webTarget.request(MediaType.APPLICATION_JSON);
        invocationBuilder.header("some-header", "true");

        Response response = invocationBuilder.get();
        /*
        byte[] g;
        if (response.getStatus() == 200) {            
                //g = mapper.readValue(response.readEntity(String.class),  new TypeReference<List<Empresa>>() {});
                System.out.println("---------------------------------");
                //System.out.println(response.readEntity(String.class));
                g = response.readEntity(byte[].class);
                System.out.println(g);
        } else {
                System.out.println("---===> 0111");
                g = null;
        }
        return null;
        */
        System.out.println("---===> 0111 status == " + response.getStatus());
        return (response.getStatus() == 200)
                ? (new ObjectMapper()).readValue(response.readEntity(String.class), TokenFacturacion.class)
                : null;

    } catch (UnrecognizedPropertyException e) {
        System.out.println("erro en los dats de mapeo de la URI");
        return null;
    } catch (ProcessingException e) {
        System.out.println("Error no se pudo conectar a la URI");
        return null;
    } catch (JsonGenerationException e) {
        System.out.println("---===> 1");
        e.printStackTrace();
        return null;
    } catch (JsonMappingException e) {
        System.out.println("---===> 2");
        e.printStackTrace();
        return null;
    } catch (Exception e) {
        System.out.println("---===> 3");
        e.printStackTrace();
        return null;
    }
}