[
http://jira.codehaus.org/browse/JIBX-172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_100854
]
Jan Finzen commented on JIBX-172:
---------------------------------
I get a similar exception "occasionally".
Problem is, it doesn't seem to depend directly on the input data. When I rerun
the code using the same data it works fine. In fact I use a retry as a dirty
workaround for that problem...
Stacktrace:
java.lang.ArrayIndexOutOfBoundsException: 2048
at
org.jibx.runtime.impl.ISO88591StreamWriter.writeTextContent(ISO88591StreamWriter.java(Compiled
Code))
at
org.jibx.runtime.impl.MarshallingContext.element(MarshallingContext.java:698)
at
jzf.test.domain.Regelergebnis.JiBX_bindingPruefergebnis_marshal_1_0(Regelergebnis.java)
at jzf.test.domain.JiBX_bindingPruefergebnisRegelergebnis_access.marshal()
at
jzf.test.domain.JiBX_MungeAdapter.JiBX_bindingPruefergebnis_marshal_1_8()
at
jzf.test.domain.Prueflauf.JiBX_bindingPruefergebnis_marshal_1_0(Prueflauf.java)
at jzf.test.domain.JiBX_bindingPruefergebnisPrueflauf_access.marshal()
at jzf.test.domain.Prueflauf.marshal(Prueflauf.java)
at
org.jibx.runtime.impl.MarshallingContext.marshalRoot(MarshallingContext.java:1035)
at
org.jibx.runtime.impl.MarshallingContext.marshalDocument(MarshallingContext.java:1083)
at jzf.test.utils.JiBX.getErgebnisXML(JiBX.java:110)
(...)
> ArrayIndexOutOfBoundsException during marshalling a element contains large
> XML-data
> -----------------------------------------------------------------------------------
>
> Key: JIBX-172
> URL: http://jira.codehaus.org/browse/JIBX-172
> Project: JiBX
> Issue Type: Bug
> Components: core
> Affects Versions: JiBX 1.0.1
> Environment: JDK 1.4.2_03-b02
> WinXP pro / Unix
> Reporter: André Sudhoff
>
> An exception is thrown when marshalling an element contains a XML-String and
> the encoded size exceeds 4K.
> if I replace all following characters "<", ">" for example with "#", "*" the
> marshalling works fine.
> Example which throws Exception:
> String wert = "<imp id=\"get_current_alarms\">\n" +
>
> "<alarm_op_result><![CDATA[CS_ALARM_RETRIEVED]]></alarm_op_result>\n" +
> "<imp id=\"alarms\">\n" +
> "<imp id=\"alarm_message\">\n" +
>
> "<alarm_condition><![CDATA[CS_LOSS_OF_SYNC]]></alarm_condition>\n" +
> "<event_time><![CDATA[0]]></event_time>\n" +
>
> "<layer1_data><![CDATA[CS_ALM_NO_LAYER1_ADDITIONAL_DATA]]></layer1_data>\n" +
>
> "<sync_loss_data><![CDATA[CS_LFA_AIS_OR_LIS_AT_NT]]></sync_loss_data>\n" +
>
> "<bit_error_data><![CDATA[CS_BIT_ERR_DIRECTION_IN]]></bit_error_data>\n" +
> "<nrt_alm_err_mesg/>\n" +
> "<imp id=\"line\">\n" +
>
> "<switch_short_name><![CDATA[0000-T7---D]]></switch_short_name>\n" +
> "<equipment_number/>\n" +
>
> "<directory_number><![CDATA[00000000]]></directory_number>\n" +
> "<stroke_number><![CDATA[0]]></stroke_number>\n" +
> "</imp>\n" +
> "</imp>\n" +
> "<imp id=\"alarm_message\">\n" +
>
> "<alarm_condition><![CDATA[CS_BER_EXCEEDED_10_6]]></alarm_condition>\n" +
> "<event_time><![CDATA[0000000000]]></event_time>\n" +
>
> "<layer1_data><![CDATA[CS_ALM_NO_LAYER1_ADDITIONAL_DATA]]></layer1_data>\n" +
>
> "<sync_loss_data><![CDATA[CS_NO_SYNC_LOSS_ADDITIONAL_DATA]]></sync_loss_data>\n"
> +
>
> "<bit_error_data><![CDATA[CS_BIT_ERR_DIRECTION_IN]]></bit_error_data>\n" +
> "<nrt_alm_err_mesg/>\n" +
> "<imp id=\"line\">\n" +
>
> "<switch_short_name><![CDATA[0000-T7---D]]></switch_short_name>\n" +
> "<equipment_number/>\n" +
>
> "<directory_number><![CDATA[0000000000]]></directory_number>\n" +
> "<stroke_number><![CDATA[0]]></stroke_number>\n" +
> "</imp>\n" +
> "</imp>\n" +
>
> "<imp id=\"alarm_message\">\n" +
>
> "<alarm_condition><![CDATA[CS_LAYER2_DEACTIVATION]]></alarm_condition>\n" +
> "<event_time><![CDATA[0]]></event_time>\n" +
>
> "<layer1_data><![CDATA[CS_ALM_NO_LAYER1_ADDITIONAL_DATA]]></layer1_data>\n" +
>
> "<sync_loss_data><![CDATA[CS_NO_SYNC_LOSS_ADDITIONAL_DATA]]></sync_loss_data>\n"
> +
>
> "<bit_error_data><![CDATA[CS_BIT_ERR_DIRECTION_IN]]></bit_error_data>\n" +
> "<nrt_alm_err_mesg/>\n" +
> "<imp id=\"line\">\n" +
>
> "<switch_short_name><![CDATA[0000-T7---D]]></switch_short_name>\n" +
> "<equipment_number/>\n" +
>
> "<directory_number><![CDATA[0000000000]]></directory_number>\n" +
> "<stroke_number><![CDATA[0]]></stroke_number>\n" +
> "</imp>\n" +
> "</imp>\n" +
>
> "<imp id=\"alarm_message\">\n" +
>
> "<alarm_condition><![CDATA[CS_LAYER1_INTERRUPT]]></alarm_condition>\n" +
> "<event_time><![CDATA[0000000000]]></event_time>\n" +
>
> "<layer1_data><![CDATA[CS_ALM_NO_LAYER1_ADDITIONAL_DATA]]></layer1_data>\n" +
>
> "<sync_loss_data><![CDATA[CS_NO_SYNC_LOSS_ADDITIONAL_DATA]]></sync_loss_data>\n"
> +
>
> "<bit_error_data><![CDATA[CS_BIT_ERR_DIRECTION_IN]]></bit_error_data>\n" +
> "<nrt_alm_err_mesg/>\n" +
> "<imp id=\"line\">\n" +
>
> "<switch_short_name><![CDATA[0000-T7---D]]></switch_short_name>\n" +
> "<equipment_number/>\n" +
>
> "<directory_number><![CDATA[00000000000]]></directory_number>\n" +
> "<stroke_number><![CDATA[0]]></stroke_number>\n" +
> "</imp>\n" +
> "</imp>\n" +
>
> "<imp id=\"alarm_message\">\n" +
>
> "<alarm_condition><![CDATA[CS_TRANS_QUALITY_CAUSE_DEAC]]></alarm_condition>\n"
> +
> "<event_time><![CDATA[0]]></event_time>\n" +
>
> "<layer1_data><![CDATA[CS_ALM_NO_LAYER1_ADDITIONAL_DATA]]></layer1_data>\n" +
>
> "<sync_loss_data><![CDATA[CS_NO_SYNC_LOSS_ADDITIONAL_DATA]]></sync_loss_data>\n"
> +
>
> "<bit_error_data><![CDATA[CS_BIT_ERR_DIRECTION_IN]]></bit_error_data>\n" +
> "<nrt_alm_err_mesg/>\n" +
> "<imp id=\"line\">\n" +
>
> "<switch_short_name><![CDATA[0000000000-T7---D]]></switch_short_name>\n" +
> "<equipment_number/>\n" +
>
> "<directory_number><![CDATA[0000000000]]></directory_number>\n" +
> "<stroke_number><![CDATA[0]]></stroke_number>\n" +
> "</imp>\n" +
> "</imp>\n" +
>
> "<imp id=\"alarm_message\">\n" +
>
> "<alarm_condition><![CDATA[CS_POWER_FAILURE_IN_TERMINAL]]></alarm_condition>\n"
> +
> "<event_time><![CDATA[0]]></event_time>\n" +
>
> "<layer1_data><![CDATA[CS_ALM_NO_LAYER1_ADDITIONAL_DATA]]></layer1_data>\n" +
>
> "<sync_loss_data><![CDATA[CS_NO_SYNC_LOSS_ADDITIONAL_DATA]]></sync_loss_data>\n"
> +
>
> "<bit_error_data><![CDATA[CS_BIT_ERR_DIRECTION_IN]]></bit_error_data>\n" +
> "<nrt_alm_err_mesg/>\n" +
> "<imp id=\"line\">\n" +
>
> "<switch_short_name><![CDATA[00000-T7---D]]></switch_short_name>\n" +
> "<equipment_number/>\n" +
>
> "<directory_number><![CDATA[0000000000]]></directory_number>\n" +
> "<stroke_number><![CDATA[0]]></stroke_number>\n" +
> "</imp>\n" +
> "</imp>\n" +
> "</imp>\n" +
> "</imp>\n";
> OfflinediagnoseauftragVO auftrag = new OfflinediagnoseauftragVO();
> auftrag.setAuftragValue(wert);
> ByteArrayOutputStream byteArrayOutputStream = new
> ByteArrayOutputStream();
> IBindingFactory bindingFactory =
> BindingDirectory.getFactory(OfflinediagnoseauftragVO.class);
> IMarshallingContext marshallingContext =
> bindingFactory.createMarshallingContext();
> marshallingContext.marshalDocument(auftrag, "ISO-8859-1",
> Boolean.TRUE, byteArrayOutputStream);
> String resutl = byteArrayOutputStream.toString();
> >>>>>>>>>>>>>> EXCEPTION >>>>>>>>>>>>>>>>>
> Exception while marshalling element "Wert"
> java.lang.ArrayIndexOutOfBoundsException: 4096
> at org.jibx.runtime.impl.ISO88591StreamWriter.writeTextContent(Unknown
> Source)
> at org.jibx.runtime.impl.MarshallingContext.element(Unknown Source)
> at
> de.test.es.vo.MesswertVO.JiBX_Es_diagnose_binding_marshal_1_0(MesswertVO.java)
> at de.test.es.vo.JiBX_Es_diagnose_bindingMesswertVO_access.marshal()
> at
> de.test.bdb.vo.JiBX_MungeAdapter.JiBX_Es_diagnose_binding_marshal_1_22()
> at
> de.test.es.vo.MesssystemVO.JiBX_Es_diagnose_binding_marshal_1_0(MesssystemVO.java)
> at de.test.es.vo.JiBX_Es_diagnose_bindingMesssystemVO_access.marshal()
> at
> de.test.bdb.vo.JiBX_MungeAdapter.JiBX_Es_diagnose_binding_marshal_1_25()
> at
> de.test.es.vo.DiagnoseVO.JiBX_Es_diagnose_binding_marshal_1_0(DiagnoseVO.java)
> at
> de.test.es.vo.OfflinediagnoseauftragVO.JiBX_Es_diagnose_binding_marshal_1_0(OfflinediagnoseauftragVO.java)
> at
> de.test.es.vo.JiBX_Es_diagnose_bindingOfflinediagnoseauftragVO_access.marshal()
> at
> de.test.es.vo.OfflinediagnoseauftragVO.marshal(OfflinediagnoseauftragVO.java)
> at org.jibx.runtime.impl.MarshallingContext.marshalRoot(Unknown Source)
> at org.jibx.runtime.impl.MarshallingContext.marshalDocument(Unknown
> Source)
> at
> de.test.shared.utils.TkpUtils.marshalOfflinediagnoseauftrag(TkpUtils.java:86)
> If you add the following lines before marshalling all works fine:
> ...
> OfflinediagnoseauftragVO auftrag = new OfflinediagnoseauftragVO();
> auftrag.setAuftragValue(wert);
> wert = wert.replaceAll("<", "#lt;");
> wert = wert.replaceAll(">", "#gt;");
> ...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs