JavaRanch » Java Forums »
Java »
Beginning Java
| Author |
what is StackOverflowError(code)
|
henry akoma
Greenhorn
Joined: May 17, 2005
Posts: 21
|
|
[ July 25, 2005: Message edited by: henry akoma ]
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
|
|
|
Pretty large code, Can you post the detail log message, so that we can narrow down on the error
|
[My Blog] [JavaRanch Journal]
|
 |
henry akoma
Greenhorn
Joined: May 17, 2005
Posts: 21
|
|
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
Joined: Jul 20, 2005
Posts: 8141
|
|
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
Joined: Jul 20, 2005
Posts: 8141
|
|
|
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
Joined: Jul 08, 2003
Posts: 24041
|
|
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.
|
[Jess in Action][AskingGoodQuestions]
|
 |
Jaikiran Pai
Marshal
Joined: Jul 20, 2005
Posts: 8141
|
|
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
|
 |
 |
|
|
subject: what is StackOverflowError(code)
|
|
|
|