Example usage for com.fasterxml.jackson.databind JsonMappingException printStackTrace

List of usage examples for com.fasterxml.jackson.databind JsonMappingException printStackTrace

Introduction

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

Prototype

public void printStackTrace() 

Source Link

Document

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

Usage

From source file:com.snowplowanalytics.snowplow.tracker.core.payload.TrackerPayload.java

@Override
public Map getMap() {
    HashMap<String, String> map = new HashMap<String, String>();
    try {/*from w ww.ja v  a  2 s .c o m*/
        logger.debug("Attempting to create a Map structure from ObjectNode.");
        map = objectMapper.readValue(objectNode.toString(), new TypeReference<Map>() {
        });
    } catch (JsonMappingException e) {
        e.printStackTrace();
    } catch (JsonParseException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return map;
}

From source file:com.snowplowanalytics.snowplow.tracker.core.payload.SchemaPayload.java

public Map<String, Object> getMap() {
    HashMap<String, Object> map = new HashMap<String, Object>();
    try {/*w  w w .  j  ava2  s.c o  m*/
        map = objectMapper.readValue(objectNode.toString(), new TypeReference<HashMap>() {
        });
    } catch (JsonMappingException e) {
        e.printStackTrace();
    } catch (JsonParseException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    return map;
}

From source file:demo.jaxrs.server.CustomerServiceImpl.java

public Response getCustomer2(String id) {
    System.out.println("----invoking getCustomer, Customer id is: " + id);
    long idNumber = Long.parseLong(id);
    Customer c = customers.get(idNumber);
    ObjectMapper m = new ObjectMapper();
    SchemaFactoryWrapper visitor = new SchemaFactoryWrapper();
    try {/* ww  w .ja  va 2 s  . c om*/
        m.acceptJsonFormatVisitor(m.constructType(Customer.class), visitor);
    } catch (JsonMappingException e) {
        e.printStackTrace();
    }
    JsonSchema jsonSchema = visitor.finalSchema();
    //        jsonSchema.asStringSchema().toString();
    //        System.out.println(jsonSchema.);
    if (c != null) {
        return Response.ok(c).build();
    } else {
        Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
        //            builder.type(MediaType.APPLICATION_JSON_TYPE);
        builder.type(MediaType.APPLICATION_XML);
        builder.entity("<error>Customer Not Found!</error>");
        //            return Response.status(Response.Status.BAD_REQUEST).build();
        throw new WebApplicationException(builder.build());
    }
}

From source file:org.apache.streams.data.moreover.MoreoverResult.java

public BigInteger process() {

    try {/*from w ww  .j  a  va  2  s  .  c  om*/
        this.resultObject = xmlMapper.readValue(xmlString, ArticlesResponse.class);
    } catch (JsonMappingException e) {
        // theory is this may not be fatal
        this.resultObject = (ArticlesResponse) e.getPath().get(0).getFrom();
    } catch (Exception e) {
        e.printStackTrace();
        logger.warn("Unable to process document:");
        logger.warn(xmlString);
    }

    if (this.resultObject.getStatus().equals("FAILURE")) {
        logger.warn(this.resultObject.getStatus());
        logger.warn(this.resultObject.getMessageCode());
        logger.warn(this.resultObject.getUserMessage());
        logger.warn(this.resultObject.getDeveloperMessage());
    } else {
        this.articles = resultObject.getArticles();
        this.articleArray = articles.getArticle();

        for (Article article : articleArray) {
            BigInteger sequenceid = new BigInteger(article.getSequenceId());
            list.add(new StreamsDatum(article, sequenceid));
            logger.trace("Prior max sequence Id {} current candidate {}", this.maxSequencedId, sequenceid);
            if (sequenceid.compareTo(this.maxSequencedId) > 0) {
                this.maxSequencedId = sequenceid;
            }
        }
    }

    return this.maxSequencedId;
}