Array Conversion in Xstream Parser

Chaucer

New Member
Hi am trying to convert the following xml into object using Xstream parser.I tried using the below code to convert the xml but am getting \[code\]Duplicate field ERRORS---- Debugging information ----field : ERRORSclass : com.avidev9.Fees.GCSFeesResponse$DebitsWSDSrequired-type : com.avidev9.Fees.GCSFeesResponse$DebitsWSDSconverter-type : com.thoughtworks.xstream.converters.reflection.ReflectionConverterpath : /DebitsWSDS/ERRORS[2]line number : 1version : null\[/code\]The Code I used\[code\] xstream.alias("DebitsWSDS", DebitsWSDS.class); xstream.alias("DEBITS", DebitsWSDS.DEBITS.class); xstream.alias("list", DebitsWSDS.class); xstream.addImplicitCollection(DebitsWSDS.class, "ERRORS"); xstream.alias("ERROR_ID", String.class); xstream.alias("TABLE_NAME", String.class); xstream.alias("TABLE_ID", String.class); xstream.alias("ROW_ID", String.class); xstream.alias("ERROR_TEXT", String.class); xstream.alias("ERROR_CODE", String.class); xstream.alias("COLUMN_ID", String.class); xstream.alias("ERROR_TYPE", String.class);\[/code\]XML\[code\] <DebitsWSDS xmlns=""> <DEBITS> <DEBIT_ID>-1</DEBIT_ID> <ACCOUNT_ID>12321312313</ACCOUNT_ID> <EFFECTIVE_DATE>2012-12-12T00:00:00-06:00</EFFECTIVE_DATE> <DAY_OF_MONTH>12</DAY_OF_MONTH> <DEBIT_TYPE>S</DEBIT_TYPE> <OCCURS_NUM>1</OCCURS_NUM> <DEBIT_AMOUNT>750</DEBIT_AMOUNT> <MEMO>S</MEMO> <ACTIVE_FLAG>Y</ACTIVE_FLAG> <MODIFIED_BY/> <DEBIT_AUTHORIZED/> <DEBIT_AUTHORIZED_BY/> <REMAINING_OCCURRENCES>0</REMAINING_OCCURRENCES> </DEBITS> <ERRORS> <ERROR_ID>1</ERROR_ID> <TABLE_NAME>Debits</TABLE_NAME> <TABLE_ID>-1</TABLE_ID> <ROW_ID>0</ROW_ID> <COLUMN_ID>EXCEPTION</COLUMN_ID> <ERROR_TYPE>E</ERROR_TYPE> <ERROR_CODE>4</ERROR_CODE> <ERROR_TEXT>This debit type is not allowed for this company and policy group</ERROR_TEXT> </ERRORS> <ERRORS> <ERROR_ID>2</ERROR_ID> <TABLE_NAME>Clients</TABLE_NAME> <TABLE_ID/> <ROW_ID>0</ROW_ID> <COLUMN_ID>CLOSE_SCHED_DATE</COLUMN_ID> <ERROR_TYPE>E</ERROR_TYPE> <ERROR_CODE>4</ERROR_CODE> <ERROR_TEXT>Client has been closed. Cannot Authorize Draft.</ERROR_TEXT> </ERRORS> <ERRORS> <ERROR_ID>3</ERROR_ID> <TABLE_NAME>Debits</TABLE_NAME> <TABLE_ID>-1</TABLE_ID> <ROW_ID>0</ROW_ID> <COLUMN_ID>EXCEPTION</COLUMN_ID> <ERROR_TYPE>E</ERROR_TYPE> <ERROR_CODE>4</ERROR_CODE> <ERROR_TEXT>Cannot Schedule a Debit or Draft. Client has been closed.</ERROR_TEXT> </ERRORS> <ERRORS> <ERROR_ID>1</ERROR_ID> <TABLE_NAME>Debits</TABLE_NAME> <TABLE_ID>-1</TABLE_ID> <ROW_ID>0</ROW_ID> <COLUMN_ID>ACTIVE_FLAG</COLUMN_ID> <ERROR_TYPE>W</ERROR_TYPE> <ERROR_CODE>4</ERROR_CODE> <ERROR_TEXT>Creating debit on inactive Client account.</ERROR_TEXT> </ERRORS> </DebitsWSDS>\[/code\]My class structure.\[code\] package com.avidev9.Fees;import java.util.List;public class DebitsWSDS { public List<ERROR> ERRORS; public DEBITS DEBITS; public class ERROR { public String TABLE_NAME; public String TABLE_ID; public String ERROR_ID; public String ROW_ID; public String ERROR_TEXT; public String ERROR_CODE; public String COLUMN_ID; public String ERROR_TYPE; } public class DEBITS { public String EFFECTIVE_DATE; public String ACTIVE_FLAG; public String ACCOUNT_ID; public String DEBIT_AUTHORIZED_BY; public String DAY_OF_MONTH; public String DEBIT_ID; public String MEMO; public String REMAINING_OCCURRENCES; public String DEBIT_TYPE; public String OCCURS_NUM; public String DEBIT_AMOUNT; public String DEBIT_AUTHORIZED; public String MODIFIED_BY; }}\[/code\]
 
Back
Top