• Post Reply Bookmark Topic Watch Topic
  • New Topic

StackOverflowError

 
Anjali Aggarwal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am creating a new JSP and including the header and footer jsp files in it. But when I run the code, I get the following exception:

PWC1406: Servlet.service() for servlet jsp threw exception
java.lang.StackOverflowError
at java.io.InputStream.<init>(InputStream.java:28)
at java.io.FileInputStream.<init>(FileInputStream.java:96)
at org.apache.naming.resources.FileDirContext$FileResource.streamContent(FileDirContext.java:1035)
at org.apache.catalina.core.ApplicationContext.getResourceAsStream(ApplicationContext.java:670)
at org.apache.catalina.core.ApplicationContextFacade.getResourceAsStream(ApplicationContextFacade.java:238)
at org.apache.jasper.JspCompilationContext.getResourceAsStream(JspCompilationContext.java:320)
at org.apache.jasper.compiler.JspUtil.getInputStream(JspUtil.java:906)
at org.apache.jasper.xmlparser.XMLEncodingDetector.getEncoding(XMLEncodingDetector.java:143)
at org.apache.jasper.compiler.ParserController.determineSyntaxAndEncoding(ParserController.java:376)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:210)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:156)
at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:390)
at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:427)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:570)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1642)
at org.apache.jasper.compiler.Parser.parse(Parser.java:181)
at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:239)
at org.apache.jasper.compiler.ParserController.parse(ParserController.java:156)
at org.apache.jasper.compiler.Parser.processIncludeDirective(Parser.java:390)
at org.apache.jasper.compiler.Parser.parseIncludeDirective(Parser.java:427)
at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:570)
at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1642)
at org.apache.jasper.compiler.Parser.parse(Parser.java:181)

.
.
.

Can anyone help me in resolving this?
 
Swastik Dey
Rancher
Posts: 1686
7
Android Eclipse IDE Java Java ME
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we have a look on the code?
 
Rob Spoor
Sheriff
Posts: 20821
68
Chrome Eclipse IDE Java Windows
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error comes from the parsing part. This makes me think that you perhaps include a file recursively. Without seeing the code we can't be sure though.

Edit: I've written a simple example which includes itself. My stack trace looks similar. That strengthens my believe about a recursive include.
My test JSP (called test.jsp):
 
Anjali Aggarwal
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Rob.. problem was the same, "recursive inclusion of header.jsp" but the hierarchy was too long to track, but i finally solved the problem.. thanks :)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!