Issue Details (XML | Word | Printable)

Key: PUB-2538
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: P3 - Defect P3 - Defect
Assignee: Valeriy Urbansky
Reporter: KChakravarti
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Artix Data Services

Parsing a file containing thousands of messages can throw an erroneous exception

Created: Wed 10-Jan-07 17:01   Updated: Wed 07-Feb-07 10:02
Component/s: API - Data
Affects Version/s: 3.5.8
Fix Version/s: 3.5.10

Time Tracking:
Not Specified

File Attachments: 1. Text File mt535Bulk.txt (3.49 MB)

Issue Links:
Associate
 

Tag Issue:


 Description  « Hide
the following code parses up to about 5200 messages and then throws an exception:

<code>
DefaultSource src = new DefaultSource();
            src.setLookAhead(199999999);
            src.setReader(new FileReader(new File("C:\\c24_sandbox\\CITI Group\\mt535Bulk.txt")));
            int i = 1;
            do{
                    Object sma535 = src.readObject(MT535iElement.getInstance())
                    System.out.println("Parsed " + i + " Messages");
                i++;
            }while(src.ready());
</code>

<exception>
biz.c24.io.api.ParserException: Probable Cause:
   Initiator(s) not found (expecting '{1:') at offset 3658122 (line 187597, column 3) whilst attempting to parse MT535i/Block1
at biz.c24.io.api.presentation.DefaultSource.readObject(DefaultSource.java:249)
at biz.c24.io.api.presentation.DefaultSource.readObject(DefaultSource.java:226)
at Test.loadMessage(Test.java:125)
at Test.main(Test.java:107)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
</exception>

The test data file has been attached.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Divan Mostert added a comment - Fri 12-Jan-07 09:01
A \t character at the end of the data caused the exception. Removing this caused all messages to parse sucessfully.

However, there still seems to be an issue with the ready() method. We are currently looking into this.

Simon Heinrich added a comment - Mon 15-Jan-07 11:01
Chakravarti,

We are in the process of fixing the issue with th ready() method. In the mean time you should be able to workaround the problem by ensuring your test data DOES NOT contain any erroneous characters at the end of the data stream.

Please let us know if you require the fix to the ready() method in a pre-release patch. If you do not require a patched version, the fix will be release as part of 3.5.10.

Thanks,

Valeriy Urbansky added a comment - Mon 15-Jan-07 15:01
Done.