0

TicketGroup retrieval fails in Java API

Dear TicketEvolution,

We are using the Java API to connect to production. We tried to query TicketGroup data using this code :

/////////////code start////////////////////////////////

TicketGroupDAO tgd = new TicketGroupDAO();

List tgs = tgd.getTicketGroupByEventId(e.getId(), 10).getEntities();

/////////////code end////////////////////////////////

The list returned is a list of null objects and we found below exceptions logged:

/////////////exception start////////////////////////////////

org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "ticket_states" (Class com.ticketevalution.model.TicketGroup), not marked as ignorable

at Source: java.io.StringReader@1f78040; line: 1, column: 132

org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "exchange_notes" (Class com.ticketevalution.model.TicketGroup), not marked as ignorable

at Source: java.io.StringReader@50988; line: 1, column: 54

org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "private_notes" (Class com.ticketevalution.model.TicketGroup), not marked as ignorable

at Source: java.io.StringReader@1a42792; line: 1, column: 57

/////////////exception end////////////////////////////////

Looks like the returned json data has fields like ticket_states, exchange_notes, private_notes which are not defined in the TicketGroup model class. We added exchange_notes and private_notes as String fields and ticket_states as nested object of type TicketStates which we created. Then we faced a different exception:

/////////////exception start////////////////////////////////

org.codehaus.jackson.map.JsonMappingException: Can not construct instance of java.lang.Integer from String value 'BALC': not a valid Integer value

at [Source: java.io.StringReader@1171b26; line: 1, column: 200]

org.codehaus.jackson.map.JsonMappingException: Can not construct instance of java.lang.Integer from String value 'ORCH': not a valid Integer value

at [Source: java.io.StringReader@5dd582; line: 1, column: 195]

/////////////exception end////////////////////////////////

It looked like the error is due to the field "section" defined as an integer field in TicketGroup model class. We tried modifying field "section" to String type. Then the below error occured:

/////////////exception start////////////////////////////////

org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "in_hand_on" (Class com.ticketevalution.model.TicketGroup), not marked as ignorable

at Source: java.io.StringReader@618d26; line: 1, column: 256

/////////////exception end////////////////////////////////

We then added a String field in_hand_on. This solved all the problems. Our question is whether we did anything wrong or inappropriate that may lead to other problems. The modified TicketGroup class and the added TicketStates classes are attached for review.

Regards

1 comment

Please sign in to leave a comment.