Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORA-29532 with XML

Status
Not open for further replies.

mike777

Programmer
Jun 3, 2000
387
US
Hello.
I have the following code:
Code:
set serveroutput on
declare
     v_doc_text    varchar2(2000);
     v_parser      xmlparser.parser;
     v_doc         xmldom.domdocument;
     v_n           xmldom.domnode;
     nnm           xmldom.DOMNamedNodeMap;
     n_l           xmldom.DOMnodelist;
     attrname      varchar2(100);
     attrval       varchar2(100);
     len2          number;
     n             xmldom.DOMNode;
     vcLocalNm     varchar2(1000);
     sOutput       varchar2(1000);
begin
     v_doc_text:='<?xml version="1.0" ?><DATA_RECORD><SALUTATION>Ms</SALUTATION><A1FIRST>Kristi</A1FIRST><A1MIDDLE>L</A1MIDDLE><A1LAST>Knapp</A1LAST><STNAME>Ms Kristi L Knapp</STNAME><A1ADR_01>2210 Blackoak Bnd</A1ADR_01><A1CTY>San Antonio</A1CTY><A1STCD>TX</A1STCD><A1ZP>78248-2310</A1ZP><A1PHONE>9734087052</A1PHONE><CRCCODE>C085</CRCCODE><A1LNTYCD>VA</A1LNTYCD><RECCOUNT>34550</RECCOUNT><BRANCH>SANAN</BRANCH><BRANCHCD>SANA1</BRANCHCD><SOURCE>LEADMAST</SOURCE><ORGPHONE>201/408-7052</ORGPHONE><RUNDATE>1996/06/07 00:00:00</RUNDATE><FILE_SOURCE>master</FILE_SOURCE><DELETE_FLAG>Y</DELETE_FLAG><P_KEY>10141173</P_KEY></DATA_RECORD>';
     v_parser  :=xmlparser.newParser;
     xmlparser.parseBuffer(v_parser,v_doc_text);
     v_doc     :=xmlparser.getDocument(v_parser);
     n_l       :=xmldom.getElementsByTagName(v_doc,'*');
     len2      :=xmldom.getlength(n_l);
     for i in 0..len2-1 loop
          n:=xmldom.item(n_l,i);
          dbms_output.put_line('Node Elements: '||xmldom.getNodeName(n));
          n:=xmldom.getfirstchild(n);
          if xmldom.getNodeType(n)=xmldom.TEXT_NODE then
               dbms_output.put_line('='||xmldom.getNodeValue(n));
          end if;
     end loop;
     xmlparser.freeParser(v_parser);
     xmldom.freeDocument(v_doc);
end;
When Oracle hits the line that says "n_l :=xmldom.getElementsByTagName(v_doc,'*');", I get ORA-29532: Java call terminated by uncaught Java exception: java.lang.ArrayIndexOutOfBoundsException: -2015
It also has several ORA-06512's after it.
Thing is, it was working, then I just started getting these error messages for no <<apparent>> reason.
Can you help??!
Many thanks.
-Mike
 
Dima -
Indeed.
I try to keep my threads updated, but I dropped the ball on this one. I simply logged off and logged back on and everything worked - kind of.
By the way, we are on 8.1.7.0.
By "kind of" I mean, everything worked for the exact scenario I posted here. Obviously, though, that is just a micro-example of my real-world scenario. In the real deal, I have to execute that script for 13k rows of one XML rowset each. Everything worked - up to the approximately 2200th row. Then I started getting ORA-29532: java.lang.ArrayIndexOutOfBoundsException again. I tested and retested. If consistently occurred after approximately 2200 rows (from the source table, each row being one XML rowset).
So, I decided I would try reading all 13k rows into a temporary clob variable (final size about 2.5M), and using xmldom.parseclob instead of xmldom.parsebuffer. This worked fine. On my way now (for the moment, until I hit another speed bump!).
There are many entries on Metalink about ORA-29532. In several of the threads it is listed as a bug that was resolved in Oracle 9i.
Thanks for the offer to help.
-Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top