The java stringTokenizer is recursive. So if you are parsing an
exceptionally long string and you are unfortunate your stack will grow until
you encounter a separator. The StackOverFlowError occurs because your stack
has grown too big as a result of the string tokenizer recursion. You might
want to take a look at the string you are passing to the tokenizer.
There are a couple of ways to avoid the stack overflow:
- don't use a recursive method
- figure out a way to shrink the string you are recursing over
- create your own iterator that parses your string looking for the
separator
Justy
----- Original Message -----
From: "Ganszky, Balazs (GEL,MSX)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 21, 2001 2:27 AM
Subject: Lang stack overflow
> Hi,
>
> I'm reciving this error on SUN/Solaris/NES3.6/NAS4.0sp1 :
> compiling template: GreenBook/jsp/greenrip.jsp, <NULL>
> Exception Stack Trace:
> java.lang.StackOverflowError
> at java.lang.Character.isWhitespace(Compiled Code)
> at com.netscape.server.servlet.jsp.JSPTokenizer.nextToken(Compiled
> Code)
> at com.netscape.server.servlet.jsp.JSP.consumeHTML(Compiled Code)
> at com.netscape.server.servlet.jsp.JSP.parseHTML(Compiled Code)
> at com.netscape.server.servlet.jsp.JSP.parseNext(Compiled Code)
> at com.netscape.server.servlet.jsp.JSP.parseBlock(Compiled Code)
> at com.netscape.server.servlet.jsp.JSP.parseBlock(Compiled Code)
> at com.netscape.server.servlet.jsp.JSP.parseBlock(Compiled Code)
> and this again 50 times
> But the same code is running on NT/NES3.6/NAS4.0sp1 without any problem.
>
> Has someone any idea?
>
> > ____________________________
> > Ganszky, Balazs
> > Infrastructure WEB Team
> >
> > tel : DC 821-2295 ; external :(36) -1- 399 - 2295
> > fax : DC 821-1972 ; external :(36) -1- 399 - 1972
> >
> > * [EMAIL PROTECTED]
> >
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets