jakarta-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From harsha dv <dvhar...@gmail.com>
Subject [Regexp] StackOverflowError in RE.java
Date Tue, 07 Sep 2010 04:44:42 GMT
Hi All,

I am parsing a sql statement to get the placeholder or string using Regexp.
But am getting stackOverFlow exception from RE.java while executing the
statement re.match(sql, exprIndex).

Below is the details of the code.

String placeHolder = "(\\?)";
String oraString = "('(([^'])|(''))*')";
String placeHolderOrString = "(" + placeHolder + "|" + oraString + ")";

int exprIndex;
RE re = new RE(placeHolderOrString);

String sql = "INSERT INTO sniotm.freefrm_msg
(msg_id,enty_type,enty_id,subj,msg_body,cre_usr_id,cre_dttm,UPD_USR_ID,UPD_DTTM,PRCS_FLG)
SELECT SNIOTM.FREEFRM_MSG_SEQ.nextval,'DRIVER',
RPT_GENERAL.F_REMOVE_DOMAIN(IES.DRIVER_GID),'TRACTOR UNIT PICKUP OR DROP
FAILED','TRACTOR UNIT PICKUP OR DROP FAILED, COULD NOT COMPLETE PICKUP OR
DROP BECAUSE PREPLANNED PICKUP WAS NOT FOUND. PLEASE CONTACT YOUR DBL TO
VALIDATE TRACTOR
ASSIGNMENT',vpd.get_gl_user(),sysdate,vpd.get_gl_user(),sysdate,'N' FROM
ie_shipmentstatus ies
WHERE ies.i_transaction_no =$GID"

int argCount = 0;
for (exprIndex = 0;
    re.match(sql, exprIndex);
    exprIndex = re.getParenEnd(0))
    {
        if ("?".equals(re.getParen(0))) // indeed a place holder
            argMap.put(new Integer(exprIndex), getPkArg(argCount++));
    }


Exception java.lang.StackOverflowError

java.lang.StackOverflowError
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:910)
at org.apache.regexp.RE.matchNodes(RE.java:1376)
at org.apache.regexp.RE.matchNodes(RE.java:933)
at org.apache.regexp.RE.matchNodes(RE.java:933)

NOTE: It is working fine in one system but getting this error consistently
in other system.
Both uses jakarta-regexp-1.2.jar.

It will be very helpful if someone could help me resolving this issue with
your valuable suggestions/ past experiences.

Thanks,
Harsha

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message