wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes what is StackOverflowError(code) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "what is StackOverflowError(code)" Watch "what is StackOverflowError(code)" New topic
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: 9937
    
159

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: 9937
    
159

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: 9937
    
159

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: 24183
    
  34

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: 9937
    
159

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what is StackOverflowError(code)
 
Similar Threads
last week of class last assignment. Any help is appreciated.
calculator program help please
unable to remove spaces between buttons(making a calculator)
Boolean problem
Implementing scanner into a simple login page