• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is StackOverflowError(code)

 
henry akoma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ July 25, 2005: Message edited by: henry akoma ]
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pretty large code, Can you post the detail log message, so that we can narrow down on the error
 
henry akoma
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JAIKIRAN,
i am sorry, i dont know what u mean by the log message.
but if paradventure u mean the console display, it reads: Exception in thread "main" java.lang.StackOverflowError.

if this is not what u requested, please direct me how to get it.
thank u
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Henry,
What i can make out from the error message is that your program is recursively invoking some method(infinite loop scenario) and control is NOT coming out of some funcation. Will have go through the entire code once to find out which method is being invoked recursively.

One option to find out the problem is to place a
System.out.println("Entering theNameOfTheMethod");
at the start of each method. This will help you track the flow
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, in the code there are some looping statements. Even these might be cause of the exception. Reason might be the condition for breaking out of the loop is NEVER met. Check it out
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by jaikiran pai:
Even these might be cause of the exception. Reason might be the condition for breaking out of the loop is NEVER met.


This would cause the program to loop forever, but it would not cause a StackOverflowException.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya you are right. Accept my mistake. Just wanted, Henry to confirm that if there are any method invocations in the looping statement, then that method
might have been called continuously because of the condition for breaking the loop never being met

Thanks for pointing the mistake
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic