[SoapRMI] Error reading big cdata chunks with XPP2
Aleksander Slominski
aslom_at_cs.indiana.edu
Wed, 03 Sep 2003 13:50:24 -0500
Timo Thomas wrote:
> Hi Alek,
>
> I'm getting errors reading cdata chunks > ~13K (e.g. attached file). In
> detail:
>
> Environment:
>
> - Windows 2000 SP3
> - J2SDK 1.4.2_01
> - XPP2 2.1.9
>
> Exception:
>
> java.lang.ArrayIndexOutOfBoundsException
> at java.lang.System.arraycopy(Native Method)
> at org.gjt.xpp.impl.tokenizer.Tokenizer.next(Tokenizer.java:1352)
> at org.gjt.xpp.impl.pullparser.PullParser.next(PullParser.java:391)
> [...]
>
>
hi Timo,
i will try to reproduce it and get it fixed.
> Apart from this, I'm having another problem, which isn't specific to
> your parser, but maybe your profound XML-parser knowledge may help
> quickly :)
>
> Is it possible to get the byte offsets of XML elements when parsing a
> file? I only see methods for obtaining the line and column numbers. I
> need a fast random access to XML elements that can't be loaded into
> memory (they're big Log4J XML logs).
obtaining offset in file is one of features that i have coded in XPP2
and also patched Xerces2 to provide this information but not many people
found it useful and it was not applied in Xerces2 CVS (you can find it
discussed in xerces-j-dev mailing linst).
> To do this, I'd like to keep only
> the exact byte offsets of the log message xml elements in memory.
>
> Unfortunately, your parser seems to read bytes in advance to parsing
> them (I've installed a counter in the InputStream to test this). Do you
> know a way to circumvent this caching or any other way to get the
> offsets?
yes - use your custom InputStream that will allow to read only one byte
a time for all read() functions. using this technique parsing is a bit
slower but you will have exact count if how many bytes were read.
let me know if it worked.
thanks,
alek
--
If everything seems under control, you're just not going fast enough. —Mario Andretti